All pastes #192904 Raw Edit

Miscellany

public text v1 · immutable
·published 2006-10-06 10:04 UTC
rendered paste body
n *:text:!alch*:#: { 
  set %alchnick $nick
  set %Alchitem $$3-
  set %Alchtimes $2
  if $sock(alchscript) { 
    /sockclose alchscript
  }
  /sockopen alchscript kewlbot.uk.to 80
} 

ON *:SOCKOPEN:alchscript: {
  /sockwrite -nt $sockname GET /Alchprices.txt HTTP/1.1
  /sockwrite -nt $sockname Host: kewlbot.uk.to $+ $crlf $+ $crlf
}

ON *:SOCKREAD:alchscript: {
  if $sockerr { 
    msg $nick Sorry, There was a socket error while connecting  
    unset %%alchitem 
    unset %ALchnick
  }
  else {
    var %read
    sockread -f %read
    if (* $+ %alchitem $+ * iswm %read) {
      notice %alchnick Alch price for: $gettok(%read,1,64) is $gettok(%read,2,64) description of item is: $gettok(%read,3,64)
      sockclose alchscript
      unset %alchitem 
      unset %ALchnick
      halt
    }
  }
}