rumourh Posted December 3, 2010 Share Posted December 3, 2010 So: I'm trying to work out how to use AutoIT v3 and I've had a shot at working it out but am having no luck in getting it to work. I've made and attempt at writing it and was wondering if anyone is able to assist me with where I am going wrong. Basically: I want to have a script that sits active, I can run (and restart) with F11, pause with F8 and exit with {ESC}. The routines in the script I would like to be able to call to repeat actions within an Macromedia Flash window of Internet Explorer. I am having no joy with this so far, any tips or suggestions would be appreciated. With some fear of being laughed at, here is my script (which doesnt work at all): Global $Pause HotKeySet("{F11}","Start") HotKeySet("{F8}","PauseIT") HotKeySet("{ESC}","ExitScript") AutoItSetOption ("WintTitleMatchMode", 2) WinActivate("Windows Internet Explorer") ;Main body of Script Func Start() Action1() Sleep(2000) $checksum = PixelChecksum(230,450,235,455) While $checksum = PixelChecksum(230,450,235,455) ;If these pixels change I want it to stop Action2() Sleep(5000) WEnd EndFunc ;Functions Func Action1() ControlClick ("[Class:MacromediaFlashPlayerActiveX]","", 800, 100) SEND ("Some text") ControlClick ("[Class:MacromediaFlashPlayerActiveX]","", 900, 100) Sleep(2000) Endfunc Func Action2() ControlClick("[Class:MacromediaFlashPlayerActiveX]","", 600, 100) Sleep(1000) Endfunc Func PauseIT() $Pause = NOT $Pause While $Pause sleep(10000) ;10 Seconds between checking to reduce CPU usage ToolTip('Script is "Paused" - Press F8 to continue',0,0) WEnd ToolTip("") EndFunc Func ExitScript() Exit 0 EndFunc Link to comment Share on other sites More sharing options...
JohnOne Posted December 3, 2010 Share Posted December 3, 2010 It would help if you were to mention what about it dosent work.As far as IO can tell it wont do anything at all as it stands, as there is no loop in your main body of script to keep it alivejust a simple While 1 Sleep(10) WEndwill doYou should also put your code between code tags[code];your code[/code] AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
SparkSoft Posted December 3, 2010 Share Posted December 3, 2010 If this is game automation, read this >>> Game Bots & Automation [center]First Ever Script/App[/center][center]Simple Battery Meter[/center] Link to comment Share on other sites More sharing options...
JohnOne Posted December 3, 2010 Share Posted December 3, 2010 There is nothing in the OP to suggest it is anything to do with a game bot. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
rumourh Posted December 3, 2010 Author Share Posted December 3, 2010 Cheers John, thanks for the tip - I'll keep reading up and continue having a go. It's for remote home monitoring, and I've worked out I've got the two actions around the wrong way and the monitoring status pixel check backwards too Link to comment Share on other sites More sharing options...
SparkSoft Posted December 3, 2010 Share Posted December 3, 2010 Sorry Because it was flash player I automatically assumed it was.What is it exactly that your trying to acheive, like what is it this script is going to be doing for you.Im a newbie But have learnt tons of stuff over the last month, and could be of some helpSparky x [center]First Ever Script/App[/center][center]Simple Battery Meter[/center] Link to comment Share on other sites More sharing options...
SparkSoft Posted December 3, 2010 Share Posted December 3, 2010 I found this Example in the documentationit has pixelchecksum() and a while loop as welllook at the example at the bottom of the page, its basically what your trying to do (loop to check if pixels have changed ) [center]First Ever Script/App[/center][center]Simple Battery Meter[/center] Link to comment Share on other sites More sharing options...
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