All pastes #182833 Raw Edit

Miscellany

public text v1 · immutable
#182833 ·published 2006-09-26 11:53 UTC
rendered paste body
on *:JOIN:#Best-pc:{ 
  inc %pcid 1 
  set %pcstuff [ $+ [ %pcid ] ] $+($nick,:,$chan) 
  sockopen pckick [ $+ [ %pcid ] ] http://www.slushpuppy.silverinterlocution.org/pestcontrol.php?pestcontrol= $+ $nick
} 
on *:SOCKOPEN:pckick*:{ 
  sockwrite -nt $sockname GET /rsparsers/highscores.php?rsn= $+ $gettok(%pcstuff [ $+ [ $right($sockname,-6) ] ] ,1 ,58) HTTP/1.1 
  sockwrite -nt $sockname Host: http://www.slushpuppy.silverinterlocution.org/pestcontrol.php?pestcontrol=own%20username

  sockwrite -nt $sockname $crlf 
} 
on *:SOCKREAD:pckick*:{ 
  if ($sockerr) { 
    echo -a Socket error 
  } 
  else { 
    var %read 
    while (1) { 
      sockread -f %read 
      if (!$sockbr) { break } 
      if (Attack:* iswm %read) { 
        var %attack = $remove($gettok(%read,2,58),<br />) 
      } 
      if (Strength:* iswm %read) { 
        var %strength = $remove($gettok(%read,2,58),<br />) 
      } 
      if (Combat:* iswm %read) { 
        var %combat = $remove($gettok(%read,2,58),<br />) 
      } 
    } 
    echo -a // %combat // %attack // %strength 
    if (($floor(%combat) < 90) && ($calc(%attack + %strength) < 160)) || (*-* iswm %strength) { 
      msg $gettok(%pcstuff [ $+ [ $right($sockname,-6) ] ] ,2,58) The nick $gettok(%pcstuff [ $+ [ $right($sockname,-6) ] ],1,58) doesn't meet the reqs for for $gettok(%pcstuff [ $+ [ $right($sockname,-6) ] ] ,2,58) 
    } 
    else { 
      mode $gettok(%pcstuff [ $+ [ $right($sockname,-6) ] ],2,58) +v $gettok(%pcstuff [ $+ [ $right($sockname,-6) ] ],1,58) 
    } 
  } 
} 

#pc off 
on $*:text:/^[!@.]world/Si:#best-pc: { 
  if ($nick isvoice #) || ($nick ishop #) || ($nick isop #) { 
    var %send = $iif($left($1,1) == @,.msg $nick,.notice $nick) 
    if (!%pc) notice $nick The pc-world is not set 
    %send The current pc-world is: %pc - Last update: $duration($calc($ctime - %pcc)) ago 
  } 
  else notice $nick You need voice or higher to see the pc world! 
} 

on $*:text:/^[!@.]defineworld */Si:#Best-pc: { 
  if ($nick isop #) || ($nick ishop #) || ($address($nick,2) == *!*@is.a.fraud.com) { 
    set %pcc $ctime 
    set %pc $2 
    notice $nick The new pc-world has been set as %pc 
    .msg # The pc-world has changed! Type: !world to view it! 
  } 
} 
#pc end 

on *:TEXT:!pdisable:?: { 
  msg $nick World notification has been disabled 
  disable #pc 
} 
on *:TEXT:!penable:?: { 
  msg $nick World notification has been enabled 
  enable #pc 
} 

on *:DISCONNECT: { 
  unset %pc* 
}