Code: Select all
set test [string map [list + \00309 - \00304]
Code: Select all
proc pub:quote { nick uhost handle channel arg } {
set [lindex [info args pub:quote] 4] [string trimleft [subst $[lindex [info args pub:quote] 4]] !]
foreach _IG [uplevel #0 {set IGwords}] { if {[string equal -nocase $_IG [lindex [split $arg] 0]]} { return } }
if {[llength $arg]==0} {
putserv "NOTICE $nick :0,2 please type \002!news\002 for options "
} else {
set stock [string toupper [lindex $arg 0]]
set query "http://finance.yahoo.com/d/quotes.csv?s=$stock&f=st5l9c6p4mv&e=.csv"
set token [http::geturl $query]
set all [http::data $token]
regsub -all \" $all "" all
set all [split $all ","]
set test [string map [list + \00309+ - \00304-]
if {[lindex $all 2]!="0.00"} {
putserv "PRIVMSG $channel :\0037» [lindex $all 0]:\003 [lindex $all 2] \002$test\003\002 ([lindex $all 4]) \0037 Time:\003 [lindex $all 1] USET \0037 Low-High:\003 [lindex $all 5] \0037 Volume:\003 [lindex $all 6]"
} else {
putserv "PRIVMSG $channel :\002 [lindex $all 0]\002 symbol not found"
Code: Select all
set test [string map [list + \00309+ - \00304-]
Code: Select all
set test [string map [list + \00309+ - \00304-] [lindex $all 3]]
^^.... and did you change the output?this will just work if there is an actual + or - infront of the number...
Code: Select all
putserv "PRIVMSG $channel :\0037» [lindex $all 0]:\003 [lindex $all 2] \002$test\003\002 ([lindex $all 4]) \0037 Time:\003 [lindex $all 1] USET \0037 Low-High:\003 [lindex $all 5] \0037 Volume:\003 [lindex $all 6]"
Code: Select all
if {[lindex $all 3] > 0} { set test "\0039 [lindex $all 3]"
} elseif {[lindex $all 3] < 0} { set test "\0034 [lindex $all 3]"
} else { set test "\00312 [lindex $all 3]" }