;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;~Script Package v1 by `Max of SwiftIRC~;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;Do not edit any part of the Script without permission.~~~~~~~~~~~~~~~~;; ;;Some Credits to Urza, Sli, and Jeffrey of the SwiftIRC Network.~~~~~~~;; ;;This package was formulated for the basic expectations of Gosu Stizz.~;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; on *:INVITE:#: { join $chan /msg $chan I am $me $+ . I was invited by $nick $+ . Type !whores for my commands. (I am using `Max's Basic Bot Scripts.) } on *:JOIN:#:{ if ($nick == $me { halt } { /notice $nick I am $me $+ . Welcome to $chan and have fun. Type !whores for my commands! (I am using `Max's Basic Bot Scripts.) } } on *:TEXT:!part:#:{ /msg $chan $nick parted me. Bye! } on *:TEXT:!bye:#:{ /msg $chan Bye $nick $+ ! } on *:TEXT:*brb*:#:{ /msg $chan Come back soon $nick $+ ! } on *:TEXT:*gtg*:#:{ /msg $chan Bye $nick $+ . Come back again soon! } on *:TEXT:*g2g*:#:{ /msg $chan Bye $nick $+ . Come back again soon! } on *:TEXT:*afk*:#:{ /msg $chan $nick is now away from his keyboard. } on *:TEXT:*bbl*:#:{ /msg $chan $nick better come back... or else! } on *:TEXT:back:#:{ /msg $chan Yay! $nick is back! } on *:TEXT:wb *:#:{ /msg $chan $2 has came back! Welcome back $2 $+ ! } on *:TEXT:!global *:#:{ if $address($nick,2) == $address($me,2) { /amsg [ $+ $Me GLOBAL] $2- } } on *:TEXT:!gaymeter *:#:{ /msg $chan $2 is... $rand(1,100) $+ % gay. } on *:TEXT:!emometer *:#:{ /msg $chan $2 is $rand(1,100) $+ % emo. } on *:TEXT:!lovemeter *:#:{ /msg $chan $2 and $3 $+'s love combatibility is... $rand(1,100) $+ % $+ . } on *:TEXT:!whores:#:{ /notice $nick I have some nice commands... Have fun with them! :D /notice $nick RuneScape Stats: !defname nick, <@ or !><stats or cmb or skill> RSN /notice $nick Zybez PriceGuide: <@ or !>price item1 /notice $nick RPS: !rock, !paper, !scissors /notice $nick Meters: !gaymeter nick, !emometer nick, !lovemeter nick1 nick2 /notice $nick Calc: !calc problem /notice $nick Google: !gogole topic /notice $nick Have fun with these commands! } on *:TEXT:!paper:#:{ set %pap $rand(1,3) if (%pap == 1) { /msg $chan I choose scissors. I win. } if (%pap == 2) { /msg $chan I choose rock. I lose. } if (%pap == 3) { /msg $chan I choose paper. It's a tie. } } on *:TEXT:!scissors:#:{ set %sci $rand(1,3) if (%sci == 1) { /msg $chan I choose scissors. It's a tie. } if (%sci == 2) { /msg $chan I choose rock. I win. } if (%sci == 3) { /msg $chan I choose paper. I lose. } } on *:TEXT:!rock:#:{ set %roc $rand(1,3) if (%roc == 1) { /msg $chan I choose scissors. I win. } if (%roc == 2) { /msg $chan I choose rock. It's a tie. } if (%roc == 3) { /msg $chan I choose paper. I lose. } } on $*:TEXT:/^[!@.]calc */Si:#: { var %send $iif(!* iswm $1,notice $nick,msg $chan) %send [Calc] $$2- = $calc($replace($2-,k,000,m,000000) $2- )) } on $*:text:/^[!@]google */Si:*:{ inc %ID 1 set %googlechan $chan set $+(%,search.,%ID) $replace($2-,$chr(32),+) $iif($left($1-,1) == @,.msg $chan,.notice $nick) sockopen $+(google.,%ID) www.google.com 80 } on *:SOCKOPEN:google.*: { sockwrite -nt $sockname GET /search?hl=en&q= $+ $gettok($($+(%,search.,%ID),2),1,32) $+ &btnI HTTP/1.1 sockwrite -nt $sockname Host: www.google.com sockwrite -t $sockname $str($crlf,2) } on *:SOCKREAD:google.*: { var %IDt = $right($sockname,-7) var %target = $gettok($($+(%,search.,%IDt),2),2-,32) if ($sockerr) { %target $chr(91) $col(ERROR) $chr(93) Socket error unset %search. $+ $right($sockname,-7) sockclose $sockname } else { var %read | sockread %read if (Location:* iswm %read) { %target Google Result: $remove($htmlfree(%read),Location:) unset %search. $+ $right($sockname,-7) sockclose $sockname } if (*did not match any documents* iswm %read) { %target $chr(91) Google Result: $chr(93) No results were found for " $+ $2- $+ " on Google. unset %search. $+ $right($sockname,-7) sockclose $sockname } } /close -m $nick } alias -l col { return $+($chr(3),$iif($len(%col) == 2,%col,$+(0,%col)), $1-, $chr(3)) } alias -l htmlfree { var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, ) return %x } on $*:text:/^[!@]price(s|check)*/Si:#: { if ( !$2 ) { notice $nick You did not specify an item to price check. Command Usage: !price item } else { /var %number 1 while ($sock(price.socket. $+ %number)) { /inc %number } if (!* iswm $1) { /set %price.displaystyle. [ $+ [ %number ] ] private } /set %price.item. [ $+ [ %number ] ] $2- /set %price.nick. [ $+ [ %number ] ] $nick /set %price.chan. [ $+ [ %number ] ] $chan /sockopen $+(price.socket.,%number) zybez.net 80 } ;Closes Else } ;Ends the !pricecheck section on *:sockopen:price.socket.*:{ sockwrite -nt $sockname GET /priceguide.php?search_terms= $+ $replace(%price.item. [ $+ [ $right($SockName,-13) ] ] ,$chr(32),$chr(43)) $+ &search_area=1&price_low=&price_high=&member=1 HTTP/1.1 sockwrite -nt $sockname Host: zybez.net sockwrite -nt $sockname $crlf $crlf } on *:sockread:price.socket.*:{ var %i $right($sockname,-13) if ($sockerr) { /notice %price.nick. [ $+ [ %i ] ] An error occured while searching for %price.item. [ $+ [ %i ] ] | halt } else { var %temptext sockread %temptext ;Once bot gets the Item + Price which is represented my %readnextline == 2, it runs this to display the results for the user then restarts the whole proccess. if (%readnextline == 2) { /inc %price.displayed. [ $+ [ %i ] ] /var %price.displayprice $htmlfree(%temptext) /var %message %price.displayitem. [ $+ [ %i ] ] - %price.displayprice /unset %readnextline ; Limits how many items are displayed before it stops reading. Prevents the bot from flooding. if ( %price.displayed. [ $+ [ %i ] ] < 6 ) { if ( %price.displaystyle. [ $+ [ %i ] ] == private ) { /notice %price.nick. [ $+ [ %i ] ] %message } else { /msg %price.chan. [ $+ [ %i ] ] %message } } ; Closes if statement - if ( %price.displayed. [ $+ [ %i ] ] < 6 ) else { /notice %price.nick. [ $+ [ %i ] ] Your search for " $+ %price.item. [ $+ [ %i ] ] $+ " isn't specific enough. Please narrow your search down to something more precise and try again. | /sockclose $+(price.socket.,%i) | /unset %price.*. [ $+ [ %i ] ] } } ; Closes if statement - if (%readnextline == 2) if (%readnextline == 1) { /set %price.displayitem. [ $+ [ %i ] ] $htmlfree(%temptext) | /set %readnextline 2 } if ( * isin %temptext) { /set %readnextline 1 } if (*Your search did not * iswm %temptext) { /notice %price.nick. [ $+ [ %i ] ] The item, " $+ %price.item. [ $+ [ %i ] ] $+ " was not found. Make sure the item you are looking for is spelled correctly and exists... } } ; Closes else } ;Ends the sockread section on *:sockclose:price.socket.*:{ /unset %price.*. [ $+ [ $right($SockName,-13) ] ] } alias -l htmlfree { ; Cleans all html from a file var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, ) return %x } ;Ends the html cleaner alias alias c1 { return $+(, $1-,) } alias c2 { return $+(, $1-,) } on *:text:*:#: { tokenize 32 $strip($1-) if ($left($1,1) !isin @!.) halt if ($right($1,-1) == stats) var %style = astats elseif ($regex($1,/co?mb(at)?/Si)) var %style = combat elseif ($setskill($remove($1,@,!,.))) var %style = istat, %skill = $setskill($remove($1,@,!,.)) elseif ($right($1,-1) == defname) && ($2) { writeini DefRSN.ini RSNs $mask($fulladdress,3) $replace($2-,$chr(32),-) .notice $nick $2 is now the Default RuneScape Username for the following Hostmask: $mask($fulladdress,3) $+ . halt } else halt inc %ID if ($len($2-) > 12) { $($+(%,stats.display.,%ID),2) $c1(The nick) $c2($2-) $c1(is too long) cleanup %ID halt } elseif ($2) set $+(%,stats.rsn.,%ID) $replace($2-,$chr(32),-) elseif ($readini(DefRSN.ini,RSNs,$mask($fulladdress,3))) set $+(%,stats.rsn.,%ID) $ifmatch elseif ($readini(DefRSN.ini,RSNs,$nick)) set $+(%,stats.rsn.,%ID) $ifmatch else set $+(%,stats.rsn.,%ID) $nick set $+(%,stats.style.,%ID) %style set $+(%,stats.skill.,%ID) %skill set $+(%,stats.display.,%ID) $iif($left($1,1) == @,msg $chan,notice $nick) sockopen $+(stats.,%ID) hiscore.runescape.com 80 } on *:sockopen:stats.*: { var %id = $gettok($sockname,2,46) sockwrite -n $sockname GET /lang/en/aff/runescape/hiscorepersonal.ws?user1= $+ $($+(%,stats.rsn.,%ID),2) HTTP/1.1 sockwrite -n $sockname Host: hiscore.runescape.com $+ $crlf $+ $crlf } on *:sockread:stats.*: { sockread &Incoming bwrite $sockname -1 -1 &Incoming if ($bfind(&Incoming, 1, ).text) makehash $sockname elseif ($bfind(&Incoming, 1, does not feature in the hiscores.).text) { $($+(%,stats.display.,%ID),2) $c1(The nick) $c2($($+(%,stats.rsn.,%ID),2)) $c1(was not found in the RuneScape HighScores. If you do not have a Default RuneScape Username set yet, type !defname nick. ) cleanup $gettok($sockname,2,46) } } alias -l makehash { var %file = $1 bread %file 1 $file(%file).size &stats var %currentstat, %x = 1 while (%x) { var %x = $bfind(&stats,$calc(%x + 1),