well this is what i got so far.
on *:TEXT:!conv*:#: {
if ($2 && $3 && $4) {
if ($remove($2,$chr(44)) isnum) {
if ($3 isin %convert.currency && $4 isin %convert.currency) {
if (%conv.busy == 0) {
msg $chan Converting $2 $3 to $4 $+ .
set %conv.chan $chan
set %conv.nick $nick
set %conv.amount $remove($2,$chr(44))
set %conv.from $3
set %conv.to $4
set %conv.busy 1
sockopen Converter xe.com 80
}
else { msg $chan Currently busy. Please be patient. }
}
else { msg $chan Error! Not a valid currency! (Allowed: %convert.currency $+ ) }
}
else { msg $chan Error! $2 isn't a valid number! }
}
else { msg $chan Error! Missing an input. }
}
on *:SOCKOPEN:Converter:{
set %conv.submit $+(Amount=,%conv.amount,$chr(38),From=,%conv.from,$chr(38),To=,%conv.to,$chr(38),Submit=Submit)
sockwrite -n $sockname POST /ucc/convert.cgi HTTP/1.1
sockwrite -n $sockname Host:
www.xe.com sockwrite -n $sockname Content-Type: application/x-www-form-urlencoded
sockwrite -n $sockname Content-Length: $calc($len(%conv.submit) + 1)
sockwrite -n $sockname
sockwrite -n $sockname %conv.submit
}
on *:SOCKREAD:Converter:{
var %tmp
sockread %tmp
;echo 4 -ag %tmp
if (%conv.to $+ </span><br> isin %tmp) { msg %conv.chan Converted amount of: %conv.amount $upper(%conv.from) = $gettok($gettok(%tmp,3,32),2,62) $upper(%conv.to) $+ . }
if (</html> isin %tmp) { set %conv.busy 0 | sockclose $sockname }
}
But all it displays in channel is Currently busy. Please be patient.