Jump to content

Recommended Posts

Posted (edited)

Hi all!

I made this script to work like a plugin to my other script. It sends free sms to any portuguese cellphone.

Use it like: SMSPT.EXE <Number> <Text bla bla bla>

Some provider have a limit of messages you can send every day, so you can add diferent account to your <App Name>.TXT file

Example:

Account1|password1
  Account2|password2
  Account3|password3

Im looking for the same for other countries, if you have a similar script please share it us.

To change the form and object names, you could use a firefox extension like FIREBUG

Post here you comments / critics

#region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_useupx=n
;#AutoIt3Wrapper_Run_Debug_Mode=Y
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
#cs ----------------------------------------------------------------------------
    
    AutoIt Version: 3.2.12.0
    Author:         Linux
    
    Script Function:
    Template AutoIt script.
    
#ce ----------------------------------------------------------------------------
#include <IE.au3>
#include <String.au3>
#include <array.au3>

Global $account_File = StringTrimRight(@ScriptName, 4) & ".TXT"
Global $CellNumber, $text
Global $Login_user, $Login_password, $Is_Visible = 1 ; Change to 0 to create a invisivel IE

#region Account Zone#
If Not FileExists($account_File) Then
    MsgBox(-1, "", "Please add an account to " & $account_File & @CRLF & "Example: LOGIN|PASSWORD")
    Exit
EndIf
$FileRaw = FileRead($account_File)
While StringRight($FileRaw, 1) = @LF Or StringRight($FileRaw, 1) = @CR
    $FileRaw = StringTrimRight($FileRaw, 1)
WEnd
$FileArray = StringSplit($FileRaw, @CRLF, 1)
If StringInStr($FileArray[1], "|") Then
    _ArrayInsert($FileArray, 0, $FileArray[0])
    $FileArray[1] = 1
    $FileArray[0] += 1
Else
    $FileArray[1] = Number($FileArray[1])
    $FileArray[1] += 1
EndIf
If $FileArray[1] >= $FileArray[0] Then $FileArray[1] = 1
;_ArrayDisplay($FileArray,"",-1,0,"","/")
FileDelete($account_File)
For $i = 1 To $FileArray[0]
    FileWrite($account_File, $FileArray[$i] & @CRLF)
Next
ConsoleWrite(@CRLF & "#" & $FileArray[1] & " Account User|PASS: " & $FileArray[$FileArray[1] + 1])
$temp_array = StringSplit($FileArray[$FileArray[1] + 1], "|", 1)
$Login_user = $temp_array[1]
$Login_password = $temp_array[2]
#endregion Account Zone#
#region Arguments
If $CmdLine[0] <> 0 Then
    ;MsgBox(-1,"ARGUMENTS",$CmdLineRaw)
    $CellNumber = $CmdLine[1]
    $text = StringReplace($CmdLineRaw, $CmdLine[1] & " ", "")
Else
    If Not @Compiled Then
        ;$Login_user = "Your user"
        ;$Login_password = "your password"
        sendsms("Whoo-hoo!", "+351911231231") ; Put here your phone number to test while debug
    Else
        MsgBox(-1, "SMS ERROR", 'No arguments! Please execute with "APP.EXE NUMBER TEXT')
    EndIf
    Exit
EndIf
#endregion Arguments
#region SMS
If StringLeft($CellNumber, 4) = "+351" Then $CellNumber = StringTrimLeft($CellNumber, 4) ;remove the +351
sendsms($text, $CellNumber)
#cs ==================== Function IsfreeDorf =============
    Made by Linux
    Working For portugal
    Sends a SMS to the number, using the IE
#ce
Func sendsms($message, $number)
    TrayTip("", "Sending Sms to " & $number, 0)
    ;create Browser in the login page.
    $oIE2 = _IECreate("http://www.smsaborla.com/", 0, $Is_Visible)
    _IELoadWait($oIE2, 1000, 10000)
    $GetSource = _IEDocReadHTML($oIE2)
    TrayTip("", "Login", 0)
    $o1 = _IEFormGetCollection($oIE2, 0)
    $o2 = _IEFormElementGetObjByName($o1, "inputtext1"); Read Login InputBox Reference
    $o3 = _IEFormElementGetObjByName($o1, "inputtext2"); Read Password InputBox Reference
    _IEFormElementSetValue($o2, $Login_user)
    _IEFormElementSetValue($o3, $Login_password)
    Sleep(200)
    _IEFormSubmit($o1) ; Submit login
    _IELoadWait($oIE2, 0, 10000);wait for Ie
    Sleep(Random() * 2000)
    _IENavigate($oIE2, "http://www.smsaborla.com/messages.php") ; Navigate to the sending page this is your link of SEND MESSAGE
    $o1 = _IEFormGetCollection($oIE2, 0);Read Form
    $prefix = _IEFormElementGetObjByName($o1, "number1"); Read Prefix Combo Box
    $rest = _IEFormElementGetObjByName($o1, "number2") ; Read Rest of number input box
    $MessageBox = _IEFormElementGetObjByName($o1, "message") ; Message Input box
    Sleep(Random() * 2000)
    If IsObj($prefix) Then ConsoleWrite(@CRLF & "Debug: $oQuery is an object. Type = " & ObjName($prefix)) ;check object type
    _IEFormElementOptionselect($prefix, StringLeft($number, 2), 1, "byValue") ; Fill Data
    _IEFormElementSetValue($rest, StringRight($number, 7))
    _IEFormElementSetValue($MessageBox, $message)
    Sleep(200)
    $oForm = _IEFormGetObjByName($oIE2, "mensagem")
    _IEFormSubmit($oForm)
    _IELoadWait($oIE2, 0, 10000)
    _IEQuit($oIE2)
EndFunc   ;==>sendsms
#endregion SMS

Kind regards, Linux

Edited by Linux
You can help! Donate to AutoIt! or, visit ClimatePREDICTION.netMy posts:Travian Bot Example (100+ servers) BETAHow to Host you code/app for free! (unlimited team number) (Public or Private)"Sir, we're surrounded!" "Excellent. We can attack in any direction!"

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...