1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
alias -l isipp { if ($isid) { if ($regex($1,\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0 -9]|[01]?[0-9][0-9]?):(?:6[0-5]{2}[0-3][0-5]|[1-5][0-9]{0,4}|[1-9][0-9 ]{0,3}|[0-9])\b)) { return $1 } } } alias -l id { while (id) { var %id = $1 $+ $ticks $+ $r(1,1000000) if (!$sock(%id)) { return %id } } } alias -l getport { if ($isid) { var %x = 2000 while (%x <= 4000) { if ($portfree(%x)) { return %x } inc %x } } } alias -l teams { return $gettok($1,$2,32) } on *:text:Report & &:?:{ if ($isipp($2)) && (!$hget(report,$2)) { if ($nick isop #thesgl.gather) && ($id(Report)) { sockudp -k $v1 $replace($2,:,$chr(32)) ˙˙˙˙challenge rcon sockmark $v1 $replace($2,:,$chr(32)) $3 hadd report $2 $v1 hadd report ($2,.half) 1 msg $nick Now Reporting live updates of the score for $2 $+ , to you. } else { msg $nick You're not opped in #thesgl. } } else { msg $nick You haven't given a valid ip or port range or I'm already listing a report on $2 $+ . } } on *:text:Teams & & &:{ if ($hget(report,$2)) { if ($nick isop #theSGL.gather) { hadd report $+($2,.teams) $3 $4 Msg $nick The following teams are now known as, CT $3 $+ , T $4 $+ . } else { msg $nick You're not opped in #theSGL } } else { msg $nick The bot is not listing live reports on $2 $+ . } } on *:text:Stop & &:?:{ if ($isipp($2)) && ($hget(report,$2)) { var %z = $getport,%y = $id(logdel) sockudp -nk %y %z $replace($2,:,$chr(32)) ˙˙˙˙challenge rcon sockmark %y $hget(report,$2) $replace($2,:,$chr(32)) $3 hdel report $2 if ($hget(report,$+($2,.teams)) { hdel report $+($2,.teams) } msg $nick Now stopped the live report on $2 $+ . } else { msg $nick The bot is not listing live reports on $2 $+ . } } on *:udpread:Report*:{ var %data sockread -f %data if (˙˙˙˙challenge rcon isin %data) && ($id(Recieved)) { var %z = $getport,%y = $id(Recieved) sockudp -nk %y %z $gettok($sock($sockname).mark,1-2,32) ˙˙˙˙rcon $gettok(%data,3,32) $gettok($sock($sockname).mark,3,32) logaddress_add 193.238.84.97 %z sockmark %y %z $gettok($sock($sockname).mark,1-2,32) hadd report $replace($gettok($sock($sockname).mark,1-2,32),$chr(32),:) %y sockclose $sockname } sockclose $sockname } on *:udpread:Recieved*:{ var %data sockread -f %data if (%data == ˙˙˙˙lBad rcon_password.) { msg #theSGL Rcon password specifyed is wrong, IP: $replace($gettok($sock($sockname).mark,2-3,32),$chr(32),:) $+ . hdel report $replace($gettok($sock($sockname).mark,2-3,32),$chr(32),:) if ($hget(report,$+($replace($gettok($sock($sockname).mark,2-3,32),$chr(32),:),.teams))) { hdel report $+($replace($gettok($sock($sockname).mark,2-3,32),$chr(32),:),.teams) } sockclose $sockname } while ($sockbr) { if ($regex(%data,\s\"([^"]+)\"\s*\(([^()]+)\)\s\(([^()]+)\))) { if (!$hget(report,$+($replace($gettok($sock($sockname).mark,2-3,32),$chr(32),:),.,teams))) { msg #theSGL (LIVEUPDATE): IP, $replace($gettok($sock($sockname).mark,2-3,32),$chr(32),:) - Score: $replace($regml(1),_,$chr(32)) - $regml(2) $regml(3) } if ($hget(report,$+($replace($gettok($sock($sockname).mark,2-3,32),$chr(32),:),.,teams))) { msg #theSGL (LIVEUPDATE): IP, $replace($gettok($sock($sockname).mark,2-3,32),$chr(32),:) - Score: $replace($regml(1),_,$chr(32)) - $replace($regml(2),$teams($v1,1)) $replace($regml(3),$teams($v1,2)) } } var %data sockread -f %data } } on *:udpread:logdel*:{ var %data sockread -f %data if (˙˙˙˙challenge rcon isin %data) { sockudp -n $id(temp) $gettok($sock($sockname).mark,2-3,32) ˙˙˙˙rcon $gettok(%data,3,32) $gettok($sock($sockname).mark,4,32) logaddress_del 193.238.84.97 $gettok($sock($gettok($sock($sockname).mark,1,32)).mark,1,32) } sockclose $gettok($sock($sockname).mark,1,32) sockclose $sockname } |
if ($hget(report,$+($2,.teams)) {| Parsed for bracket errors and indented: | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
alias -l isipp { if ($isid) { if ($regex($1,\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0 -9]|[01]?[0-9][0-9]?):(?:6[0-5]{2}[0-3][0-5]|[1-5][0-9]{0,4}|[1-9][0-9 ]{0,3}|[0-9])\b)) { return $1 } } } alias -l id { while (id) { var %id = $1 $+ $ticks $+ $r(1,1000000) if (!$sock(%id)) { return %id } } } alias -l getport { if ($isid) { var %x = 2000 while (%x <= 4000) { if ($portfree(%x)) { return %x } inc %x } } } alias -l teams { return $gettok($1,$2,32) } on *:text:Report & &:?:{ if ($isipp($2)) && (!$hget(report,$2)) { if ($nick isop #thesgl.gather) && ($id(Report)) { sockudp -k $v1 $replace($2,:,$chr(32)) ˙˙˙˙challenge rcon sockmark $v1 $replace($2,:,$chr(32)) $3 hadd report $2 $v1 hadd report ($2,.half) 1 msg $nick Now Reporting live updates of the score for $2 $+ , to you. } else { msg $nick You're not opped in #thesgl. } } else { msg $nick You haven't given a valid ip or port range or I'm already listing a report on $2 $+ . } } on *:text:Teams & & &:{ if ($hget(report,$2)) { if ($nick isop #theSGL.gather) { hadd report $+($2,.teams) $3 $4 Msg $nick The following teams are now known as, CT $3 $+ , T $4 $+ . } else { msg $nick You're not opped in #theSGL } } else { msg $nick The bot is not listing live reports on $2 $+ . } } on *:text:Stop & &:?:{ if ($isipp($2)) && ($hget(report,$2)) { var %z = $getport,%y = $id(logdel) sockudp -nk %y %z $replace($2,:,$chr(32)) ˙˙˙˙challenge rcon sockmark %y $hget(report,$2) $replace($2,:,$chr(32)) $3 hdel report $2 if ($hget(report,$+($2,.teams)) { hdel report $+($2,.teams) } msg $nick Now stopped the live report on $2 $+ . } else { msg $nick The bot is not listing live reports on $2 $+ . } } on *:udpread:Report*:{ var %data sockread -f %data if (˙˙˙˙challenge rcon isin %data) && ($id(Recieved)) { var %z = $getport,%y = $id(Recieved) sockudp -nk %y %z $gettok($sock($sockname).mark,1-2,32) ˙˙˙˙rcon $gettok(%data,3,32) $gettok($sock($sockname).mark,3,32) logaddress_add 193.238.84.97 %z sockmark %y %z $gettok($sock($sockname).mark,1-2,32) hadd report $replace($gettok($sock($sockname).mark,1-2,32),$chr(32),:) %y sockclose $sockname } sockclose $sockname } on *:udpread:Recieved*:{ var %data sockread -f %data if (%data == ˙˙˙˙lBad rcon_password.) { msg #theSGL Rcon password specifyed is wrong, IP: $replace($gettok($sock($sockname).mark,2-3,32),$chr(32),:) $+ . hdel report $replace($gettok($sock($sockname).mark,2-3,32),$chr(32),:) if ($hget(report,$+($replace($gettok($sock($sockname).mark,2-3,32),$chr(32),:),.teams))) { hdel report $+($replace($gettok($sock($sockname).mark,2-3,32),$chr(32),:),.teams) } sockclose $sockname } while ($sockbr) { if ($regex(%data,\s\"([^"]+)\"\s*\(([^()]+)\)\s\(([^()]+)\))) { if (!$hget(report,$+($replace($gettok($sock($sockname).mark,2-3,32),$chr(32),:),.,teams))) { msg #theSGL (LIVEUPDATE): IP, $replace($gettok($sock($sockname).mark,2-3,32),$chr(32),:) - Score: $replace($regml(1),_,$chr(32)) - $regml(2) $regml(3) } if ($hget(report,$+($replace($gettok($sock($sockname).mark,2-3,32),$chr(32),:),.,teams))) { msg #theSGL (LIVEUPDATE): IP, $replace($gettok($sock($sockname).mark,2-3,32),$chr(32),:) - Score: $replace($regml(1),_,$chr(32)) - $replace($regml(2),$teams($v1,1)) $replace($regml(3),$teams($v1,2)) } } var %data sockread -f %data } } on *:udpread:logdel*:{ var %data sockread -f %data if (˙˙˙˙challenge rcon isin %data) { sockudp -n $id(temp) $gettok($sock($sockname).mark,2-3,32) ˙˙˙˙rcon $gettok(%data,3,32) $gettok($sock($sockname).mark,4,32) logaddress_del 193.238.84.97 $gettok($sock($gettok($sock($sockname).mark,1,32)).mark,1,32) } sockclose $gettok($sock($sockname).mark,1,32) sockclose $sockname } |