on $*:text:/^[!@.](alch|alchemy)/Si:#:{
if ($sock(ALCH)) { .notice $nick Someone else is already looking , please wait. | halt }
sockopen ALCH astralscript.org 80
set %nick $nick
set %chan $chan
set %alch.display $iif($left($1,1) == @,msg %chan,.notice %nick)
set %alch $replace($2-,$chr(32),+)
}
ON *:SOCKOPEN:ALCH:{
sockwrite -nt $sockname GET $($+(/bot/geniealch.php?name=,%ALCH),2) HTTP/1.1
sockwrite -nt $sockname Host: astralscript.org
sockwrite -nt $sockname $crlf
}
on *:SOCKREAD:ALCH:{
if ($sockerr) {
echo -a Error.
sockclose $sockname
halt
}
else {
var %alch.Read
sockread %alch.Read
if (Genie:* iswm %alch.read) {
tokenize 32 $htmlfree(%alch.Read)
%alch.read = $remove(%alch.read,genie:) | tokenize 124 %alch.Read | %alch.display 10Item:4 $1 10High alch:4 $2 10Low alch4 $3
sockclose $sockname
}
}
}
ON *:SOCKCLOSE:ALCH:{
unset %alch
}
alias htmlfree {
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, )
return %x
}
alias -l htmlfree {
var %x = "", %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, )
return %x
}
alias priceconfig {
echo -a * *********************************
echo -a * To set price options use the following commands:
echo -a * /priceall <on $+ $chr(124) $+ off> - Allows the use of the "all" trigger. (.price -a rune set returns rune (g) set, rune (t) set, and rune set.) Default is off due to flooding issues.
echo -a * /pricecolor <color1 color2 color3> - Sets colors of the output text. Default is 14 07 15 (looks like: 14Santa Hat:07 25,000,000gp |15 zybez.net)
echo -a * *********************************
}
alias priceall {
if ($1 == on) { set %priceall on | echo -a * Price All is now set to "on" | return Price All = On }
elseif ($1 == off) { set %priceall off | echo -a * Price All is now set to "off" | return Price All = Off }
else { echo -a * Invalid Syntax. Either /priceall on or /priceall off. | return Invalid Syntax }
}
alias pricecolor {
if ($len($1) == 2) && ($len($2) == 2) && ($len($3) == 2) && ($1 isnum) && ($2 isnum) && ($3 isnum) && ($1 <= 15) && ($2 <= 15) && ($3 <= 15) {
set %c1 $1 | set %c2 $2 | set %c3 $3
echo -a * Colors Set. Output will now look like below:
echo -a * $+ %c1 Santa Hat: $+ %c2 25,000,000gp $chr(124) $+ $+ %c3 zybez.net
}
else {
echo -a * Invalid color selection. Please use two digit color codes from 01 to 15.
}
}
;Do not change priceappend. Zybez will break the script again if you do. Feel free to shorten it, but give credit to zybez ALWAYS.
;if it breaks again because of this, I wont release a new update.
alias priceappend {
return $+(,%c3,,http://zybez.net)
}