Hello
I've written a Mortscript that:
1. Turns on wifi and waits for a connection to be automatically made (15s)
2. Starts TuneUp and clicks on the Download button in the GPS tab
3. Turns off wifi
You can run this with the latest Mortscript version. I tested it on WM6.1 (20755.1.4.0) with TuneUp 1.4.0.8. It could work also with other versions, but I haven't tested it.
Prerequisites:
1. A working wifi connection (it will not automatically connect unless you have already connected to a specific Access Point)
2. MortScript
3. TuneUp
Also, the script mutes the volume, so you won't hear beeps and things like this. The volume is restored when the script finishes.
I recommend running it like a scheduled job with an alarm scheduler like G-Alarm.
Just paste the code in a file ending in .mscr and you should be able to run it on a stock image.
Код:
###############################
# syncGPS - for n560/newplowe #
# developed by mad_ady #
###############################
##############################################
#customize these variables to fit your system#
##############################################
# how long does it take to connect to wifi? (in seconds)
connectTimeout = 15
# how long does it take to download the GPS data? (in seconds)
downloadTime = 10
#############################
### main code starts here ###
#############################
#remember the current volume level
currentVolume=Volume()
#mute the sound
SetVolume(0)
SleepMessage(3, "Starting wifi")
Run("\Windows\WrlsMgr.exe")
Sleep(2000)
#click on Wireless button (toggle)
#button is at 210,210
MouseClick( 210, 210)
Sleep(1000)
#wait for wireless to start/stop (about 5seconds)
Sleep(5000)
#close Wireless Manager
#'Done' button is at 88,619
MouseClick( 88, 619)
Sleep(1000)
SleepMessage(connectTimeout, "Waiting for wireless connection")
isConnected = InternetConnected("http://www.htc.com")
If ( isConnected )
#Do the action
SleepMessage(3, "Connected")
#Start TuneUp
Run("\Windows\TuneUp.exe")
Sleep(6000)
#Click the GPS Tab
MouseClick( 215, 567)
Sleep(1000)
#Click the Download button
MouseClick( 408, 507)
#Wait for the download to complete
Sleep(downloadTime * 1000)
SleepMessage(2, "Download should be complete")
SendOK
Else
SleepMessage( 3, "Unable to connect. Turning off")
Exit
EndIf
SleepMessage(3, "Stopping wifi")
Run("\Windows\WrlsMgr.exe")
Sleep(2000)
#click on Wireless button (toggle)
#button is at 210,210
MouseClick( 210, 210)
Sleep(1000)
#wait for wireless to start/stop (about 5seconds)
Sleep(5000)
#close Wireless Manager
#'Done' button is at 88,619
MouseClick( 88, 619)
Sleep(1000)
#restore sound level
SetVolume(currentVolume)
#Done
Let me know if it works for you.