Ge script.
SORRY GUYS, THIS IS OUTDATED. I'LL FIX IT EVENTUALLY, I DON'T REALLY SCRIPT ANYMORE.
;/ge ITEM or /ge -m ITEM to message active chan.
alias s1 { return $+($chr(3),10) $+ $1- $+ }
alias s2 { return $+($chr(3),03) $+ $1- $+ }
alias logo { return $+([,03,$1-,,]03:) }
alias wut { return $+($chr(77),$chr(97),$chr(100),$chr(101),$chr(32),$chr(98),$chr(121),$chr(32),$chr(66),$chr(101),$chr(97), $chr(117)) }
on *:TEXT:*:#: {
if ($left($1,1) isin @!) {
if ($right($1,-1) == ge) || ($right($1,-1) == grand) || ($right($1,-1) == price) {
set %display $iif($left($1,1) == @,msg #,notice $nick)
set %search $replace($2-,$chr(32),$chr(95))
sockopen GE rscript.org 80
}
}
}
on *:SOCKOPEN:GE: {
sockwrite -nt $sockname GET /lookup.php?type=ge&search= $+ %search HTTP/1.1
sockwrite -nt $sockname Host: rscript.org
sockwrite -nt $sockname $crlf
}
on *:SOCKREAD:GE: {
var %read
sockread %read
if (Results: 0 isin %read) || (*404*Page*Not*Found* iswm %read) {
%display $logo(GE) No results found for03 $replace(%search,$chr(95),$chr(32)) $+ . $wut
sockclose $sockname
unset %search %display %results %show
}
if (*Results:* iswm %read) {
tokenize 32 %read
set %results $2
}
if (%results) {
var %read
sockread %read
var %a 1
while (%a <= 5) {
if (*ITEM:* iswm %read) {
tokenize 32 %read
set %show %show $iif($2 == 1,[03M]) $replace($3,$chr(95),$chr(32)) $+ :03 $4 (03 $+ $iif($5 == $chr(48),No change,$5) $+ ) $chr(124)
var %read
sockread %read
}
inc %a
}
%display $logo(GE) $qt($replace(%search,$chr(95),$chr(32))) Results:03 %results $+ $chr(124) Top $iif(%results < 5,03 $+ %results,03 $+ 5) $+ .. $replace($iif($right(%show,1) == $chr(124),$left(%show,-1),%show),&,&) $wut
sockclose $sockname
unset %search %display %results %show
}
}
alias ge {
if ($1 == -m) {
set %search $replace($2-,$chr(32),$chr(95))
set %display msg #
sockopen GE rscript.org 80
halt
}
set %search $replace($1-,$chr(32),$chr(95))
set %display echo -a
sockopen GE rscript.org 80
}
You should check if ($sock(GE)) sockclose GE
unset %search
unset %display
unset %results
unset %show
You could unset them all in one line, unset %search %display %results %show
Or you could set them like %GE.search %GE.display etc. and then just do unset %GE.*
Or there's always /sockmark, then you wouldn't have to unset at all.