Becomplex114 Posted April 7, 2010 Share Posted April 7, 2010 Hey, I'm brand new to AutoIt and am planning to start reading through some of the guides and tutorials, but before i do i was wondering this this would be possible. I want to create a script that will use the arrow keys to move while I'm away at first. If this is possible thing possibly expand on it but for now i just want it to be able to move around constantly(back and forth) until i stop it myself. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted April 7, 2010 Share Posted April 7, 2010 (edited) Yep, that's possible. Here's a few links good for reading.. http://www.autoitscript.com/autoit3/docs/ http://www.autoitscript.com/wiki/Tutorials http://www.youtube.com/results?search_query=autoit&search_type=&aq=f Welcome to a great forum! Edited April 7, 2010 by snowmaker - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
ShawnW Posted April 7, 2010 Share Posted April 7, 2010 Answer:Yes, very easy. Advice:whatever game you are wanting to do this in I recommend you read the announcements and make sure it is one that you are allowed to discuss here. Link to comment Share on other sites More sharing options...
Valuater Posted April 7, 2010 Share Posted April 7, 2010 ; Press Esc to terminate script, Pause/Break to "Run" Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("+!d", "ShowMessage") ;Shift-Alt-d ;;;; Body of program would go here ;;;; While 1 Sleep(100) WEnd ;;;;;;;; Func TogglePause() $Paused = Not $Paused If $Paused Then ToolTip('Script is "Running"', 0, 0) While $Paused Send("{LEFT 10}") Sleep(1000) Send("{RIGHT 10}") Sleep(1000) WEnd ToolTip("") EndFunc ;==>TogglePause Func Terminate() Exit 0 EndFunc ;==>Terminate Func ShowMessage() MsgBox(4096, "", "Thanks Valuater ...8) ") EndFunc ;==>ShowMessage 8) Link to comment Share on other sites More sharing options...
Becomplex114 Posted April 7, 2010 Author Share Posted April 7, 2010 Thanks for the quick replies everyone, looking forward to learning more about AutoIt scripting. Link to comment Share on other sites More sharing options...
Becomplex114 Posted April 8, 2010 Author Share Posted April 8, 2010 (edited) expandcollapse popup; Press Esc to terminate script, Pause/Break to "Run" #include <ImageSearch.au3> Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("+!d", "ShowMessage") ;Shift-Alt-d $x1=0 $y1=0 ;;;; Body of program would go here ;;;; While 1 Send("{UP}") Sleep(100) Send("{DOWN}") Sleep(100) $result = _ImageSearch("attack.bmp",1,$x1,$y1,100) if $result=1 Then MouseMove($x1,$y1,3) MouseClick("left",$x1,$y1,1,3) $result2 = _ImageSearch("wasp.bmp",1,$x1,$y1,100) if $result2=1 Then MouseMove($x1,$y1,3) MouseClick("left",$x1,$y1,1,3) elseIf $result2=0 Then $result3 = _ImageSearch("scorpion.bmp",1,$x1,$y1,100) if $result3=1 Then MouseMove($x1,$y1,3) MouseClick("left",$x1,$y1,1,3) EndIf EndIf EndIf WEnd ;;;;;;;; Func TogglePause() $Paused = Not $Paused If $Paused Then ToolTip('Script is "Running"', 0, 0) While $Paused Send("{LEFT 10}") Sleep(1000) Send("{RIGHT 10}") Sleep(1000) WEnd ToolTip("") EndFunc ;==>TogglePause Func Terminate() Exit 0 EndFunc ;==>Terminate Func ShowMessage() MsgBox(4096, "", "Thanks Valuater ...8) ") EndFunc ;==>ShowMessage Okay i know this is probably horrible, but this is what i have so far. (and thanks again Valuater). But now i have a few problems i haven't been able to figure out. 1. I couldn't figure out how to make it send up and down constantly for a while before running the ImageSearch 2. And it seemed to take a while to find the images, is there any way to speed it up? Edit: nvm i figured out a solution for my first problem Edited April 8, 2010 by Becomplex114 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