;OmegaScript v2.87 ;Written by Adam- on *:CONNECT: { mode $me +TBpR ;.timercc $+ $network 0 120 chancheck } on *:DISCONNECT: { timers off unsetall } on *:JOIN:#: { if ($readini(botinfo.ini,n,cmbonjoin,$chan) == true) { if ($readini(botinfo.ini,n,defname,$address($nick,3)) != $null) { var %name $v1 } else var %name $nick var %x 1 while ($sock(cmb. $+ %x)) inc %x sockopen $+(cmb.,%x) hiscore.runescape.com 80 sockmark $+(cmb.,%x) -1 $+ ~ $+ msg $chan $+ ~ $+ $nick $+ ~ $+ %name var %x 1 while ($sock(clan. $+ %x)) inc %x sockopen $+(clan.,%x) runehead.com 80 sockmark $+(clan.,%x) msg $chan $+ ~ $+ %name $+ ~ $+ $nick } } off *:INVITE:#: { if ($chan(0) >= 30) { notice $nick $c2($nick,I am currently full, please try again later.) halt } if ($readini(botinfo.ini,n,kicks,$chan) < 5) || ($readini(botinfo.ini,n,kicks,$chan) == $null) { ;msg #OmegaScript $+($chr(3),07,$nick,$chr(3)) has invited me to $+($chr(3),07,$chan,$chr(3)) $+ . join $chan .timer 1 2 msg $chan Hello! I'm $me $+ . I was invited by $nick $+ . Go to $+($chr(3),07,http://freewebs.com/omegascript/,$chr(3)) to view my commands. If I am kicked 5 times this channel is blacklisted, kicks left: $+($chr(3),07,$iif($readini(botinfo.ini,n,kicks,$chan),$calc(5 - $v1),5),/5,$chr(3),.) To remove me type $+($chr(3),07,!part $me,$chr(3)) ignore -iu300 $iif($address($nick,2),$v1,$nick) } else { notice $nick You can not invite me because your channel is blacklisted, join #OmegaScript to get this appealed. ignore -iu300 $iif($address($nick,2),$v1,$nick) } } off *:PART:#: { if ($nick != $me) { if ($nick($chan,0) < 4) { part $chan You need at least two other people to keep me. } } if ($nick == $me) { ;msg #omegascript I have just parted $+($chr(3),07,$chan,$chr(3),.) } } on *:KICK:#: { if ($knick == $me) { ignore -iu300 $iif($address($nick,2),$v1,$nick) if ($readini(botinfo.ini,n,kicks,$chan) == $null) { writeini botinfo.ini kicks $chan 1 } else { var %x $readini(botinfo.ini,n,kicks,$chan) inc %x writeini botinfo.ini kicks $chan %x } ;msg #omegascript I was just kicked from $+($chr(03),07,$chan,$chr(03)) by $+($chr(03),07,$nick,$chr(03),.) } } on *:TEXT:*:?: close -m on $*:TEXT:/^[!@]define/Si:#: halt on $*:TEXT:/^[!@](start|stop|check|end)/Si:#: { if ($regml(1) == start) { if ($skill2($2)) { if ($3 != $null) { if ($regex($3,/^(.+)&$/)) { if ($readini(botinfo.ini,n,defname,$address($regml(1),3))) { var %name $v1 } else { $mh($1,$chan,$nick) *** $+([,$c1($nick,Error),]:) $c2($nick,The name) $qt($c1($nick,$regml(1))) $c2($nick,does not have a defname set or is not in the channel.) halt } } else { var %name $replace($3-,$chr(32),_) } } else { if ($readini(botinfo.ini,n,defname,$address($nick,3))) { var %name $v1 } else { $mh($1,$chan,$nick) *** $+([,$c1($nick,Error),]:) $c2($nick,You must specify a user or set a default name.) halt } } var %x 1 while ($sock(startstop. $+ %x)) inc %x sockopen $+(startstop.,%x) hiscore.runescape.com 80 sockmark $+(startstop.,%x) %name $+ ~ $+ $skill2($2) $+ ~ $+ $mh($1,$chan,$nick) $+ ~ $+ $nick } } else { if ($readini(startstop.ini,n,$address($nick,3),skill)) { var %skill $v1 } else { $mh($1,$chan,$nick) *** $+([,$c1($nick,Error),]:) $c2($nick,You must start something first.) halt } var %x 1 while ($sock(startstop. $+ %x)) inc %x sockopen $+(startstop.,%x) hiscore.runescape.com 80 sockmark $+(startstop.,%x) $readini(startstop.ini,n,$address($nick,3),name) $+ ~ $+ %skill $+ ~ $+ $mh($1,$chan,$nick) $+ ~ $+ $nick $+ ~ $+ $iif($regml(1) == check,check,end) } } on *:SOCKOPEN:startstop.*: { tokenize 126 $sock($sockname).mark sockwrite -n $sockname GET /index_lite.ws?player= $+ $1 HTTP/1.1 sockwrite -n $sockname Host: hiscore.runescape.com sockwrite -n $sockname $crlf } on *:SOCKREAD:startstop.*: { tokenize 126 $sock($sockname).mark var %read sockread %read if (*404*page*not* iswm %read) { $3 *** $+([,$c1($4,START),]:) $c2($4,The name) $qt($c1($4,$1))) $c2($4,isn't in the RSHS.) sockclose $sockname halt } if (*,*,* iswm %read) { var %x 0 while ($2 != $skill(%x)) { sockread %read inc %x } if (-1 isin %read) { $3 *** $+([,$c1($4,Error),]:) $c2($4,The name) $qt($c1($4,$1)) $c2($4,isn't ranked in) $c1($4,$2) $c2($4,in the RSHS.) sockclose $sockname halt } if ($5 == $null) { writeini startstop.ini $address($4,3) startxp $gettok(%read,3,44) writeini startstop.ini $address($4,3) starttime $ctime writeini startstop.ini $address($4,3) skill $2 writeini startstop.ini $address($4,3) name $1 $3 *** $+([,$c1($4,START),]:) $+([,$c1($4,$1),]:) $c2($4,Your starting experience of) $c1($4,$bytes($gettok(%read,3,44),db)) $c2($4,in) $c1($4,$2) $C2($4,has been recorded.) } else { var %startxp $readini(startstop.ini,n,$address($4,3),startxp) var %starttime $readini(startstop.ini,n,$address($4,3),starttime) var %skill $readini(startstop.ini,n,$address($4,3),skill) var %name $readini(startstop.ini,n,$address($4,3),name) var %gainedxp $calc($gettok(%read,3,44) - %startxp) var %totaltime $calc($ctime - %starttime) var %xpforlevel $gettok(%read,2,44) inc %xpforlevel var %xpforlevel $xpforlevel(%xpforlevel) var %xpforlevel $calc(%xpforlevel - $gettok(%read,3,44)) $3 *** $+([,$c1($4,$upper($5)),]:) $c2($4,You've gained) $c1($4,$bytes(%gainedxp,db) %skill) $c2($4,experience in) $c1($4,$duration(%totaltime)) $+ $c2($4,. That's) $c1($4,$bytes($round($calc(%gainedxp / %totaltime * 3600),0),db)) $c2($4,experience per hour. Estimated time to level up) $+ : $c1($4,$h2d($calc(%xpforlevel / $round($calc(%gainedxp / %totaltime * 3600),0)))) if ($5 == end) { remini startstop.ini $address($4,3) } } sockclose $sockname halt } } on $*:TEXT:/^[!@]track(er)?/Si:#: { if ($2 == $null) { if ($readini(botinfo.ini,n,defname,$address($nick,3)) != $null) { var %name $v1 } else { $mh($1,$chan,$nick) *** $+([,$c1($nick,Error),]:) $c2($nick,You must specify a user or set a default name.) halt } } else { if ($skill2($2) != $null) { var %skill $skill3($skill2($2)) var %x 3 while ($ [ $+ [ %x ] ] != $null) && (@* !iswm $ [ $+ [ %x ] ]) { var %name %name $+ $iif(%name,_) $+ $ [ $+ [ %x ] ] inc %x } if ($regex($ [ $+ [ %x ] ],/^@[1-9](day|week|month)(?:s)?$/)) { var %time $calc($replace($ [ $+ [ %x ] ],day,*86400,week,*604800,month,*2592000,@,,s,)) } } else { var %x 2 if ($regex($2,/.+&$/)) { if ($readini(botinfo.ini,n,defname,$address($remove($2,&),3))) { var %name $v1 } else { $mh($1,$chan,$nick) *** $+([,$c1($nick,Error),]:) $c2($nick,The name) $qt($c1($nick,$remove($2,&))) $c2($nick,does not have a defname set or isnt in the channel.) halt } } else { while ($ [ $+ [ %x ] ] != $null) && (@* !iswm $ [ $+ [ %x ] ]) { var %name %name $+ $iif(%name,_) $+ $ [ $+ [ %x ] ] inc %x } } if ($regex($ [ $+ [ %x ] ],/^@[1-9](day|week|month)(?:s)?$/)) { var %time $calc($replace($ [ $+ [ %x ] ],day,*86400,week,*604800,month,*2592000,@,,s,)) } } } if (%time == $null) var %time 0 if (%skill == $null) var %skill all if (%name == $null) { if ($readini(botinfo.ini,n,defname,$address($nick,3)) != $null) { var %name $v1 } else { $mh($1,$chan,$nick) *** $+([,$c1($nick,Error),]:) $c2($nick,You must specify a user or set a default name.) halt } } var %x 1 if (%skill == all) { if (%time == 0) var %time 604800 while ($sock(trackerall. $+ %x)) inc %x sockopen $+(trackerall.,%x) rscript.org 80 sockmark $+(trackerall.,%x) $mh($1,$chan,$nick) $+ ~ $+ $nick $+ ~ $+ %time $+ ~ $+ %name $+ ~ $+ %skill } else { while ($sock(trackerskill. $+ %x)) inc %x sockopen $+(trackerskill.,%x) rscript.org 80 sockmark $+(trackerskill.,%x) $mh($1,$chan,$nick) $+ ~ $+ $nick $+ ~ $+ %time $+ ~ $+ %name $+ ~ $+ %skill } } on *:SOCKOPEN:trackerall.*: { tokenize 126 $sock($sockname).mark sockwrite -nt $sockname GET /lookup.php?type=track&time= $+ $3 $+ &user= $+ $4 $+ &skill= $+ $5 HTTP/1.1 sockwrite -nt $sockname Host: rscript.org sockwrite -nt $sockname $crlf } on *:SOCKREAD:trackerall.*: { tokenize 126 $sock($sockname).mark var %read sockread %read while (start: isin %read) && (started !isin %read) { sockmark $sockname $sock($sockname).mark $+ ~ $+ $gettok(%read,3,58) sockread %read var %donewithstart 1 } while ($numtok($sock($sockname).mark,126) < 31) && (%donewithstart == 1) { sockmark $sockname $sock($sockname).mark $+ ~0 } if (%read == 0:-1) || (ERROR: isin %read) { $1 *** $+([,$c1($2,TRACKER),]): $c2($2,The name) $qt($c1($2,$4)) $c2($2,is not ranked in the RSHS.) sockclose $sockname } .sockread %read while (gain isin %read) { sockmark $sockname $sock($sockname).mark $+ ~ $+ $gettok(%read,4,58) sockread %read var %donewithgain 1 } while ($numtok($sock($sockname).mark,126) < 57) && (%donewithgain == 1) { sockmark $sockname $sock($sockname).mark $+ ~0 } tokenize 126 $sock($sockname).mark if ($0 == 57) { var %x 32 while ($gettok($sock($sockname).mark,%x,126) != $null) { if ($gettok($sock($sockname).mark,%x,126) != 0) { if ($lfe($calc($gettok($sock($sockname).mark,$calc(%x - 26),126) - $gettok($sock($sockname).mark,%x,126))) != $lfe($gettok($sock($sockname).mark,$calc(%x - 26),126))) { var %a $v1 $+ -> $+ $v2 } else { var %a $lfe($gettok($sock($sockname).mark,$calc(%x - 26),126)) } var %message = %message $c1($2,$skill($calc(%x - 32))) $+ $c2($2,$+($chr(40),%a,$chr(41))) $c1($2,+ $+ $bytes($gettok($sock($sockname).mark,%x,126),db)) $chr(124) } inc %x } $1 *** $+([,$c1($2,TRACKER),]:) $+([,$c1($2,ALL),]) $c2($2,experience gains for) $c1($2,$4) $c2($2,in the last) $c1($2,$duration($3)) $+ : $gettok(%message,1-10,124) if ($gettok(%message,11-22,124)) { $1 *** $+([,$c1($2,TRACKER),]:) $gettok(%message,11-22,124) if ($gettok(%message,23-,124)) { $1 *** $+([,$c1($2,TRACKER),]:) $gettok(%message,23-,124) } } sockclose $sockname halt } if (%read == END) && (!$regex($gettok($sock($sockname).mark,32-,126),/[1-9]/)) { $1 *** $+([,$c1($2,TRACKER),]:) $c2($3,The name) $qt($c1($3,$4)) $c2($3,has not gained any experience over the last) $c1($3,$duration($3)) $+ $c2($3,.) sockclose $sockname } } on *:SOCKOPEN:trackerskill.*: { tokenize 126 $sock($sockname).mark sockwrite -nt $sockname GET /lookup.php?type=track&time=86400&user= $+ $4 $+ &skill= $+ $5 HTTP/1.1 sockwrite -nt $sockname Host: rscript.org sockwrite -nt $sockname $crlf } on *:SOCKREAD:trackerskill.*: { var %read sockread %read if (started isin %read) { sockread %read var %x 1 while ($sock(trackerskill2. $+ %x)) inc %x sockopen $+(trackerskill2.,%x) rscript.org 80 sockmark $+(trackerskill2.,%x) $sock($sockname).mark $+ ~ $+ $gettok(%read,2,58) sockclose $sockname } } on *:SOCKOPEN:trackerskill2.*: { tokenize 126 $sock($sockname).mark sockwrite -nt $sockname GET /lookup.php?type=track&time=604800&user= $+ $4 $+ &skill= $+ $5 HTTP/1.1 sockwrite -nt $sockname Host: rscript.org sockwrite -nt $sockname $crlf } on *:SOCKREAD:trackerskill2.*: { var %read sockread %read if (started isin %read) { sockread %read var %x 1 while ($sock(trackerskill3. $+ %x)) inc %x sockopen $+(trackerskill3.,%x) rscript.org 80 sockmark $+(trackerskill3.,%x) $sock($sockname).mark $+ ~ $+ $gettok(%read,2,58) sockclose $sockname } } on *:SOCKOPEN:trackerskill3.*: { tokenize 126 $sock($sockname).mark sockwrite -nt $sockname GET /lookup.php?type=track&time=2592000&user= $+ $4 $+ &skill= $+ $5 HTTP/1.1 sockwrite -nt $sockname Host: rscript.org sockwrite -nt $sockname $crlf } on *:SOCKREAD:trackerskill3.*: { tokenize 126 $sock($sockname).mark var %read sockread %read if (started isin %read) { sockread %read sockmark $sockname $sock($sockname).mark $+ ~ $+ $gettok(%read,2,58) tokenize 126 $sock($sockname).mark if ($3 == 0) { $1 *** $+([,$c1($2,TRACKER),]:) $+([,$c1($2,$skill($5)),]:) $c2($2,Experience gains for) $c1($2,$4) $c2($2,in the last) $+ : $c2($2,1 day) $+ : $c1($2,$bytes($6,db)) $chr(124) $c2($2,1 week) $+ : $c1($2,$bytes($7,db)) $chr(124) $c2($2,1 month) $+ : $c1($2,$bytes($8,db)) sockclose $sockname } else { var %x 1 while ($sock(trackerskill4. $+ %x)) inc %x sockopen $+(trackerskill4.,%x) rscript.org 80 sockmark $+(trackerskill4.,%x) $sock($sockname).mark sockclose $sockname } } } on *:SOCKOPEN:trackerskill4.*: { tokenize 126 $sock($sockname).mark sockwrite -nt $sockname GET /lookup.php?type=track&time= $+ $3 $+ &user= $+ $4 $+ &skill= $+ $5 HTTP/1.1 sockwrite -nt $sockname Host: rscript.org sockwrite -nt $sockname $crlf } on *:SOCKREAD:trackerskill4.*: { var %read sockread %read if (started isin %read) { sockread %read sockmark $sockname $sock($sockname).mark $+ ~ $+ $gettok(%read,2,58) tokenize 126 $sock($sockname).mark $1 *** $+([,$c1($2,TRACKER),]:) $+([,$c1($2,$skill($5)),]:) $c2($2,Experience gains for) $c1($2,$4) $c2($2,in the last) $+ : $c2($2,1 day) $+ : $c1($2,$bytes($6,db)) $chr(124) $c2($2,1 week) $+ : $c1($2,$bytes($7,db)) $chr(124) $c2($2,1 month) $+ : $c1($2,$bytes($8,db)) $chr(124) $c2($2,$duration($3)) $+ : $c1($2,$bytes($9,db)) } } on *:TEXT:!set *:#: { if ($nick isop $chan) { if ($2 == cmbonjoin) { var %status $iif($readini(botinfo.ini,n,cmbonjoin,$chan),true,false) if ($3 == on) { if (%status == false) { writeini botinfo.ini cmbonjoin $chan true msg $chan *** $+([,$c1($nick,SET),]:) $c2($nick,CMB on join is now) $c1($nick,on) $c2($nick,for) $c1($nick,$chan) $+ $C2($nick,.) } else { msg $chan *** $+([,$c1($nick,SET),]:) $c2($nick,CMB on join was already on for) $c1($nick,$chan) $+ $c2($nick,.) } } elseif ($3 == off) { if (%status == true) { remini botinfo.ini cmbonjoin $chan msg $chan *** $+([,$c1($nick,SET),]:) $c2($nick,CMB on join is now) $c1($nick,off) $c2($nick,for) $c1($nick,$chan) $+ $c2($nick,.) } else { msg $chan *** $+([,$c1($nick,SET),]:) $c2($nick,CMB on join was already off for) $c1($nick,$chan) $+ $c2($nick,.) } } else { notice $nick *** $+([,$c1($nick,SET),]:) $c2($nick,Either use on or off.) } } else { notice $nick *** $+([,$c1($nick,SET),]:) $c2($nick,Available options are) $+ : $c1($nick,cmbonjoin) } } } on $*:TEXT:/^[!@](npc|monster)/Si:#: { if ($2 == $null) { $iif($left($1,1) $+(=,=) @ && $istok($readini(botinfo.ini,n,IgnoreChannel,Channels),$chan,32) $+(=,=) $false,msg $chan,notice $nick) *** $+([,$c1($nick,NPC),]:) $c2($nick,You must specify a monster to lookup.) halt } var %x 1 while ($sock(npc. $+ %x)) inc %x sockopen $+(npc.,%x) tip.it 80 sockmark $+(npc.,%x) $iif($left($1,1) $+(=,=) @ && $istok($readini(botinfo.ini,n,IgnoreChannel,Channels),$chan,32) $+(=,=) $false,msg $chan,notice $nick) $+ ~ $+ $nick $+ ~ $+ $replace($2-,$chr(32),+,-,+,_,+) } on *:SOCKOPEN:npc.*: { tokenize 126 $sock($sockname).mark sockwrite -nt $sockname GET /runescape/index.php?rs2monster=&orderby=&keywords= $+ $3 $+ &levels=All&race=0 sockwrite -nt $sockname Host: tip.it sockwrite -nt $sockname $crlf } on *:SOCKREAD:npc.*: { var %read sockread %read if ($regex(%read,/