Jump to content

SMS Sender


beestinga
 Share

Recommended Posts

My buddy and I use autoit to automate stuff, so we don't like to be around while it's doing its thing. As such, I created this function to send us text messages whenever something messes up. Usually it reads a toggle flag from the ini (1 or 0 to enable/disable respectively) and if set to one, launches this function. Carrier 1 is Verizon and Carrier 2 is Sprint.

This was adopted from The autobomber script that was posted here. I don't know the original poster, but it was collaborated on heavily by ZeroCool of these forums.

Feel free to hack/update/expand/convert into a real useful UDF.

-Stinga

Func sendcellmsg()
    $number = IniRead("settings.ini", "Phone", "Number", "NotFound")
    $Carrier = IniRead("settings.ini", "Phone", "Carrier", "NotFound")
    If $Carrier = 1 Then
        $oIE = _IECreate ("about:blank", 0, 0)
        _IENavigate ($oIE, "www.vtext.com")
        _IELoadWait ($oIE, 2000)
    ; get pointers to the login form and username and password fields
        $o_form = _IEFormGetObjByName ($oIE, "message_form")
        $o_to = _IEFormElementGetObjByName ($o_form, "min")
        $o_msg = _IEFormElementGetObjByName ($o_form, "text")
        $o_from = _IEFormElementGetObjByName ($o_form, "subject")
        
    ;Set field values and submit the form
        _IEFormElementSetValue ($o_to, $number)
        _IEFormElementSetValue ($o_msg, "Your AutoIT Application needs help!")
        _IEFormElementSetValue ($o_from, "AutoIT")
        Sleep(2000)
        _IEFormSubmit ($o_form)
    ;-----------page2(disclaimer)-------------------------------------------------------
        _IELoadWait ($oIE)
        $o_form = _IEFormGetObjByName ($oIE, "message_form")
        _IEFormImageClick ($o_form, "https://www.vtext.com/customer_site/images/buttons/btn_ok.gif")
        _IEFormSubmit ($o_form)
        _IELoadWait ($oIE)
        Sleep(2000)
        _IEQuit ($oIE)
    EndIf
    If $Carrier = 2 Then
        $oIE = _IECreate ("about:blank", 0, 0)
        _IENavigate ($oIE, "http://messaging.sprintpcs.com/textmessaging/compose")
        _IELoadWait ($oIE, 2000)
    ; get pointers to the login form and username and password fields
        $o_form = _IEFormGetObjByName ($oIE, "composeForm")
        $o_to = _IEFormElementGetObjByName ($o_form, "phoneNumber")
        $o_msg = _IEFormElementGetObjByName ($o_form, "message")
        
    ;Set field values and submit the form
        _IEFormElementSetValue ($o_to, $number)
        _IEFormElementSetValue ($o_msg, "Your AutoIT Application needs help!")
        Sleep(2000)
        _IEFormSubmit ($o_form)
    EndIf
EndFunc  ;==>sendcellmsg
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 years later...
  • 1 month later...

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
 Share

  • Recently Browsing   0 members

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