############################################################################### # # # SMS Send script v1.1 by Peter Postma # # # # this script uses the smssend program. # # get it @ http://freshmeat.net/projects/smssend # # # # Make sure that the file 'userinfo.tcl' has the word 'PHONE' in this line: # # -> set userinfo-fields "URL BF GF IRL EMAIL DOB PHONE" # # # # You can set your phone number with: /msg bot phone yournumberhere # # It it also possible to change phone numbers on the partyline. # # Use .chphone to change the phone numbers on the partyline. # # # # Please change the variables below under "Configuration" !! # # # # Syntax of the commands: # # Private: /msg bot sms # # Channel: !sms # # # # You can use the user's handle to send a sms (the user should have a # # registered phone number) or use the '-n' switch to enter a phone number. # # # # Examples: (my user handle is 'peter' here and phone number is '12345') # # !sms peter hello i'm sending a SMS # # !sms -n 12345 hello this is another SMS # # # ############################################################################### # Configuration settings: # location for the SMSSend program set smssendprog "www.n-zeth.info/send_sms.php" # location for the SMSSend provider file set smsprovider "www.n-zeth.info/send_sms.php" # login name for the provider set smsuser "username" # pasword for the provider set smspasswd "password" # Flags to use the service set sms_flag "o|o" # End configuration set smsversion "1.1" bind msg $sms_flag "sms" msg:sms bind pub $sms_flag "!sms" pub:sms proc sms:check_input {text} { regsub -all {<|>|&|\|/|%|[|]|[$]} $text "" text return $text } proc msg:sms {nick uhost hand text} { pub:sms $nick $uhost $hand $nick $text } proc pub:sms {nick uhost hand chan arg} { global smssendprog smsprovider smsuser smspasswd set input [sms:check_input $arg] if {[string length [string trim $input]] == 0} { sms:usage $chan $nick return 0 } if {[lindex $input 0] == "-n"} { set number [lindex $input 1] set text [lrange $input 2 end] if {$number == "" || $text == ""} { sms:usage $chan $nick return 0 } set whom $number } else { set whom [lindex $input 0] set text [lrange $input 1 end] if {$text == ""} { sms:usage $chan $nick return 0 } if {[validuser $whom] == 0} { putserv "PRIVMSG $chan :\[sms\] User handle \'$whom\' not found." return 0 } if {[getuser $whom XTRA PHONE] == ""} { putserv "PRIVMSG $chan :\[sms\] No PHONE # registered for \'$whom\'." return 0 } set number [getuser $whom XTRA PHONE] } putserv "PRIVMSG $chan :\[sms\] Sending sms to: $whom;" set result "Result: Not sended!" catch {exec $smssendprog $smsprovider $smsuser $smspasswd $number $text -- -t3000} result putserv "PRIVMSG $chan :\[sms\] $result" return 0 } proc sms:usage {chan nick} { if {$nick == $chan} { putserv "PRIVMSG $nick :\[sms\] Syntax: sms " } else { putserv "PRIVMSG $chan :\[sms\] Syntax: !sms " } } putlog "SMS script version $smsversion: LOADED!"