I really do not understand programming tcl.
I have tried to make it by editing tcl google. but the results do not fit with what I want.
Code: Select all
Website = http://domain.com/sms.php/phone=xxxxx&msg=yyyyyyyyyyy
xxxx = phone number
yyyy = message
I want command bot :
!sms phonenumber message
Code: Select all
bind pub - !sms pub:sms
set agent "Mozilla"
proc pub:sms {nick uhost hand chan arg} {
global agent
if {[llength $arg]==0} {
putserv "PRIVMSG $nick :!sms phonenumber message"
} else {
set query "http://domain.com/sms.php/phone="
for { set index 0 } { $index<[llength $arg] } { incr index } {
set query "$query[lindex $arg $index]"
if {$index<[llength $arg]-1} then {
set query "$query+"
}
}
#putserv "PRIVMSG $channel :$query"
set token [http::config -useragent $agent]
set token [http::geturl $query]
set html [http::data $token]
puts stderr ""
upvar #0 $token state
set max 0
foreach {name value} $state(meta) {
if {[regexp -nocase ^location$ $name]} {
set newurl [string trim $value]
putserv "PRIVMSG $channel :$newurl"
if {[string match "*SMS Sent Sucessfully*" $html]} {
puthelp "PRIVMSG $chan :SMS Sent Sucessfully"
return 0
}
if {[string match "*SMS Send Failed*" $html]} {
puthelp "PRIVMSG $chan :SMS Send Failed"
return 0
}
}
}
}
}
putlog "TCL Free sms by Jasman"
without SMS Sent Sucessfully & SMS Send Failed.
Help me...