Jump to content

Need Some help..


Recommended Posts

I am trying to write an AutoIT script to send an SMS so I can schedule them

so far I have

Run ("mPhonetools.exe")
WinWaitActive("mobile PhoneTools", "Optus Mobile (AU)")
Send("^t")
Send("12345678")

and that gets to the following:

Posted Image

I need it to goto that box selected (but tab doesnt work)

and then press the send button

then close the program...

Thanks...

Link to comment
Share on other sites

Hiya, Thanks that worked great..

I would now like to make the program loop and send an sms every 30 minutes for a total of 5 hours

For the "send("CODE Name")" Line I want the "CODE" Part to change each time

so that would mean there would be 10 different codes to be sent.

what would be the best way to do this?

I was thinking like:

Const Code1 Codexxx1

Const Code2 Codexxx2

?

My current code is:

; Run MobilePhone Tools
Run ("mPhonetools.exe")

; Wait til Service is available
WinWaitActive("mobile PhoneTools", "Optus Mobile (AU)")

; Open SMS Dialog
Send("^t")

; Enter Phone Number in To Field
Send("12345678")

; Enter Code into Window
MouseClick("left", 555, 600, 1)
send("CODE Name")

; Click Send
MouseClick("left", 420, 440, 1)

; Wait til send
Sleep (5000)
WinClose("mobile PHoneTools")
Edited by antiflag
Link to comment
Share on other sites

Try this... I'm not sure what will happen with the For...Next in the Do...Until... Let me check it a second.

Edit: Ok, changed it. Should work now. $Count = 10 because. There are 10 lots of 30 minutes in 5 hours. 2 in 1 hour. 2x5 hours = 10.

$Count = 0

Run ("mPhonetools.exe")

WinWaitActive("mobile PhoneTools", "Optus Mobile (AU)")

Send("^t")
Send("19996600")

$Code = StringSplit("Code1,Code2,Code3,Code4,Code5,Code6,Code7,Code8,Code9,Code10",",")

While $Count <> 10
   For $I = 1 To $Code[0]
      MouseClick("left", 555, 600, 1)
      Send($Code[$I])
      MouseClick("left", 420, 440, 1)
   Next
   Sleep (1000 * 60 * 30)
   $Count = $Count + 1
Wend

WinClose("mobile PHoneTools")
Edited by Burrup

qq

Link to comment
Share on other sites

Try this... I'm not sure what will happen with the For...Next in the Do...Until... Let me check it a second.

Edit: Ok, changed it. Should work now. $Count = 10 because. There are 10 lots of 30 minutes in 5 hours. 2 in 1 hour. 2x5 hours = 10.

$Count = 0

Run ("mPhonetools.exe")

WinWaitActive("mobile PhoneTools", "Optus Mobile (AU)")

Send("^t")
Send("19996600")

$Code = StringSplit("Code1,Code2,Code3,Code4,Code5,Code6,Code7,Code8,Code9,Code10",",")

While $Count <> 10
   For $I = 1 To $Code[0]
      MouseClick("left", 555, 600, 1)
      Send($Code[$I])
      MouseClick("left", 420, 440, 1)
   Next
   Sleep (1000 * 60 * 30)
   $Count = $Count + 1
Wend

WinClose("mobile PHoneTools")

<{POST_SNAPBACK}>

Thanks Heaps for this!, How do I add more text after the $Code[$I] bit

like say I want

Code 1 Three More Words

Cheers!

also. If Im using my computer while this is happening will it still work?

Link to comment
Share on other sites

Maybe.. look on the forums for a UDF called _MouseClickPlus(). It allows you to send mouse clicks to a minimized window. And you might be able to send text, like "^t" and "19996600" with ControlSend(), I'm not sure if that works minimized but.

As for the Code 3 more words.

If you want to add the same 3 words after each code then change this line...

Send($Code[$I])
;To...
Send($Code[$I] & " Put anything you want here")

But if you want each code to have different words change this line...

$Code = StringSplit("Code1,Code2,Code3,Code4,Code5,Code6,Code7,Code8,Code9,Code10",",")
;To something like
$Code = StringSplit("Code1 and come words,Code2 blah blah ,Code3,Code4 3 words here,Code5,Code6,Code7,Code8,Code9,Code10",",")

I didn't change all the above line cause I'm lazy, and notice I didn't change some of them, thats because you don't have too, just change the ones you need to and leave the ones you dont, or don't change any if needed.

:(

Edited by Burrup

qq

Link to comment
Share on other sites

Maybe.. look on the forums for a UDF called _MouseClickPlus(). It allows you to send mouse clicks to a minimized window. And you might be able to send text, like "^t" and "19996600" with ControlSend(), I'm not sure if that works minimized but.

As for the Code 3 more words.

If you want to add the same 3 words after each code then change this line...

Send($Code[$I])
;To...
Send($Code[$I] & " Put anything you want here")

But if you want each code to have different words change this line...

$Code = StringSplit("Code1,Code2,Code3,Code4,Code5,Code6,Code7,Code8,Code9,Code10",",")
;To something like
$Code = StringSplit("Code1 and come words,Code2 blah blah ,Code3,Code4 3 words here,Code5,Code6,Code7,Code8,Code9,Code10",",")

I didn't change all the above line cause I'm lazy, and notice I didn't change some of them, thats because you don't have too, just change the ones you need to and leave the ones you dont, or don't change any if needed.

:(

<{POST_SNAPBACK}>

The Code doesnt appear to be waiting... it just keeps going.. :S
Link to comment
Share on other sites

Change Sleep(1000 * 60 * 30) to Sleep (1805000).

<{POST_SNAPBACK}>

I had to make a few changes since the sms dialog has to be reopened each time... but I have no way to check that it is working?

$Count = 0

Run ("mPhonetools.exe")

WinWaitActive("mobile PhoneTools", "Optus Mobile (AU)")

$Code = StringSplit("Code1,Code2,Code3,Code4,Code5,Code6,Code7,Code8,Code9,Code10",",")

While $Count <> 10
   Send("^t")
   Send("19996600")
   For $I = 1 To $Code[0]
      MouseClick("left", 555, 600, 1)
      Send($Code[$I] & " One Two Three")
      MouseClick("left", 420, 440, 1)
   Next
   Sleep (1805000)
   $Count = $Count + 1
Wend

WinClose("mobile PHoneTools")
Link to comment
Share on other sites

Sleep (1805000) means every 30 minutes and 5 seconds for sending time. Just change it to like Sleep(10000), 10 seconds, to test it. So you don't have to wait half an hour to check if its working lol, you just have to wait 10 seconds.

Edited by Burrup

qq

Link to comment
Share on other sites

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...