infernothebest Posted September 23, 2008 Posted September 23, 2008 i wan't to make my own sms prog for voipcheap, the problem is how do i programm the software that 1 char or more is one sms and 160 char is two sms and go on. Apple Keybord shortcuts for XP
dbzfanatic Posted September 23, 2008 Posted September 23, 2008 Make a function that sends the SMS messages then make a limit on the input/edit control of 159 (one less than your 160 char. limit for 2 SMS messages) and just make a button that sends the message then clears the input/edit. Or just split the string you read from the input/edit every 159 characters and pass them as variables to your function. E.G. $string = StringSplit(GUICtrlRead($input_edit),"") For $i = 1 To 159 $SMS &= $string[$i] Next For $i = 160 To UBound($string) - 1; provided the overall message is 219 or less characters. Easy to mod for your lengths. $SMS2 &= $string[$i] Next _SMS($SMS) _SMS($SMS2) Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote]
infernothebest Posted September 23, 2008 Author Posted September 23, 2008 Make a function that sends the SMS messages then make a limit on the input/edit control of 159 (one less than your 160 char. limit for 2 SMS messages) and just make a button that sends the message then clears the input/edit. Or just split the string you read from the input/edit every 159 characters and pass them as variables to your function. E.G. $string = StringSplit(GUICtrlRead($input_edit),"") For $i = 1 To 159 $SMS &= $string[$i] Next For $i = 160 To UBound($string) - 1; provided the overall message is 219 or less characters. Easy to mod for your lengths. $SMS2 &= $string[$i] Next _SMS($SMS) _SMS($SMS2)oke this is good for 2 sms but i wanna make this countless so it could be 1 it could be 2 it could be 100:) how do i do that btw thx for replying;) Apple Keybord shortcuts for XP
dbzfanatic Posted September 23, 2008 Posted September 23, 2008 (edited) I'm fairly sure that you can use StringSplit() to split it every 159 characters but I can't check syntax since I don't have autoit on this comp. Check the helpfile and then just do something like For $i = 1 To Int(StringLen(GUICtrlRead($input_edit))/159) Assign("String" & $i, StringSplit(GUICtrlRead($input_edit),"",159));probably the wrong syntax for the StringSplit() but you should get the idea Next Edit: Fixed my Assign() (thanks to a lil help from rasim in another post) Edited September 23, 2008 by dbzfanatic Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote]
infernothebest Posted September 23, 2008 Author Posted September 23, 2008 i don't know how to apply this because if you got 1.1 or 1.2 it is still 1 but is must be 2 sms i give you my full source. i wanna do this if i click verzenden(send) it must split the text into 160 characters, next every 160 char must be send using the html link expandcollapse popup#include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <WindowsConstants.au3> #NoTrayIcon #include <IE.au3> $username= "" $password= "" $callerID= "" $oIE = _IECreate ("about:blank",0,0) GUICreate("SMS Sender",300,300) $Ontvanger = GUICtrlCreateInput("", 10, 5, 100, 20,$ES_CENTER,$WS_EX_CLIENTEDGE) $adresboek = GUICtrlCreateButton("Adresboek", 115, 5, 60,20) $TEXT = GUICtrlCreateInput("", 10, 30, 278, 210,$ES_MULTILINE,$WS_EX_CLIENTEDGE ) $Send = GUICtrlCreateButton("Verzend", 175, 250, 100,40) $length="0" $Characters= GUICtrlCreateLabel("Characters: "&$length, 10, 250, 100) $SMSlength="0" $SMS= GUICtrlCreateLabel("SMS: "&$SMSlength, 10, 270, 100) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() $length = StringLen(GuiCtrlRead($TEXT)) GUICtrlSetData ($Characters,"Characters: "&$length) For $i = 0 To $length/160 GUICtrlSetData($SMS,"SMS: "&$i) Next sleep(40) If $msg =$adresboek Then EndIf If $msg = $Send Then $readOntvanger=GUICtrlRead ($Ontvanger,0) $readText=GUICtrlRead ($TEXT,0) if StringIsDigit ( $readOntvanger )Then GUICtrlSetState ( $Send, $GUI_DISABLE ) _IENavigate ($oIE, "https://myaccount.VoipCheap.com/clx/sendsms.php?username="&$username&"&password="&$password&"&from="&$callerID&"&to="&$readOntvanger&"&text="&$readText) _IELoadWait ($oIE) MsgBox(0,"","Bericht Verzonden naar "& $readOntvanger) GUICtrlSetData ($TEXT,"") GUICtrlSetState ( $Send, $GUI_ENABLE ) Else MsgBox(16,"Ontvanger verkeerd", "Fout: ingave veld ontvanger.") EndIf EndIf If $msg = $GUI_EVENT_CLOSE Then Exit WEnd Apple Keybord shortcuts for XP
dbzfanatic Posted September 23, 2008 Posted September 23, 2008 (edited) i don't know how to apply this because if you got 1.1 or 1.2 it is still 1 but is must be 2 sms i give you my full source. i wanna do this if i click verzenden(send) it must split the text into 160 characters, next every 160 char must be send using the html link Try: expandcollapse popup#include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <WindowsConstants.au3> #NoTrayIcon #include <IE.au3> $username= "" $password= "" $callerID= "" $oIE = _IECreate ("about:blank",0,0) GUICreate("SMS Sender",300,300) $Ontvanger = GUICtrlCreateInput("", 10, 5, 100, 20,$ES_CENTER,$WS_EX_CLIENTEDGE) $adresboek = GUICtrlCreateButton("Adresboek", 115, 5, 60,20) $TEXT = GUICtrlCreateInput("", 10, 30, 278, 210,$ES_MULTILINE,$WS_EX_CLIENTEDGE ) $Send = GUICtrlCreateButton("Verzend", 175, 250, 100,40) $length="0" $Characters= GUICtrlCreateLabel("Characters: "&$length, 10, 250, 100) $SMSlength="0" $SMS= GUICtrlCreateLabel("SMS: "&$SMSlength, 10, 270, 100) GUISetState(@SW_SHOW) While 1 $length = StringLen(GuiCtrlRead($TEXT)) GUICtrlSetData ($Characters,"Characters: "&$length) For $i = 0 To Int($length/160) + 1 GUICtrlSetData($SMS,"SMS: "&$i) Next $msg = GUIGetMsg() Switch $msg ; sleep(40) commented out, GUIGetMsg has built-in sleep Case $adresboek $Send _Sep(GUICtrlRead($TEXT) $GUI_EVENT_CLOSE Exit WEnd Func _Verzenden($sString) Local $sString $readOntvanger=GUICtrlRead ($Ontvanger,);removed un-needed 0 if StringIsDigit ( $readOntvanger )Then GUICtrlSetState ( $Send, $GUI_DISABLE ) _IENavigate ($oIE, "https://myaccount.VoipCheap.com/clx/sendsms.php?username=" & $username & "&password=" & $password & "&from=" & $callerID & "&to=" & $readOntvanger & "&text=" & $sString) _IELoadWait ($oIE) MsgBox(0,"","Bericht Verzonden naar "& $readOntvanger) GUICtrlSetData ($TEXT,"") GUICtrlSetState ( $Send, $GUI_ENABLE ) Else MsgBox(16,"Ontvanger verkeerd", "Fout: ingave veld ontvanger.") EndIf EndFunc Func _Sep($sString) Local $sString, $len $len = Int(StringLen($sString)/160) + 1 For $i = 0 To $len Assign("SMS" & $i, StringLeft($sString,160 * $i) $sString = StringTrimLeft($sString,160) Next Sleep(500); take a break to save some CPU For $n = 1 To $len _Verzenden(Eval($SMS & $n)) Sleep(20); rest for CPU Next EndFunc By the way what language is that? It looks German but I've been wrong before. Edited September 23, 2008 by dbzfanatic Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote]
infernothebest Posted September 24, 2008 Author Posted September 24, 2008 i got a number of errors if i try to compile this script Apple Keybord shortcuts for XP
infernothebest Posted September 25, 2008 Author Posted September 25, 2008 i got a number of errors if i try to compile this scriptthx for all the helping but i fixed my own code:) Apple Keybord shortcuts for XP
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now