rendered paste body#####################
;For use of #fastpc only.
;Made by G-Owned for the #fastpc channel.
;Commands: !pm, !rules, !setrule, !setpcw, !setworld, !pcw, !world, !aov, !pcjoinon, !pcjoinoff
;Version v1.1
;Please leave the copyright messages in.
#####################
on *:CONNECT:#:{
/nick FasTPcBot??
/join #fastpc
}
on *:JOIN:#:{
if ($nick == $me) {
msg $chan 10The official #fastpc bot scripted and made by G-Owned. $me is using version v1.1 }
elseif ($readini(Autovoice.ini,$nick,aov) == $address($nick,2)) { mode $chan +v $nick }
}
on *:TEXT:!pm:#:{
if ($nick isop $chan) || ($nick ishop $chan) { msg $chan 10[0:00] Please can all un-voiced users private message $nick on Runescape for validation and voice. | .timer 1 5 msg $chan 10[0:05] Please can all un-voiced users private message $nick on Runescape for validation and voice. }
else { notice $nick 10You cannot use this command.
}
}
on *:TEXT:!rules:#:{
if ($nick isop $chan) || ($nick ishop $chan) { msg $chan 10The current rules for $chan $+ : %rule [ $+ [ $chan ] ] [Last Updated: %ruletime [ $+ [ $chan ] ] $+ ] }
else { notice $nick 10You cannot use this command.
}
}
on *:TEXT:!setrule *:#:{
if ($nick isop $chan) || ($nick ishop $chan) { set %rule [ $+ [ $chan ] ] $2- | set %ruletime [ $+ [ $chan ] ] $fulldate | notice $nick 10You have succesfully changed the $chan rules for the bot $me $+ . }
else { notice $nick 10You cannot use this command.
}
}
on $*:TEXT:/^[!@.](set(pcw|word)?)/Si:#: {
if ($nick isop $chan) || ($nick ishop $chan) && ($2 isnum 2-138) { set %pcworld [ $+ [ $chan ] ] $2 | set %pctime [ $+ [ $chan ] ] $fulldate | set %pcnick [ $+ [ $chan ] ] $nick | set %pcuse [ $+ [ $chan ] ] on | msg $chan 10[0:00] The Pest Control world has been updated. Please type !pcw or !world to view it. | .timer 1 5 msg $chan 10[0:05] The Pest Control world has been updated. Please type !pcw or !world to view it. }
else { notice $nick 10You cannot use this command.
}
}
on *:TEXT:!pcw:#:{
if (%pcuse [ $+ [ $chan ] ] == on) {
notice $nick 10The current pest control world is %pcworld [ $+ [ $chan ] ] and was set by %pcnick [ $+ [ $chan ] ] $+ . Last Updated: %pctime [ $+ [ $chan ] ] $+ . }
else { notice $nick 10There is no world set for $chan $+ .
}
}
on *:TEXT:!world:#:{
if (%pcuse [ $+ [ $chan ] ] == on) {
notice $nick 10The current pest control world is %pcworld [ $+ [ $chan ] ] and was set by %pcnick [ $+ [ $chan ] ] $+ . Last Updated: %pctime [ $+ [ $chan ] ] $+ . }
else { notice $nick 10There is no world set for $chan $+ .
}
}
on *:TEXT:!aov *:#:{
if ($nick isop $chan) || ($nick ishop $chan) && ($me isop $chan) && ($2 ison $chan) { writeini Autovoice.ini $2 aov $address($2,2) | mode $chan +v $2 | msg $chan 10Added $2 to the autovoice list. }
else { notice $nick 10You cannot use this command.
}
}
on *:TEXT:!delaov *:#:{
if ($nick isop $chan) || ($nick ishop $chan) && ($me isop $chan) { remini Autovoice.ini $2 | mode $chan -v $2 | msg $chan 10Deleted $2 from the autovoice list. }
else { notice $nick 10You cannot use this command.
}
}
on *:TEXT:!pcjoin*:#:{
if ($nick isop $chan) || ($nick ishop $chan) {
if ($1 == on) { set %pcjoin [ $+ [ $chan ] ] on) | msg $chan 10The combat on-join is now on. }
if ($1 == off) { unset %pcjoin [ $+ [ $chan ] ] on) | msg $chan 10The combat on-join is now off. }
else { notice $nick 10You cannot use this command.
}
}
}
on *:JOIN:#:{
if (%pcjoin [ $+ [ $chan ] ] == $null) || ($nick == $me) { halt }
set %channy $chan
set %user $nick
set %pc.msg msg $chan
sockopen pestkick www.slushpuppy.silverinterlocution.org 80
}
on *:SOCKOPEN:pestkick*:{
sockwrite -nt $sockname GET /pestcontrol.php?pestcontrol= $+ %user HTTP/1.1
sockwrite -nt $sockname Host: www.slushpuppy.silverinterlocution.org
sockwrite -nt $sockname $crlf
}
on *:SOCKREAD:pestkick*:{
var %sockread
sockread %sockread
if (<b> isin %sockread) {
set %attack $gettok($htmlfree(%sockread),4,32)
set %strength $gettok($htmlfree(%sockread),8,32)
set %defence $gettok($htmlfree(%sockread),6,32)
set %hit $gettok($htmlfree(%sockread),10,32)
set %range $gettok($htmlfree(%sockread),12,32)
set %prayer $gettok($htmlfree(%sockread),14,32)
set %mage $gettok($htmlfree(%sockread),16,32)
}
if (<br> isin %sockread) {
var %combat = $htmlfree(%sockread)
%pc.msg 10User: %user Attack: %attack Strength %strength Defence: %defence Hitpoints: %hit Range: %range Mage: %mage Prayer: %prayer Combat: %combat
sockclose $sockname | unset %combat.3 | unset %channy | unset %user | unset %attack | unset %strength | unset %pc.msg
}
}
on *:Sockclose:pestkick*:{
Sockclose $sockname
unset %combat | unset %channy | unset %user | unset %attack | unset %strength | unset %pc.msg
}
alias -l htmlfree {
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, )
return %x }
alias -l htmlfree {
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, )
return %x }