All pastes #715238 Raw Edit

Someone

public text v1 · immutable
#715238 ·published 2007-09-26 03:43 UTC
rendered paste body
on $*:text:/^[!@](stats|rsstats)/Si:#: {
  set %sway $iif($left($1,1) == @,msg $chan,notice $nick)
  if ($sock(stats)) %sway Please hold, bot is busy
  elseif ($2 == $null) %sway You must supply a user, Syntax: !stats runescapename
  else {
    set %statuser $2
    sockopen stats o-ss.net 80
  }
}
on *:sockopen:stats: {
  sockwrite -nt $sockname GET /parsers/oneline/stats.php?user= $+ %statuser HTTP/1.1
  sockwrite -nt $sockname Host: o-ss.net
  sockwrite -nt $sockname $crlf
}
on *:sockread:stats: {
  var %stattext
  sockread %stattext
  tokenize 32 %stattext
  if (*compare* iswm %stattext) {
    %sway $+ %statuser was not featured in the highscores for any skill | { halt }
  }
  elseif (*end* iswm %stattext) {   
    %sway Stats for %statuser $+ :
    %sway $replace(%stattext,|,!,END,!,Overall,Overall,Attack,Attack,Defence,Defence,Strength,Strength,Hitpoints,Hitpoints,Ranged,Ranged,Prayer,Prayer,Magic,Magic,Cooking,Cooking,Woodcutting,Woodcutting,Fletching,Fletching,Fishing,Fishing,Firemaking,Firemaking,Crafting,Crafting,Smithing,Smithing,Mining,Mining,Herblore,Herblore,Agility,Agility,Thieving,Thieving,Slayer,Slayer,Farming,Farming,Runecraft,Runecraft,Hunter,Hunter,Construction,Construction)   
    unset %sway
    unset %stattext
    sockclose stats
  }
}



on $*:text:/^[!@]away/Si:#:{
  if (!%away. [ $+ [ $address($nick,2) ] ]) {
    if ($len($2-) <= 100) {
      set %away. [ $+ [ $address($nick,2) ] ] $iif($2,$2-,No reason)
      set %awaytime. [ $+ [ $address($nick,2) ] ] $ctime
      msg $chan [7AWAY1] $+([7,$nick,]) Reason: $+([7,$iif($2,$2-,No reason),]) Left at $+([,$chr(3),07,$asctime($gmt,hh:nn:ss:TT),$chr(40),GMT,$chr(41),$chr(3),])
    }
    else .notice $nick Please shorten your reason $+($chr(91),$chr(3),07,$len($2-),$chr(3),/,$chr(3),07,100,$chr(3),$chr(93))
  }
  else .notice $nick Youre already away
}
on $*:text:/^[!@]back/Si:#:{
  if (%away. [ $+ [ $address($nick,2) ] ]) {
    msg $chan [7BACK] $+($chr(91),$chr(3),07,$nick,$chr(3),$chr(93)) Reason $+($chr(91),$chr(3),07,%away. [ $+ [ $address($nick,2) ] ],$chr(3),$chr(93)) Gone $+($chr(91),$chr(3),07,$duration($calc($ctime - %awaytime. [ $+ [ $address($nick,2) ] ] )),$chr(3),$chr(93))
    unset %away. [ $+ [ $address($nick,2) ] ]
    unset %awaytime. [ $+ [ $address($nick,2) ] ]
  }
  else .notice $nick Youre not away
}
on $*:text:/^[!@]list(away)?/Si:#:{
  if ($var(%away.*,0) > 0) {
    var %k = 1
    while (%k <= $nick($chan,0)) {
      if (%away. [ $+ [ $address($nick($chan,%k),2) ] ]) {
        var %allaway = $iif(%allaway,$+($v1,$chr(3),$chr(44),$chr(3),07)) $nick($chan,%k)
        inc %k
      }
      else inc %k
    }
    $iif($left($2,1) == @,msg $chan,.notice $nick) [7AWAY] $iif(%allaway,Users marked as away in7 $chan $+ :7 %allaway $+ .,No users marked as away in $chan $+ .)
  }
  else $iif($left($2,1) == @,msg $chan,.notice $nick) There are no users marked as away in all channels I am on.
}
on $*:text:/^llama (!|@)check/Si:#:{
  if ($2 == -a) {
    if ($3) {
      if (%away. [ $+ [ $3- ] ]) {
        $iif($left($2,1) == @,msg $chan,.notice $nick) Host $+([7,$3,])  Is away at7 %away. [ $+ [ $3 ] ] $+ . Left7 $duration($calc($ctime - %awaytime. [ $+ [ $3 ] ] )) Ago.
      }
      else $iif($left($2,1) == @,msg $chan,.notice $nick) Host $+([7,$3,]) Is Not away.
    }
    else .notice $nick Please provide a host, !@check -a7 *!*@host.
  }
  else {
    if ($2) {
      if (%away. [ $+ [ $address($2-,2) ] ]) {
        $iif($left($2,1) == @,msg $chan,.notice $nick) Nick7 $2 Is away at7 %away. [ $+ [ $address($2,2) ] ] $+ . Left7 $duration($calc($ctime - %awaytime. [ $+ [ $address($2-,2) ] ] )) Ago.
      }
      else $iif($left($2,1) == @,msg $chan,.notice $nick) Nick7 $2 Is Not away.
    }
    else {
      if (%away. [ $+ [ $address($nick,2) ] ]) {
        $iif($left($2,1) == @,msg $chan,.notice $nick) Nick7 $nick Is away at7 %away. [ $+ [ $address($nick,2) ] ] $+ . Left7 $duration($calc($ctime - %awaytime. [ $+ [ $address($nick,2) ] ] )) Ago.
      }
      else $iif($left($2,1) == @,msg $chan,.notice $nick) Nick7 $nick Is Not away.
    }
  }
}
on *:text:*:#:{
  var %o = 1
  while (%o <= $0) {
    if (%away. [ $+ [ $address($($+($chr(36),%o),2),2) ] ]) {
      if (!%told. [ $+ [ $address($nick,2) ] ]) {
        .notice $nick [7AWAY] $+($chr(91),$chr(3),07,$ialchan($address($($+($chr(36),%o),2),2),$chan,1).nick,$chr(3),$chr(93)) Is away $+($chr(91),$chr(3),07,%away. [ $+ [ $address($($+($chr(36),%o),2),2) ] ],$chr(3),$chr(93)) They have been gone for $+($chr(91),$chr(3),07,$duration($calc($ctime - %awaytime. [ $+ [ $address($($+($chr(36),%o),2),2) ] ] )),$chr(3),$chr(93))
        set -u60 %told. [ $+ [ $address($nick,2) ] ] HI
        inc %o $0
      }
      else inc %o $0
    }
    else inc %o
  }
}