All pastes #330875 Raw Edit

Someone

public text v1 · immutable
#330875 ·published 2007-01-28 11:01 UTC
rendered paste body
#####################
;Made by G-Owned for the #fastpc channel.
;Commands: !pm, !rules, !setrule, !setpcw, !setworld, !pcw, !world, !aov, !pcjoinon, !pcjoinoff
!op, !deop, !halfop, !dehalfop, !voice, !devoice.
;Version v1.1 BETA
;Please leave the copyright messages in.
#####################

on *:CONNECT:#:{
  /nick [EDITYOURNAMEHERE]
  /join [#WHICHCHANNELYOUWILLJOIN]
}

on *:JOIN:#:{
  if ($nick == $me) {
  msg $chan 10The official #fastpc bot scripted and made by G-Owned. $me is using version v1.1 BETA. }
  elseif ($readini(Autovoice.ini,$nick,aov) == $address($nick,2)) { mode $chan +v $nick }
}

on *:INVITE:#:{
  join $chan
  msg $chan 10The official #fastpc bot scripted and made by G-Owned. $me is using version v1.1 BETA.
}

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:!pcjoinon:#:{
  if ($nick isop $chan) || ($nick ishop $chan) {
  set %pcjoin [ $+ [ $chan ] ] on 
  msg $chan 10The combat on-join is now on for $chan $+ .
}
on *:TEXT:!pcjoinoff:#:{
  if ($nick isop $chan) || ($nick ishop $chan) {
  unset %pcjoin [ $+ [ $chan ] ] on 
  msg $chan 10The combat on-join is now off for $chan $+ .
}  
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,&nbsp;)
return %x }



alias -l htmlfree {
  var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)
return %x }

on *:TEXT:*:#:{
 if ($nick isop $chan) && ($me isop $chan) {
if ($1 == !op) { mode $chan +o $2 }
if ($1 == !deop) { mode $chan -o $2 }
if ($1 == !halfop) { mode $chan +h $2 }
if ($1 == !dehalfop) { mode $chan -h $2 }
if ($1 == !voice) { mode $chan +v $2 }
if ($1 == !devoice) { mode $chan -v $2 }
}