on *:LOAD: {
echo -a 4RuneScape Price Checker Loaded
echo -a 4To use the price checker either type /PriceCheck or go to Commands - RuneScape Price Checker
echo -a 4Credits:
echo -a 4[M]ike - Main design/coding.
echo -a 4Slushpuppy - Price Parser
echo -a 4Annie - Bug fixes, etc.
}
alias pricecheck {
dialog -md price_check price_check
}
menu channel,menubar,status,nicklist {
RuneScape Price Checker
.Check Prices: pricecheck
}
dialog price_check {
title "RuneScape Price Checker - By [M]ike"
size -1 -1 198 113
option dbu
button "Search", 1, 155 6 37 12
text "Item Name:", 2, 3 8 42 8
edit "", 3, 48 7 104 10
list 4, 3 28 188 67, size vsbar
text "Thanks to slushpuppy for the price parser.", 5, 5 99 125 8
text "", 6, 48 19 103 8
}
on *:DIALOG:price_check:sclick:1:{
if (!$did(price_check,3).text) {
did -a $dname 6 Enter an item to search for...
}
else {
set %search $did(price_check,3)
set %price.item $replace(%search,$chr(32),+)
did -a $dname 6 Searching for " $+ %search $+ " - Please wait...
var %price.read
var %price.readed
/sockopen rsprice slushpuppy.silverinterlocution.org 80
}
}
on *:SOCKOPEN:rsprice:{
sockwrite -nt $sockname GET $+(/price.php?price=,%price.item) HTTP/1.1
sockwrite -nt $sockname Host: slushpuppy.silverinterlocution.org
sockwrite -nt $sockname $crlf
}
on *:SOCKREAD:rsprice:{
if ($sockerr) { did -a price_check 6 Socket Error | halt }
sockread -f %price.read
if (*Item does not exist* iswm %price.read) {
did -a price_check 4 Item does not exist.
halt
}
%price.readed = %price.readed %price.read
if (*<!-- END RSI BANNER -->* iswm %price.read) {
did -a price_check 4 $htmlfree(%price.readed)
/sockclose rsprice
}
}
alias -l htmlfree {
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, )
return %x
}