egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

fix tcl for sms

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
djazman85
Voice


Joined: 22 Sep 2009
Posts: 1
Location: Indonesia

PostPosted: Tue Sep 22, 2009 11:57 pm    Post subject: fix tcl for sms Reply with quote

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:
Website = http://domain.com/sms.php/phone=xxxxx&msg=yyyyyyyyyyy
xxxx = phone number
yyyy =  message

I want command bot :
!sms phonenumber message



Code:
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...
_________________
Regard,

Jasman
http://forum.ihsana.com
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber