IKilledBambi Posted September 18, 2008 Share Posted September 18, 2008 I'm having serious troubles with the left top right bottom.. is there any way to work it out other than random guessing? Don't worry my resolution is correct. =] Link to comment Share on other sites More sharing options...
Community On Patrol Posted September 18, 2008 Share Posted September 18, 2008 Hi IKilledBambi, Please create descriptive topics. Using one word topics makes it really difficult to use the search feature, and those that could probably answer your question will probably not even read your thread. Doing it enough could cause your posting privileges to be taken away all together, and we don't want that . Thanks. Link to comment Share on other sites More sharing options...
IKilledBambi Posted September 18, 2008 Author Share Posted September 18, 2008 I don't know how better to explain it, maybe this will help? I cannot seem to figure out how to measure left top right bottom. Is there an easy way to measure, or do you just guess? Meaning, where does the rectangle start? 500, 500, 500, 500 seems to be really tiny, but 250, 215, 750, 500 its a decent size. What code fills up the whole screen, and how did you know without guessing. PixelSearch ( left, top, right, bottom, color [, shade-variation] [, step]] ) Link to comment Share on other sites More sharing options...
FreeFry Posted September 18, 2008 Share Posted September 18, 2008 It depends on what the PixelCoordMode option is set to. With the default (2 :absolute screen coords) , it's desktop coords. Say for example left and top is 50, and right and bottom is 100, it would scan a 50 pixel area, 50 pixels from the left, and 50 pixels from the top. Basically from X:50 Y:50 to X:100 Y:100 Hope that made some sense. Link to comment Share on other sites More sharing options...
IKilledBambi Posted September 18, 2008 Author Share Posted September 18, 2008 That helps quite a bit, now I just need to know, how many pixels would search the whole screen from the left. Here's an example. _ _ _ _ _ _ _ _ _ _ | | | | | | | 100 pixels. | | ------------------| | | 50 pixels | | | | | | | | | | | | | ---------------------- How many pixels would go across the whole screen from the left, and how many from the top? Or can you just give me the coordinates to search the whole screen and I can work with that? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 18, 2008 Moderators Share Posted September 18, 2008 @DesktopWidth (For a search, would start at 0 to the width) @DesktopHeight (For a search, would start at 0 to the height) @DesktopDepth (To confirm that you are in the right bit ratio that you got your colors to search for in) Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
IKilledBambi Posted September 18, 2008 Author Share Posted September 18, 2008 (edited) Alright thanks that helped a lot but now it stopped going to the pixel.. My whole objective is to make it click unread things in the forum(to further my AI knowledge). HotKeySet("{f6}", "S1") HotKeySet("{f7}", "S2") While 1 WEnd Func S1() While 1 $staple = @DesktopWidth $stapler = @DesktopHeight Sleep(100) MouseClick("left") $Coord = PixelSearch($staple, $staple, $stapler, $stapler, 0xFF0000, 5, 2) If Not @error Then MouseClick( "Left", $Coord[0], $Coord[1], 2, 0) EndIf WEnd EndFunc ;==>S1 Func S2() While 1 Sleep(6000) WEnd EndFunc ;==>S2 Before I got that part added it would go to the coords and click, now it's not. I can't figure out why, any ideas? EDIT: Alright I found out it's just not working now. I must be using the function wrong. =[ Edited September 18, 2008 by IKilledBambi Link to comment Share on other sites More sharing options...
dgarrett8 Posted September 19, 2008 Share Posted September 19, 2008 Is this for a game? If so...what game "I think, therefore I am"[size="1"]René Descartes[/size] Link to comment Share on other sites More sharing options...
IKilledBambi Posted September 19, 2008 Author Share Posted September 19, 2008 (edited) My whole objective is to make it click unread things in the forum(to further my AI knowledge).I'm pretty sure your not even allowed to talk about using it for games on this site. Edited September 19, 2008 by IKilledBambi Link to comment Share on other sites More sharing options...
dgarrett8 Posted September 19, 2008 Share Posted September 19, 2008 You are. There are tutorials on how to make them for flash games, such as curveball. I was helped before on a pixelbot too. "I think, therefore I am"[size="1"]René Descartes[/size] Link to comment Share on other sites More sharing options...
FreeFry Posted September 20, 2008 Share Posted September 20, 2008 Alright thanks that helped a lot but now it stopped going to the pixel.. My whole objective is to make it click unread things in the forum(to further my AI knowledge). HotKeySet("{f6}", "S1") HotKeySet("{f7}", "S2") While 1 WEnd Func S1() While 1 $staple = @DesktopWidth $stapler = @DesktopHeight Sleep(100) MouseClick("left") $Coord = PixelSearch($staple, $staple, $stapler, $stapler, 0xFF0000, 5, 2) If Not @error Then MouseClick( "Left", $Coord[0], $Coord[1], 2, 0) EndIf WEnd EndFunc;==>S1 Func S2() While 1 Sleep(6000) WEnd EndFunc;==>S2 Before I got that part added it would go to the coords and click, now it's not. I can't figure out why, any ideas? EDIT: Alright I found out it's just not working now. I must be using the function wrong. =[ First, you do not have to store the @DekstopWidth, etc. macros in a variable(it's actually just a waste of memory), as they're available all the time. Second, add a sleep in your While 1 WEnd loop(so it doesn't kill the CPU). Third, what is the use for the S2 function? I don't see any use at all for it, other than somewhat awkward attempt at pausing the script. :S Forth, the start for both left and right positions(left and top) in the PixelScan is supposed to be 0 to scan the whole screen/desktop/window(depending on what pixel coord mode you've set). Link to comment Share on other sites More sharing options...
IKilledBambi Posted September 20, 2008 Author Share Posted September 20, 2008 First, you do not have to store the @DekstopWidth, etc. macros in a variable(it's actually just a waste of memory), as they're available all the time. Second, add a sleep in your While 1 WEnd loop(so it doesn't kill the CPU). Third, what is the use for the S2 function? I don't see any use at all for it, other than somewhat awkward attempt at pausing the script. :S Forth, the start for both left and right positions(left and top) in the PixelScan is supposed to be 0 to scan the whole screen/desktop/window(depending on what pixel coord mode you've set). Ah alright here's the new code I thought I edited but I might have forgotten to click accept(yea i know lol) HotKeySet("{f6}", "S1") HotKeySet("{f7}", "S2") While 1 Sleep( 100 ) WEnd Func S1() While 1 $Coord = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0xFF0000, 2, 49.8) If Not @error Then MouseClick( "Left", $Coord[0], $Coord[1], 2, 0) EndIf WEnd EndFunc ;==>S1 Func S2() While 1 Sleep(6000) WEnd EndFunc ;==>S2 The S2 is my awkward pause, thats the only way I have ever learned how to do it, is there a more resourceful way? And thanks for the sleep, much easier on my cpu. Link to comment Share on other sites More sharing options...
FreeFry Posted September 20, 2008 Share Posted September 20, 2008 I would rather use a global variable that will pause the script's main function, something like this: HotKeySet("{f6}", "_Pause") Dim $paused = True While 1 If Not $paused Then $Coord = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0xFF0000, 2, 49.8) If Not @error Then MouseClick( "Left", $Coord[0], $Coord[1], 2, 0) EndIf Sleep(1); Sleep a minimum ammount of time(to increase accuracy), while not paused. Else Sleep(100); Sleep longer when no action has to be taken. :P EndIf WEnd Func _Pause() $paused = Not $paused EndFunc Only one button to pause/unpause the script. Link to comment Share on other sites More sharing options...
IKilledBambi Posted September 20, 2008 Author Share Posted September 20, 2008 Thanks. =] I wouldn't in 9000 years thought of that lol. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 20, 2008 Moderators Share Posted September 20, 2008 Thanks. =] I wouldn't in 9000 years thought of that lol.9000 years huh? That's some learning curve >_ Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
IKilledBambi Posted September 21, 2008 Author Share Posted September 21, 2008 Haha. 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