This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

fix tcl for sms

Help for those learning Tcl or writing their own scripts.
Post Reply
d
djazman85
Voice
Posts: 1
Joined: Tue Sep 22, 2009 11:24 pm
Location: Indonesia
Contact:

fix tcl for sms

Post by djazman85 »

Hello masters, I need help to fix tcl sms below.
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"
Now tcl only run with command !sms phonenumber&msg=My Message
without SMS Sent Sucessfully & SMS Send Failed.

Help me...
Post Reply