mIRC Home    About    Download    Register    News    Help

Print Thread
RuneScape Price Script #168928 16/01/07 10:54 PM
Joined: Jan 2007
Posts: 1
R
rune4234 Offline OP
Mostly harmless
OP Offline
Mostly harmless
R
Joined: Jan 2007
Posts: 1
I need help with a runescape price script. I already got it made but when i use it it says eiter: ITEM Unknown command or NO Unknown Command. Heres the code if you can help.

Code:
on $*:TEXT:/^[!@.~]price/Si:#:{
  if (!$2) halt
  else {
    var %n = $ticks
    set $+(%,price.item.,%n) $replace($2-,$chr(32),+)
    set $+(%,price.style.,%n) $iif($left($1,1) == @,msg $chan)
    sockopen $+(price.,%n) www.zybez.net 80
  }
}
on *:SOCKOPEN:price.*:{
  var %id = $gettok($sockname,2,46)
  sockwrite -n $sockname GET /priceguide.php?search_terms= $+ $($+(%,price.item.,%id),2) $+ &search_area=1&price_low=&price_high=&member=1 HTTP/1.1
  sockwrite -n $sockname Host: www.zybez.net
  sockwrite -n $sockname $+($crlf,$crlf)
}
on *:SOCKREAD:price.*:{
  var %id = $gettok($sockname,2,46)
  var %item = $replace($($+(%,price.item.,%id),2),+,$chr(32)), $&
    %style = $($+(%,price.style.,%id),2)
  if ($sockerr) {
    %style An error occured while connecting. Please contact rune4234.
    unset $+(%,price.*)
    sockclose $+(price.,%id)
  }
  else {
    var %read
    sockread %read

    if (<td class="tablebottom" colspan="5">Your search did not return any results. Please make sure your spelling is correct and that you are typing full words.</td> isin %read) {
      %style No results were found for " $+ %item $+ "
      unset $+(%,price.*)
      sockclose $+(price.,%id)
    }
    if (<!--name--><td class='tablebottom'>*</td> iswm %read) {
      tokenize 32 $nohtml(%read)
      set $+(%,price.name.,%id) $1-
    }
    if (<!--price--><td class="tablebottom">*</td> iswm %read) {
      tokenize 32 $nohtml(%read)
      set $+(%,price.price.,%id) $1-
    }
    if (<td class="tablebottom"><a href="/priceguide.php?category=*">*</a></td> iswm %read) {
      tokenize 32 $nohtml(%read)
      var %cat = $replace($1-,&amp;,+)
      inc $+(%,price.times.,%id) 
      if ($($+(%,price.times.,%id),2) > 5) {
        %style Max results of 5 allowed. Try making your search for " $+ %item $+ " more specific.
        unset $+(%,price.*)
        sockclose $+(price.,%id)
      }
      else {
        %style Item - $($+(%,price.name.,%id),2) $&
          Price - $($+(%,price.price.,%id),2) $&
          Category - %cat
        unset $+(%,price.name.,%id)
        unset $+(%,price.price.,%id)
      }
    }
    if (</html> isin %read) {
      unset $+(%,price.*)
      sockclose $+(%,price.,%id)
    }
  }
} 

Re: RuneScape Price Script [Re: rune4234] #169053 18/01/07 05:35 PM
Joined: Oct 2006
Posts: 60
M
moshkin Offline
Babel fish
Offline
Babel fish
M
Joined: Oct 2006
Posts: 60
Not everyone knows what Runescape is so you could give details.
Basically Runescape is a online Role playing game, with many items, they each have a different value, and many sites have their own price database, zybez.net are the most famous for theirs.
Heres a link to their price guide. http://www.zybez.net/priceguide.php
Now i will leave it to someone else to help you as i suck at scripting.

Re: RuneScape Price Script [Re: rune4234] #169074 18/01/07 11:47 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Put an = after each time that you set %style, or use var %style = whatever. It's looking at %style and saying that it's $null and because you didn't use /var or /set and there isn't an = sign after it, it looks to the next item and thinks that's the command.


Invision Support
#Invision on irc.irchighway.net