paintbalbot

paintballbot's current script

Mar 31st, 2014
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 11.88 KB | None | 0 0
  1. ON *:START: { server irc.twitch.tv:6667 }
  2. on *:TEXT:!commands:#: {
  3.   if ((%floodcommands) || ($($+(%,floodcommands.,$nick),5))) { return }
  4.   set -u15 %floodcommands On
  5.   msg $chan $nick -> the current commands and their info for the bot can be found here http://bit.ly/PBBcommands  $+
  6. }
  7. on *:text:hi:#: {
  8.   if ((%floodhi) || ($($+(%,floodhi.,$nick),5))) { return }
  9.   set -u10 %floodhi On
  10.   set -u600 %floodhi. $+ $nick On
  11.   msg $chan Welcome $nick to the livestream!
  12. }
  13. on *:text:hello:#: {
  14.   if ((%floodhi) || ($($+(%,floodhi.,$nick),5))) { return }
  15.   set -u10 %floodhi On
  16.   set -u600 %floodhi. $+ $nick On
  17.   msg $chan Welcome $nick to the livestream!
  18. }
  19. on *:text:hello!:#: {
  20.   if ((%floodhi) || ($($+(%,floodhi.,$nick),5))) { return }
  21.   set -u10 %floodhi On
  22.   set -u600 %floodhi. $+ $nick On
  23.   msg $chan Welcome $nick to the livestream!
  24. }
  25.  
  26. on *:TEXT:hey mark:#: {
  27.   if ((%floodhi) || ($($+(%,floodhi.,$nick),5))) { return }
  28.   set -u10 %floodhi On
  29.   set -u600 %floodhi. $+ $nick On
  30.   msg $chan Welcome $nick to the livestream!
  31. }
  32. on *:TEXT:hi mark:#: {
  33.   if ((%floodhi) || ($($+(%,floodhi.,$nick),5))) { return }
  34.   set -u10 %floodhi On
  35.   set -u600 %floodhi. $+ $nick On
  36.   msg $chan Welcome $nick to the livestream!
  37. }
  38. on *:text:bye:#: {
  39.   if ((%floodbye) || ($($+(%,floodbye.,$nick),5))) { return }
  40.   set -u10 %floodbye On
  41.   set -u600 %floodbye. $+ $nick On
  42.   msg $chan We're sorry to see $nick go :(
  43. }
  44. on *:text:bye mark:#: {
  45.   if ((%floodbye) || ($($+(%,floodbye.,$nick),5))) { return }
  46.   set -u10 %floodbye On
  47.   set -u600 %floodbye. $+ $nick On
  48.   msg $chan We're sorry to see $nick go :(
  49. }
  50. on *:TEXT:!startlinks:#: {
  51.   if ($nick isop #) {
  52.     msg $chan Links will now play every 10 minutes
  53.     .timerLinks 0 600 .play # C:\Users\hunter\Desktop\mirc\links\pblinks.txt
  54.   }
  55.   if ($read(reglist.txt,nw,$nick)) {
  56.     msg $chan Links will now play every 10 minutes
  57.     .timerLinks 0 600 .play # C:\Users\hunter\Desktop\mirc\links\pblinks.txt
  58.   }
  59. }
  60. on *:TEXT:!stoplinks:#: {
  61.   if ($nick isop #) {
  62.     msg $chan Link cycle is now stopping.
  63.     .timerLinks off
  64.   }
  65.   if ($read(reglist.txt,nw,$nick)) {
  66.     msg $chan Link cycle is now stopping.
  67.     .timerLinks off
  68.   }
  69. }
  70. on *:TEXT:!newsub:#: {
  71.   if ($nick isop #) {
  72.     msg $chan pantherMc Welcome the new sub to the pather army! pantherMc
  73.   }
  74.   if ($nick == TheYoungerGamer ) {
  75.     msg $chan pantherMc Welcome the new sub to the pather army! pantherMc
  76.   }
  77.  
  78. }
  79. on *:TEXT:!subonly:#: {
  80.   if ($nick !isop #) {
  81.     msg $chan entering subscriber-only chat
  82.     msg $chan .subscribers
  83.   }
  84.   if ($nick == theyoungergamer ) {
  85.     msg $chan entering subscriber-only chat
  86.     msg $chan .subscribers
  87.   }
  88. }
  89. on *:TEXT:!so:#: {
  90.   if ($nick isop #) {
  91.     msg $chan entering subscriber-only chat
  92.     msg $chan .subscribers
  93.   }
  94.   if ($nick == theyoungergamer ) {
  95.     msg $chan entering subscriber-only chat
  96.     msg $chan .subscribers
  97.   }
  98. }
  99. on *:TEXT:!subonlyoff:#: {
  100.   if ($nick isop #) {
  101.     msg $chan sub-only chat is now off
  102.     msg $chan .subscribersoff
  103.   }
  104.   if ($nick == theyoungergamer ) {
  105.     msg $chan sub-only chat is now off
  106.     msg $chan .subscribersoff
  107.   }
  108. }
  109. on *:TEXT:!sooff:#: {
  110.   if ($nick !isop #) {
  111.     msg $chan sub-only chat is now off
  112.     msg $chan .subscribersoff
  113.   }
  114.   if ($nick == theyoungergamer ) {
  115.     msg $chan sub-only chat is now off
  116.     msg $chan .subscribersoff
  117.   }
  118. }
  119. on *:TEXT:*just subscribed!:#:{
  120.   if ($nick == twitchnotify ) {
  121.     { msg $chan pantherMc Welcome $$1 to the panther army! pantherMc }
  122.     write reglist.txt $$1
  123.     { msg $chan $$1 has been granted link power! }
  124.   }
  125. }
  126. on *:TEXT:!sreg add*:#: {
  127.   if ($nick isop #) {
  128.     write sreglist.txt $$3
  129.     write reglist.txt $$3
  130.     msg $chan $$3 has been added to the special regular list!
  131.   }
  132.   if ($nick == theyoungergamer ) {
  133.     write sreglist.txt $$3
  134.     write reglist.txt $$3
  135.     msg $chan $$3 has been added to the special regular list!
  136.   }
  137. }
  138. on *:TEXT:!sreg del*:#: {
  139.   if ($nick isop #) {
  140.     if ($read(sreglist.txt,nw,$3)) write -dl $+ $readn sreglist.txt
  141.     msg # $$3 has been removed from the special regular list!
  142.   }
  143.   if ($nick == theyoungergamer ) {
  144.     if ($read(sreglist.txt,nw,$3)) write -dl $+ $readn sreglist.txt
  145.     msg # $$3 has been removed from the special regular list!
  146.   }
  147. }
  148. on *:TEXT:!reg add*:#: {
  149.   if ($nick isop #) {
  150.     write reglist.txt $$3
  151.     msg $chan $$3 has been added to the regular list!
  152.   }
  153.   if ($read(sreglist.txt,nw,$nick)) {
  154.     write reglist.txt $$3
  155.     msg $chan $$3 has been added to the regular list!
  156.   }
  157. }
  158. on *:text:!reg is*:#: {
  159.   if ($read(reglist.txt,nw,$3)) { msg $chan $$3 is on the regular list! }
  160.   else { msg $chan $$3 is not on the regular list. }
  161. }
  162. on *:text:!sreg is*:#: {
  163.   if ($read(sreglist.txt,nw,$3)) { msg $chan $$3 is on the special regular list! }
  164.   else { msg $chan $$3 is not on the special regular list. }
  165. }
  166.  
  167.  
  168. on *:TEXT:!reg del*:#: {
  169.   if ($nick isop #) {
  170.     if ($read(reglist.txt,nw,$3)) write -dl $+ $readn reglist.txt
  171.     msg # $$3 has been removed from the regular list!
  172.   }
  173.   if ($read(sreglist.txt,nw,$nick)) {
  174.     if ($read(reglist.txt,nw,$3)) write -dl $+ $readn reglist.txt
  175.     msg # $$3 has been removed from the regular list!
  176.   }
  177. }
  178. on *:TEXT:!permit*:#: {
  179.   if ($nick isop #) && ($2) {
  180.     write reglist.txt $2
  181.     msg # $2 has been permited to post a link for 20 seconds
  182.     .timerRemovePermit 1 20 RemovePermit # $2
  183.   }
  184.   if ($read(sreglist.txt,nw,$nick)) && ($2) {
  185.     write reglist.txt $2
  186.     msg # $2 has been permited to post a link for 20 seconds
  187.     .timerRemovePermit 1 20 RemovePermit # $2
  188.   }
  189. }
  190.  
  191. alias -l RemovePermit {
  192.   write $+(-ds,$2) reglist.txt
  193.   msg $1 $2 is no longer allowed to post a link
  194. }
  195. on *:text:!mods:#: {
  196.   if (!%twitchmodlst.delay) {
  197.     var %t = 1
  198.     while (%t <= $nick(#,0,o)) {
  199.       var %tmod = $iif(%tmod,%tmod $nick(#,%t,o),$nick(#,%t,o))
  200.       inc %t
  201.     }
  202.     set -eu60 %twitchmodlst.delay 1
  203.     msg # Mods Online: $iif(%tmod,%tmod,None)
  204.   }
  205. }
  206. on *:text:*.com*:#:{
  207.   if ($read(reglist.txt,nw,$nick)) return
  208.   Msg # .timeout $nick 1
  209.   Msg # Stop posting links!
  210. }
  211. on *:text:*www.*:#:{
  212.   if ($read(reglist.txt,nw,$nick)) return
  213.   Msg # .timeout $nick 1
  214.   Msg # Stop posting links!
  215. }
  216. on *:text:*http*:#:{
  217.   if ($read(reglist.txt,nw,$nick)) return
  218.   Msg # .timeout $nick 1
  219.   Msg # Stop posting links!
  220. }
  221. on *:text:*https*:#:{
  222.   if ($read(reglist.txt,nw,$nick)) return
  223.   Msg # .timeout $nick 1
  224.   Msg # Stop posting links!
  225. }
  226. on *:text:*.info*:#:{
  227.   if ($read(reglist.txt,nw,$nick)) return
  228.   Msg # .timeout $nick 1
  229.   Msg # Stop posting links!
  230. }
  231. on *:text:*.uk*:#:{
  232.   if ($read(reglist.txt,nw,$nick)) return
  233.   Msg # .timeout $nick 1
  234.   Msg # Stop posting links!
  235. }
  236. on *:text:!*:#:{
  237.   write commandslog.txt $nick $+ : $$1-
  238. }
  239. on *:TEXT:!paintball *:#: {
  240.   if ($2 == mark_paintball) {
  241.     var %mark = $rand(1,3)
  242.     if (%mark == 1) { msg # $$2 slaughters $$3 in a paintball battle! }
  243.     elseif (%mark == 2) { msg # $$3 has been shot between the eyes by $$2 $+ ! }
  244.     elseif (%mark == 3) { msg # Paintball match! $$2 wins by a landslide against $$3 $+ ! }
  245.   }
  246.   else {
  247.     var %others = $rand(1,6)
  248.     if (%others == 1) { msg # $$2 slaughters $$3 in a paintball battle! }
  249.     elseif (%others == 2) { msg # $$3 has been shot between the eyes by $$2 $+ ! }
  250.     elseif (%others == 3) { msg # Paintball match! $$2 wins by a landslide against $$3 $+ ! }
  251.     elseif (%others == 4) { msg # $$3 slaughters $$2 in a paintball battle! }
  252.     elseif (%others == 5) { msg # $$2 has been shot between the eyes by $$3 $+ ! }
  253.     elseif (%others == 6) { msg # Paintball match! $$3 wins by a landslide against $$2 $+ ! }
  254.   }
  255. }
  256. ;
  257. ;other files i have loaded
  258. ;
  259. ;
  260. ;add commands
  261. ;
  262. on $*:text:/^!commandadd !?(\S+)/iS:#:{
  263.   if ($read(sreglist.txt,nw,$nick)) {
  264.     msg # Successfully created $regml(1) $+ !
  265.     writeini allcommands.ini commands $regml(1) $$3-
  266.   }
  267. }
  268. on $*:text:/^!commandremove !?(\S+)/iS:#:{
  269.   if ($read(sreglist.txt,nw,$nick)) {
  270.     msg # successfully removed command $regml(1) $+ !
  271.     remini allcommands.ini commands $regml(1)
  272.   }
  273. }
  274. on $*:text:/^!(\S+)/:#:{
  275.   if ($readini(allcommands.ini,n,commands,$regml(1))) msg # $v1
  276. }
  277.  
  278. alias safe return $!decode( $encode($1,m) ,m)
  279. ;
  280. ;a strawpoll and caps block script
  281. ;
  282. on *:text:!poll *:#:{
  283.   if ($read(sreglist.txt,nw,$nick)) {
  284.     var %regex = /(?:(.+?)\s*[:-]+\s*|())(.+?)$/iS
  285.     if ($regex($strip($2-),%regex)) {
  286.       var %title = $iif($regml(1),$v1,Poll)
  287.       var %options = $regsubex($regml(2),/\s* $+ $chr(44) $+ \s*/g,$chr(44))
  288.     }
  289.     else return
  290.  
  291.     noop $strawpoll.create(#,%title,%options)
  292.   }
  293.   else { msg $chan you are not a Special regular. Ask a mod to !sreg add [name] }
  294. }
  295. alias strawpoll.create {
  296.   var %chan = $1, %title = $urlencode($2), %options
  297.   var %multi = true, %permissive = false
  298.  
  299.   var %i = 1, %n = $numtok($3,44)
  300.   while (%i <= %n) {
  301.     %options = %options $+ &options[]= $+ $urlencode($gettok($3,%i,44))
  302.     inc %i
  303.   }
  304.  
  305.   var %sockname = strawpoll. $+ $ticks
  306.   hfree -w %sockname | hmake %sockname
  307.   hadd %sockname headerfile %sockname $+ .header.txt
  308.   hadd %sockname datafile %sockname $+ .data.txt
  309.  
  310.   hadd %sockname host strawpoll.me
  311.   hadd %sockname request /ajax/new-poll
  312.   hadd %sockname method POST
  313.   hadd %sockname data $+(title=,%title,%options,&multi=,%multi,&permissive=,%permissive)
  314.   hadd %sockname signal strawpoll.create
  315.   hadd %sockname params %chan
  316.  
  317.   sockopen %sockname $hget(%sockname,host) 80
  318. }
  319.  
  320. on *:signal:strawpoll.create:{
  321.   var %err = $1, %sockname = $2, %header = $3, %data = $4, %chan = $5
  322.  
  323.   if (* 200 OK iswm $read(%header,1)) && ($regex($read(%data,n,1),(\d+))) {
  324.     msg %chan http://strawpoll.me/ $+ $regml(1)
  325.   }
  326.   else msg %chan Could not create poll.
  327.  
  328.   hfree -w %sockname
  329.   .remove %header | .remove %data
  330. }
  331.  
  332. on *:sockopen:strawpoll.*:{
  333.   var %a = sockwrite -n $sockname
  334.   %a $hget($sockname,method) $hget($sockname,request) HTTP/1.0
  335.   %a Host: $hget($sockname,host)
  336.   %a Connection: close
  337.   if ($hget($sockname,data) != $null) {
  338.     %a Content-Type: application/x-www-form-urlencoded
  339.     %a Content-Length: $len($v1)
  340.   }
  341.   %a $+($crlf,$hget($sockname,data))
  342. }
  343.  
  344. on *:sockread:strawpoll.*:{
  345.   var %header
  346.   var %headerfile = $hget($sockname,headerfile)
  347.   var %datafile = $hget($sockname,datafile)
  348.  
  349.   if (!$hget($sockname,header.complete)) {
  350.     sockread %header
  351.     while (%header != $null) {
  352.       write %headerfile %header
  353.       sockread %header
  354.     }
  355.     if ($sockbr) hadd $sockname header.complete $true
  356.   }
  357.   if ($hget($sockname,header.complete)) {
  358.     sockread &read
  359.     while ($sockbr) {
  360.       bwrite %datafile -1 -1 &read
  361.       sockread &read
  362.     }
  363.   }
  364. }
  365.  
  366. on *:sockclose:strawpoll.*:{
  367.   var %header = $hget($sockname,headerfile)
  368.   var %data = $hget($sockname,datafile)
  369.   var %signal = $hget($sockname,signal)
  370.   var %params = $hget($sockname,params)
  371.  
  372.   if (%signal) .signal %signal 0 $sockname %header %data %params
  373.   else {
  374.     hfree -w $sockname
  375.     .remove %header | .remove %data
  376.   }
  377. }
  378.  
  379. alias urlencode return $regsubex($1-,/([^A-Z0-9])/gi,$+(%,$base($asc(\1),10,16)))
  380.  
  381. on !*:text:*:#:{
  382.   if ($nick isop #) return
  383.   if ($read(sreglist.txt,nw,$nick)) return
  384.   if ( $len($1-) >= 10 ) {
  385.     if ( $calc($regex($1-,/[A-Z]/g) / $regex($1-,/[A-Z]/gi) * 100) >= 75 ) {
  386.  
  387.       ; check if user is not warned yet
  388.       if !$istok(%caps.warned,$nick,32) {
  389.  
  390.         ; warning user      
  391.         msg $chan $nick -> stop typing in caps! [warning]
  392.  
  393.         ; add user to %caps.warned, so we can check it later
  394.         set -e %caps.warned $addtok(%caps.warned,$nick,32)
  395.  
  396.         ; set timer to remove user from %caps.warned after 300s
  397.         .timer 1 300 remove.warned $nick
  398.       }
  399.       else {
  400.         ; so user is already warned..
  401.         { msg $chan Caps again :( } { msg $chan .timeout $nick 60 }
  402.       }
  403.     }
  404.   }
  405. }
  406. alias -l remove.warned {
  407.   set -e %caps.warned $remtok(%caps.warned,$1,1,32)
  408. }
Add Comment
Please, Sign In to add comment