All pastes #225258 Raw Edit

Stuff

public text v1 · immutable
#225258 ·published 2006-10-27 20:56 UTC
rendered paste body
on *:TEXT:!price*:#: {
  if (%price.busy != $null) { /notice $nick 3[14Item searched for3] Sorry but $nick is already using this command... please wait 3 seconds and try again. | halt }
  set -u3 %price.busy $nick
  write -c pricedownload.txt
  set %pricechannel $chan
  set %pricenick $nick
  set %msg.type public
  set %rs.item $replace($2-,$chr(32),$chr(43))
  /price
}
alias pricemsg {
  var %itemname $right($read(pricedownload.txt,2),-24)
  var %price $right($read(pricedownload.txt,3),-24)
  var %output $remove(4 $+ %itemname $+ :2 %price,</td>)
  if (spelling isin $read(pricedownload.txt,1)) { /notice %pricenick 07Your search did not return any results. Please make sure your spelling is correct and that you are typing full words. | halt  }
  if (%msg.type == private) { /notice %pricenick 4[9Item7] %output }  
  elseif (%msg.type == public) { msg %pricechannel %output }
  else { msg %pricechannel Error }
}
alias price sockclose price | sockopen price zybez.net 80
on *:sockopen:price:{ 
  sockwrite -n $sockname GET /priceguide.php?search_terms= $+ %rs.item $+ &search_area=1&price_low=&price_high=&member=1 HTTP/1.1 
  sockwrite -n $sockname Host: zybez.net $+ $crlf $+ $crlf
}
on *:sockread:price:{ 
  if ($sockerr) {
    echo -a Error.
    halt
  }
  else {
    sockread %temp 
    if (*class="tablebottom"* iswm %temp) { 
      write pricedownload.txt %temp
      .timerSOCKET 1 2 sockclose price
    } 
  }
}
on *:sockclose:price:{
  pricemsg