<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/15870" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2008-08-15T22:27:34-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/15870</id>

		<entry>
		<author><name><![CDATA[ayie]]></name></author>
		<updated>2008-08-15T22:27:34-04:00</updated>

		<published>2008-08-15T22:27:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84616#p84616</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84616#p84616"/>
		<title type="html"><![CDATA[Option left out by author, but would like added.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84616#p84616"><![CDATA[
Need help with this scripts.<br><br>How to make this scripts send SMS to open number ??<br><br>This scripts need to add the number in the contact list, so the bot only read number from file.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2733">ayie</a> — Fri Aug 15, 2008 10:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ayie]]></name></author>
		<updated>2008-08-10T21:38:50-04:00</updated>

		<published>2008-08-10T21:38:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84543#p84543</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84543#p84543"/>
		<title type="html"><![CDATA[Option left out by author, but would like added.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84543#p84543"><![CDATA[
Name: <br>IP Lock Down: <br>Dial Prefix: <br>Callback Type: <br>Callback Url:<br><br>what should i fill in the IP Lock Down, Callback type, call back URL ??<br><br>I've add a test connection without fill IP Lock Down and call back URL.<br><br>when i try to send sms it gave error ...<br><br>Response: ERR: 001, Authentication failed<br>Credits: ERR: 001, Authentication failed<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2733">ayie</a> — Sun Aug 10, 2008 9:38 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[danzigrules]]></name></author>
		<updated>2008-08-09T17:18:34-04:00</updated>

		<published>2008-08-09T17:18:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84524#p84524</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84524#p84524"/>
		<title type="html"><![CDATA[Option left out by author, but would like added.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84524#p84524"><![CDATA[
Put the gateway url back to what it was as mine works fine.<br><br>I used clickatell central.<br><br>then once logged in goto manage my products, then add a connection, add HTTP/S.<br><br>Once that is all set up you should get an API ID, edit the code:<br><br># clickatell details<br>set user "xxxx"  <br>set pass "xxxx"<br>set id "xxxx"   &lt;---- put API ID here<br><br>save, rehash.<br><br>follow directions in script for the rest. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9189">danzigrules</a> — Sat Aug 09, 2008 5:18 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ayie]]></name></author>
		<updated>2008-08-09T03:18:40-04:00</updated>

		<published>2008-08-09T03:18:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84504#p84504</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84504#p84504"/>
		<title type="html"><![CDATA[Option left out by author, but would like added.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84504#p84504"><![CDATA[
Anyone good in coding TCL Scripts ??<br><br>I refer to original scripts made by EToS that using clickatell gateway for eggdrop sending sms.<br><br>i've made some modifications in gateway url, but it seems the gateway/scripts cannot read the dat file.<br><br>this is the code.<br><div class="codebox"><p>Code: </p><pre><code>#  Author: EToS#  Date: 09/08/2005#  Filename: sms.tcl#  Function: Eggdrop interface to clickatell's HTTP/S SMS Gateway##  Version: 1.1 *BeTA#  History: #       - 09/08/2005: First Coded#       - 16/06/2006: Added sms.dat for data handling#                     Added !smsadd, !smsver, !smshelp#                     tag and nick info to sms &amp; chan work flag##  Notes: Enable with .chanset #channel +sms# packagespackage require http# vars# script versionset smsver "1"# work chan flags ..setudef flag sms# tag bottom of sms with irc nick and tagmsg ... 0=no 1=yesset tagnick "1"set tagname "1"set tagmsg "Ayie"# datafileset datfile "scripts/contact.dat"# clickatell detailsset user "xxxx"set pass "xxxx"#set id "xxxx"# shouldnt need to edit these urls below, but can be edited if clickatell change their# url structure, or if you wish to attempt to adapt script to another sms gateway #set urlcreds "http://api.clickatell.com/http/getbalance?api_id=SMSID&amp;user=SMSUSER&amp;password=SMSPASS"set url "http://smsgateway.servage.net/sms.php?customer=SMSUSER&amp;key=SMSPASS&amp;number=NUMTOSEND&amp;message=MSGTOSEND"########## DO NOT EDIT BELOW UNLESS YOU KNOW TCL! ########### bindsnamespace eval sms {    variable pubsmsadd {!smsadd}    variable pubbalbind {!smscreds}    variable pubnumbind {!number}    variable pubverbind {!smsver}    variable pubhelpbind {!smshelp}    variable pubbind {!sms}    bind PUB o|o $pubsmsadd [namespace current]::smsadd     bind PUB o|o $pubnumbind [namespace current]::number    bind PUB -|- $pubbalbind [namespace current]::credspublic    bind PUB -|- $pubverbind [namespace current]::smsver    bind PUB -|- $pubhelpbind [namespace current]::smshelp    bind PUB -|- $pubbind [namespace current]::public    namespace export getnames credspublic public private}proc sms::smsadd {nickname hostname handle channel arguments} {    global chan datfile    if ![channel get $channel sms] return    set args [split $arguments]    set data ""    # check args are correct    if {($arguments &lt; 1) || ([llength $args] &lt; 2)} {        putquick "PRIVMSG $channel :\[\002SMS\017\] \002Format:\002 !smsadd &lt;name&gt; &lt;number&gt;"        return 0    }    # check if names already added    if {[validfeed [lindex $args 0] 1]} {        putquick "PRIVMSG $channel :\[\002SMS\017\] \002Error:\002 User already exists!"        return 0    }    # make sure no letters in sms number    if {![ string is digit [lindex $args 1] ] } {        putquick "PRIVMSG $channel : [lindex $args 1]"        putquick "PRIVMSG $channel :\[\002SMS\017\] \002Error:\002 letters detected in &lt;number&gt; entry"        return 0    }    # Complain and exit if input file does not exist    if {![ file exists $datfile ] }  {        putquick "PRIVMSG $channel :\[\002SMS\017\] \002Error: \002File \"$datfile\" not found!"        return 0    }    # Complain and exit if input file is not readable    if {![ file readable $datfile ] }  {        putquick "PRIVMSG $channel :\[\002SMS\017\] \002Error:\002 Permission denied to read $datfile!"        return 0    }   # save sms data    if { [ catch { set fileId [open $datfile a] } err ] }  {        putquick "PRIVMSG $channel :\[\002SMS\017\] Error:\002 $err"        return 0    }    puts $fileId [lindex $args 0]:[lindex $args 1]    close $fileId    putquick "PRIVMSG $channel :\[\002SMS\017\] \002Added:\002 Name: [lindex $args 0] Number: [lindex $args 1]"}proc sms::public {nickname hostname handle channel arguments} {    global tagnick tagname tagmsg url urlcreds user pass id    variable token    set args [split $arguments]    if ![channel get $channel sms] return    if {($arguments &lt; 1) || ([llength $args] &lt; 2)} {        putquick "PRIVMSG $channel :\002Format:\002 !sms &lt;name&gt; &lt;message&gt;"        putquick "PRIVMSG $channel :."        putquick "PRIVMSG $channel :Available entries:"        putquick "PRIVMSG $channel :[getnames]"        return 0    }    if {![validfeed [lindex $args 0] 1]} {                     putquick "PRIVMSG $channel :\[\002SMS\017\] \002Error:\002 please choose one of the following names: "        putquick "PRIVMSG $channel :[getnames]"        return 0    }    set nick [lindex $args 0]    set number "0"    set number [getnumber $nick]    if {($nick == "") || ($number == "0")} {        putlog "RSS: Warning: Couldn't load configuration for the \[$id\] feed."        putquick "PRIVMSG $channel :\002Error:\002 couldnt get number for that user."        return 0    }    set arguments [lreplace $args 0 0]    #add tag and nick - if set in config above    if {$tagnick eq "1"} {          set arguments "$arguments %5b $handle %2f $channel %5d"    }    if {$tagname eq "1"} {        set arguments "$arguments %5b $tagmsg %5d"    }    # regsub some common irc chars for unicode    regsub -all " " $arguments "%20" arguments    regsub -all "#" $arguments "%23" arguments     regsub -all "&amp;" $arguments "%26" arguments     regsub -all "@" $arguments "%40" arguments    # regsub details into sms url    set realurl $url    regsub -all NUMTOSEND $realurl $number realurl    regsub -all MSGTOSEND $realurl $arguments realurl    regsub -all SMSID $realurl $id realurl    regsub -all SMSUSER $realurl $user realurl    regsub -all SMSPASS $realurl $pass realurl    # regsub details into urlcreds url    set realurlcreds $urlcreds    regsub -all SMSID $realurlcreds $id realurlcreds    regsub -all SMSUSER $realurlcreds $user realurlcreds    regsub -all SMSPASS $realurlcreds $pass realurlcreds    set token [http::geturl $realurl]    set data_frm_url [http::data $token]    putquick "PRIVMSG $channel :\002Sent:\002 $arguments"    putquick "PRIVMSG $channel :\002To:\002 [lindex $args 0] ($number)"    putquick "PRIVMSG $channel :\002Response:\002 $data_frm_url"    set token [http::geturl $realurlcreds]    set bal_frm_url [http::data $token]    putquick "PRIVMSG $channel :\002Credits:\002 $bal_frm_url"}proc sms::number {nickname hostname handle channel arguments} {    global chan datfile    set args [split $arguments]    if ![channel get $channel sms] return    if {($arguments &lt; 1) || ([llength $args] &lt; 1)} {        putquick "PRIVMSG $channel :\[\002SMS\017\] \002Format:\002 !number &lt;name&gt;"        putquick "PRIVMSG $channel :."        putquick "PRIVMSG $channel :Available entries:"        putquick "PRIVMSG $channel :[getnames]"        return 0    }    if {![validfeed [lindex $args 0] 1]} {        putquick "PRIVMSG $channel :\[\002SMS\017\] \002Error:\002 please choose one of the following names: "        putquick "PRIVMSG $channel :[getnames]"        return 0    }        set nick [lindex $args 0]    set number "0"    set number [getnumber $nick]    if {($nick == "") || ($number == "0")} {        putlog "RSS: Warning: Couldn't load configuration for the \[$id\] feed."        putquick "PRIVMSG $channel :\002Error:\002 couldnt get number for that user."        return 0    }    putquick "PRIVMSG $channel :\[\002SMS\017\] \002[lindex $args 0]:\002 $number"}proc sms::validfeed {keyword type} {    global datfile    # Complain and exit if file does not exist    if {![ file exists $datfile ] }     {        putquick "PRIVMSG $channel :\[\002SMS\017\] \002Error: \002File \"$datfile\" not found!"        return 0    }    # Complain and exit if file is not readable    if {![ file readable $datfile ] }   {        putquick "PRIVMSG $channel :\[\002SMS\017\] \002Error:\002 Permission denied to read $datfile!"        return 0    }    # read sms data    if { [ catch { set fileId [open $datfile r] } err ] }  {        putquick "PRIVMSG $channel :\[\002SMS\017\] Error:\002 $err"        return 0    }    set names [list]    while {![eof $fileId]} {        set line [gets $fileId]        set data [split $line ":"]        if {$data != ""} {                    lappend names [lindex $data 0]        }    }    close $fileId    foreach id $names {        if {[string equal -nocase $id $keyword]} {            switch -exact -- $type {                {1} { return 1 }                {2} { return $id }            }        }    }    return 0}proc sms::getnames { } {    global datfile    # Complain and exit if file does not exist    if {![ file exists $datfile ] }     {        putquick "PRIVMSG $channel :\[\002SMS\017\] \002Error: \002File \"$datfile\" not found!"        return 0    }    # Complain and exit if file is not readable    if {![ file readable $datfile ] }   {        putquick "PRIVMSG $channel :\[\002SMS\017\] \002Error:\002 Permission denied to read $datfile!"        return 0    }    # read sms data    if { [ catch { set fileId [open $datfile r] } err ] }  {        putquick "PRIVMSG $channel :\[\002SMS\017\] Error:\002 $err"        return 0    }    set names [list]    while {![eof $fileId]} {        set line [gets $fileId]        set data [split $line ":"]        if {$data != ""} {            lappend names [lindex $data 0]        }    }    close $fileId    return $names}proc sms::getnumber {smsname} {    global datfile    set smsnum ""    # read sms data    if { [ catch { set fileId [open $datfile r] } err ] }  {        putquick "PRIVMSG $channel :\[\002SMS\017\] Error:\002 $err"        return 0    }    set names [list]    while {![eof $fileId]} {        set line [gets $fileId]        set data [split $line ":"]        if {$data != ""} {            if {$smsname eq [lindex $data 0]} {                set smsnum [lindex $data 1]            }        }    }    close $fileId    return $smsnum}proc sms::smsver {nickname hostname handle channel arguments} {    global smsver    if ![channel get $channel sms] return    putquick "PRIVMSG $channel :\[\002SMS\017\] ver. $smsver"    putquick "PRIVMSG $channel :\002(C) 2005 EToS"}proc sms::credspublic {nickname hostname handle channel arguments} {    global chan urlcreds user pass id    if ![channel get $channel sms] return    # regsub details into urlcreds url    set realurlcreds $urlcreds    regsub -all SMSID $realurlcreds $id realurlcreds    regsub -all SMSUSER $realurlcreds $user realurlcreds    regsub -all SMSPASS $realurlcreds $pass realurlcreds    set token [http::geturl $realurlcreds]    set bal_frm_url [http::data $token]    putquick "PRIVMSG $channel :\[\002SMS\017\] \002Credits:\002 $bal_frm_url"}proc sms::smshelp {nickname hostname handle channel arguments} {    global chan    if ![channel get $channel sms] return    putquick "PRIVMSG $channel :\[\002SMS\017\] \002CMDS HELP!:\017"    putquick "PRIVMSG $channel : !sms &lt;name&gt; &lt;message&gt; - send a txt msg"    putquick "PRIVMSG $channel : !number &lt;name&gt; - view a users number, ops only cmd"    putquick "PRIVMSG $channel : !smscreds -  view credits on account"    putquick "PRIVMSG $channel : !smsadd &lt;name&gt; &lt;number&gt; - ops only"    putquick "PRIVMSG $channel : !smsdel - not implemented \(deliberately\)"    putquick "PRIVMSG $channel : !smsver - version info"    putquick "PRIVMSG $channel : !smshelp - err your here!"}putlog "Script loaded: SMS v1.1 \00302\002(C) 2005 EToS"</code></pre></div>and this is the sample API from Servage API PHP file.<div class="codebox"><p>Code: </p><pre><code>&lt;?php################################################### SAMPLE PHP CODE TO SEND SMS VIA SERVAGE API##################################################// Send SMS functionfunction sendSMS($number,$message,$concat = 1) {$url = 'http://smsgateway.servage.net/sms.php';$customer = 'YOURCUSTOMERCODE';$key = 'YOURKEYCODE';$request = $url.'?customer='.$customer.'&amp;key='.$key.'&amp;number='.urlencode($number).'&amp;message='.urlencode($message).'&amp;concat='.$concat;$ch = curl_init();curl_setopt($ch, CURLOPT_URL, $request);curl_setopt($ch, CURLOPT_HEADER, 0);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);$response = curl_exec($ch);curl_close($ch);return split(',',$response);}// Integration in your project$sms_api_result = sendSMS('number','text','1');// Check if SMS was received by the API or notif ($sms_api_result[0] == 'OK') {// Ok, SMS received by the API// Do something here...}else {// Failure, SMS was not received by the API// I this example we display the response to identify the errorprint_r($sms_api_result);}################################################### SAMPLE PHP CODE FOR SMS COVERAGE QUERY##################################################// Coverage Query functionfunction coverageQuery($number) {$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://smsgateway.servage.net/sms_coverage.php?number='.$number); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($ch); curl_close($ch);if (substr($data,0,2) == 'OK') return true;else return false;}?&gt;</code></pre></div>almost forgot, my contact.dat file contain this info ( Ayie:44870711111) this number is Servage format.<br><br>when i try sending the msg from irc, it gave me error result.<br><div class="codebox"><p>Code: </p><pre><code>&lt;@Me&gt; !sms one test&lt;@MyBot&gt; Sent: test%20%5b%20Ayie%20%2f%20%23sms%20%5d%20%5b%20Ayie%20%5d&lt;@MyBot&gt; To: Ayie ()&lt;@MyBot&gt; Response: ERROR,Missing valid recipient number;</code></pre></div>anyone can help me tune this code ??[/code]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2733">ayie</a> — Sat Aug 09, 2008 3:18 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ayie]]></name></author>
		<updated>2008-08-05T07:14:20-04:00</updated>

		<published>2008-08-05T07:14:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84410#p84410</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84410#p84410"/>
		<title type="html"><![CDATA[Option left out by author, but would like added.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84410#p84410"><![CDATA[
Hello danzigrules,<br><br>Have u try this scripts ?? It is works ??<br><br>I've try this scripts but not working, i not sure what's wrong ... maybe i signup with wrong package ...<br><br>what customer type you signup ?? <br>Clickatell Central (API)<br>Communicator<br>Messenger-Pro<br>Clickatell Wholesale<br><br>this what my bot reply ....<br><br><div class="codebox"><p>Code: </p><pre><code>&lt;@Afro&gt; !sms One test test&lt;@MySMS&gt; Sent: test%20test%20%5b%20Afro%20%2f%20%23sms%20%5d%20%5b%20Afro%20%26%20mike-rico%20%5d&lt;@MySMS&gt; To: One&lt;@MySMS&gt; Response: ERR: 001, Authentication failed&lt;@MySMS&gt; Credits: ERR: 001, Authentication failed</code></pre></div>hope you can help me ......<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2733">ayie</a> — Tue Aug 05, 2008 7:14 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[danzigrules]]></name></author>
		<updated>2008-06-28T00:39:07-04:00</updated>

		<published>2008-06-28T00:39:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83760#p83760</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83760#p83760"/>
		<title type="html"><![CDATA[Option left out by author, but would like added.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83760#p83760"><![CDATA[
Would it be possible for someone to add the !smsdel option for oper's in this script?<br>It is described at the end of the script.<br><br>Would be greatly appreciated. <br>Thanks Much<br><div class="codebox"><p>Code: </p><pre><code>#  Author: EToS#  Date: 09/08/2005#  Filename: sms.tcl#  Function: Eggdrop interface to clickatell's HTTP/S SMS Gateway##  Version: 1.1 *BeTA#  History: #       - 09/08/2005: First Coded#       - 16/06/2006: Added sms.dat for data handling#                     Added !smsadd, !smsver, !smshelp#                     tag and nick info to sms &amp; chan work flag##  Notes: Enable with .chanset #channel +sms# packagespackage require http# vars# script versionset smsver "1.1 *BeTA"# work chan flags ..setudef flag sms# tag bottom of sms with irc nick and tagmsg ... 0=no 1=yesset tagnick "1"set tagname "1"set tagmsg "********"# datafileset datfile "scripts/sms.dat"# clickatell detailsset user "**********"set pass "**********"set id "************"# shouldnt need to edit these urls below, but can be edited if clickatell change their# url structure, or if you wish to attempt to adapt script to another sms gateway set urlcreds "http://api.clickatell.com/http/getbalance?api_id=SMSID&amp;user=SMSUSER&amp;password=SMSPASS"set url "http://api.clickatell.com/http/sendmsg?api_id=SMSID&amp;user=SMSUSER&amp;password=SMSPASS&amp;to=NUMTOSEND&amp;text=MSGTOSEND"########## DO NOT EDIT BELOW UNLESS YOU KNOW TCL! ########### bindsnamespace eval sms {    variable pubsmsadd {!smsadd}    variable pubbalbind {!smscreds}    variable pubnumbind {!number}    variable pubverbind {!smsver}    variable pubhelpbind {!smshelp}    variable pubbind {!sms}    bind PUB o|o $pubsmsadd [namespace current]::smsadd     bind PUB o|o $pubnumbind [namespace current]::number    bind PUB -|- $pubbalbind [namespace current]::credspublic    bind PUB -|- $pubverbind [namespace current]::smsver    bind PUB -|- $pubhelpbind [namespace current]::smshelp    bind PUB -|- $pubbind [namespace current]::public    namespace export getnames credspublic public private}proc sms::smsadd {nickname hostname handle channel arguments} {    global chan datfile    if ![channel get $channel sms] return    set args [split $arguments]    set data ""    # check args are correct    if {($arguments &lt; 1) || ([llength $args] &lt; 2)} {        putquick "PRIVMSG $channel :\[\002SMS\017\] \002Format:\002 !smsadd &lt;name&gt; &lt;number&gt;"        return 0    }    # check if names already added    if {[validfeed [lindex $args 0] 1]} {        putquick "PRIVMSG $channel :\[\002SMS\017\] \002Error:\002 User already exists!"        return 0    }    # make sure no letters in sms number    if {![ string is digit [lindex $args 1] ] } {        putquick "PRIVMSG $channel : [lindex $args 1]"        putquick "PRIVMSG $channel :\[\002SMS\017\] \002Error:\002 letters detected in &lt;number&gt; entry"        return 0    }    # Complain and exit if input file does not exist    if {![ file exists $datfile ] }  {        putquick "PRIVMSG $channel :\[\002SMS\017\] \002Error: \002File \"$datfile\" not found!"        return 0    }    # Complain and exit if input file is not readable    if {![ file readable $datfile ] }  {        putquick "PRIVMSG $channel :\[\002SMS\017\] \002Error:\002 Permission denied to read $datfile!"        return 0    }   # save sms data    if { [ catch { set fileId [open $datfile a] } err ] }  {        putquick "PRIVMSG $channel :\[\002SMS\017\] Error:\002 $err"        return 0    }    puts $fileId [lindex $args 0]:[lindex $args 1]    close $fileId    putquick "PRIVMSG $channel :\[\002SMS\017\] \002Added:\002 Name: [lindex $args 0] Number: [lindex $args 1]"}proc sms::public {nickname hostname handle channel arguments} {    global tagnick tagname tagmsg url urlcreds user pass id    variable token    set args [split $arguments]    if ![channel get $channel sms] return    if {($arguments &lt; 1) || ([llength $args] &lt; 2)} {        putquick "PRIVMSG $channel :\002Format:\002 !sms &lt;name&gt; &lt;message&gt;"        putquick "PRIVMSG $channel :."        putquick "PRIVMSG $channel :Available entries:"        putquick "PRIVMSG $channel :[getnames]"        return 0    }    if {![validfeed [lindex $args 0] 1]} {                     putquick "PRIVMSG $channel :\[\002SMS\017\] \002Error:\002 please choose one of the following names: "        putquick "PRIVMSG $channel :[getnames]"        return 0    }    set nick [lindex $args 0]    set number "0"    set number [getnumber $nick]    if {($nick == "") || ($number == "0")} {        putlog "RSS: Warning: Couldn't load configuration for the \[$id\] feed."        putquick "PRIVMSG $channel :\002Error:\002 couldnt get number for that user."        return 0    }    set arguments [lreplace $args 0 0]    #add tag and nick - if set in config above    if {$tagnick eq "1"} {          set arguments "$arguments %5b $handle %2f $channel %5d"    }    if {$tagname eq "1"} {        set arguments "$arguments %5b $tagmsg %5d"    }    # regsub some common irc chars for unicode    regsub -all " " $arguments "%20" arguments    regsub -all "#" $arguments "%23" arguments     regsub -all "&amp;" $arguments "%26" arguments     regsub -all "@" $arguments "%40" arguments    # regsub details into sms url    set realurl $url    regsub -all NUMTOSEND $realurl $number realurl    regsub -all MSGTOSEND $realurl $arguments realurl    regsub -all SMSID $realurl $id realurl    regsub -all SMSUSER $realurl $user realurl    regsub -all SMSPASS $realurl $pass realurl    # regsub details into urlcreds url    set realurlcreds $urlcreds    regsub -all SMSID $realurlcreds $id realurlcreds    regsub -all SMSUSER $realurlcreds $user realurlcreds    regsub -all SMSPASS $realurlcreds $pass realurlcreds    set token [http::geturl $realurl]    set data_frm_url [http::data $token]    putquick "PRIVMSG $channel :\002Sent:\002 $arguments"    putquick "PRIVMSG $channel :\002To:\002 [lindex $args 0] ($number)"    putquick "PRIVMSG $channel :\002Response:\002 $data_frm_url"    set token [http::geturl $realurlcreds]    set bal_frm_url [http::data $token]    putquick "PRIVMSG $channel :\002Credits:\002 $bal_frm_url"}proc sms::number {nickname hostname handle channel arguments} {    global chan datfile    set args [split $arguments]    if ![channel get $channel sms] return    if {($arguments &lt; 1) || ([llength $args] &lt; 1)} {        putquick "PRIVMSG $channel :\[\002SMS\017\] \002Format:\002 !number &lt;name&gt;"        putquick "PRIVMSG $channel :."        putquick "PRIVMSG $channel :Available entries:"        putquick "PRIVMSG $channel :[getnames]"        return 0    }    if {![validfeed [lindex $args 0] 1]} {        putquick "PRIVMSG $channel :\[\002SMS\017\] \002Error:\002 please choose one of the following names: "        putquick "PRIVMSG $channel :[getnames]"        return 0    }        set nick [lindex $args 0]    set number "0"    set number [getnumber $nick]    if {($nick == "") || ($number == "0")} {        putlog "RSS: Warning: Couldn't load configuration for the \[$id\] feed."        putquick "PRIVMSG $channel :\002Error:\002 couldnt get number for that user."        return 0    }    putquick "PRIVMSG $channel :\[\002SMS\017\] \002[lindex $args 0]:\002 $number"}proc sms::validfeed {keyword type} {    global datfile    # Complain and exit if file does not exist    if {![ file exists $datfile ] }     {        putquick "PRIVMSG $channel :\[\002SMS\017\] \002Error: \002File \"$datfile\" not found!"        return 0    }    # Complain and exit if file is not readable    if {![ file readable $datfile ] }   {        putquick "PRIVMSG $channel :\[\002SMS\017\] \002Error:\002 Permission denied to read $datfile!"        return 0    }    # read sms data    if { [ catch { set fileId [open $datfile r] } err ] }  {        putquick "PRIVMSG $channel :\[\002SMS\017\] Error:\002 $err"        return 0    }    set names [list]    while {![eof $fileId]} {        set line [gets $fileId]        set data [split $line ":"]        if {$data != ""} {                    lappend names [lindex $data 0]        }    }    close $fileId    foreach id $names {        if {[string equal -nocase $id $keyword]} {            switch -exact -- $type {                {1} { return 1 }                {2} { return $id }            }        }    }    return 0}proc sms::getnames { } {    global datfile    # Complain and exit if file does not exist    if {![ file exists $datfile ] }     {        putquick "PRIVMSG $channel :\[\002SMS\017\] \002Error: \002File \"$datfile\" not found!"        return 0    }    # Complain and exit if file is not readable    if {![ file readable $datfile ] }   {        putquick "PRIVMSG $channel :\[\002SMS\017\] \002Error:\002 Permission denied to read $datfile!"        return 0    }    # read sms data    if { [ catch { set fileId [open $datfile r] } err ] }  {        putquick "PRIVMSG $channel :\[\002SMS\017\] Error:\002 $err"        return 0    }    set names [list]    while {![eof $fileId]} {        set line [gets $fileId]        set data [split $line ":"]        if {$data != ""} {            lappend names [lindex $data 0]        }    }    close $fileId    return $names}proc sms::getnumber {smsname} {    global datfile    set smsnum ""    # read sms data    if { [ catch { set fileId [open $datfile r] } err ] }  {        putquick "PRIVMSG $channel :\[\002SMS\017\] Error:\002 $err"        return 0    }    set names [list]    while {![eof $fileId]} {        set line [gets $fileId]        set data [split $line ":"]        if {$data != ""} {            if {$smsname eq [lindex $data 0]} {                set smsnum [lindex $data 1]            }        }    }    close $fileId    return $smsnum}proc sms::smsver {nickname hostname handle channel arguments} {    global smsver    if ![channel get $channel sms] return    putquick "PRIVMSG $channel :\[\002SMS\017\] ver. $smsver"    putquick "PRIVMSG $channel :\002(C) 2005 EToS"}proc sms::credspublic {nickname hostname handle channel arguments} {    global chan urlcreds user pass id    if ![channel get $channel sms] return    # regsub details into urlcreds url    set realurlcreds $urlcreds    regsub -all SMSID $realurlcreds $id realurlcreds    regsub -all SMSUSER $realurlcreds $user realurlcreds    regsub -all SMSPASS $realurlcreds $pass realurlcreds    set token [http::geturl $realurlcreds]    set bal_frm_url [http::data $token]    putquick "PRIVMSG $channel :\[\002SMS\017\] \002Credits:\002 $bal_frm_url"}proc sms::smshelp {nickname hostname handle channel arguments} {    global chan    if ![channel get $channel sms] return    putquick "PRIVMSG $channel :\[\002SMS\017\] \002CMDS HELP!:\017"    putquick "PRIVMSG $channel : !sms &lt;name&gt; &lt;message&gt; - send a txt msg"    putquick "PRIVMSG $channel : !number &lt;name&gt; - view a users number, ops only cmd"    putquick "PRIVMSG $channel : !smscreds -  view credits on account"    putquick "PRIVMSG $channel : !smsadd &lt;name&gt; &lt;number&gt; - ops only"    putquick "PRIVMSG $channel : !smsdel - not implemented \(deliberately\)"    putquick "PRIVMSG $channel : !smsver - version info"    putquick "PRIVMSG $channel : !smshelp - err your here!"}putlog "Script loaded: SMS v1.1 \00302\002(C) 2005 EToS"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9189">danzigrules</a> — Sat Jun 28, 2008 12:39 am</p><hr />
]]></content>
	</entry>
	</feed>
