=sinister= Posted October 24, 2005 Posted October 24, 2005 (edited) I created a test for my fishbot for WoW and its not working! I can't figure out why! I was testing it, trying to get it to click every 50 x cordinates and then go down 50 Y cordinates and click the x cordinates 5 times again if there is a certain color at X:0 and Y:0. Please help! $x = "0" $y = "0" $i = "0" $colour="035EE9" while $i <=5 If PixelGetColor($x,$y) >= $colour then Send("{LSHIFT DOWN}") MouseClick("right", $x, $y, 1) Send("{LSHIFT UP}") endif $i = $i + 1 $x = $x + 50 Wend $y = $y + 50 while $i <=5 If PixelGetColor($x,$y) >= $colour then Send("{LSHIFT DOWN}") MouseClick("right", $x, $y, 1) Send("{LSHIFT UP}") endif $i = $i + 1 $x = $x + 50 Wend $y = $y + 50 ;and the rest of the script Edited October 24, 2005 by =sinister=
/dev/null Posted October 24, 2005 Posted October 24, 2005 search the forums for: +fishbot +wow. You'll find some working Wow fishbots there.... Cheers Kurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *
Moderators SmOke_N Posted October 24, 2005 Moderators Posted October 24, 2005 (edited) Might want to check your $colour settings... don't know if this helps, but at least you'll have another perspective. Opt("PixelCoordMode", 2); use 0 if you're using window coords, or 1 for screen Dim, $x , $y , $i $colour = "0x035EE9" While 1 Do If PixelGetColor($x,$y) >= $colour Then Send("{LSHIFT DOWN}") MouseClick("right", $x, $y, 1) Send("{LSHIFT UP}") endif $i = $i + 1 $x = $x + 50 Until $i >= 6 $y = $y + 50 $i = 0 Do If PixelGetColor($x,$y) >= $colour Then Send("{LSHIFT DOWN}") MouseClick("right", $x, $y, 1) Send("{LSHIFT UP}") endif $i = $i + 1 $x = $x + 50 Until $i >= 6 $y = $y + 50 $i = 0 ;rest of script WEnd Edit: Made a Boo Boo, forgot to reset $i Edited October 24, 2005 by ronsrules 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.
LxP Posted October 24, 2005 Posted October 24, 2005 (edited) This line won't work correctly:If PixelGetColor($x,$y) >= $colour thenDoing a 'greater than or equal to' comparison between two colours will generally not give the desired result.Example: The colour specified by 0x010000 is a red so dark that it would be mistaken for black. 0x00FF00 specifies an intensely bright green. AutoIt will (rightly) deem the dark red as 'greater than' the bright green because mathematically this is indeed the case (just looking at the numbers verifies this).I strongly suggest changing the comparison from >= (which will very often give the incorrect result) to =. If you would like to determine whether a pixel matches a shade of colours then try PixelSearch() with a one-pixel search area and a specified shade variation.Edit: In addition to what I have mentioned, you are comparing the output of PixelGetColor() (an integer) with a string. You should change the following line (although Ron has mentioned this):; was $colour="035EE9" $Colour = 0x035EE9 Edited October 24, 2005 by LxP
=sinister= Posted October 24, 2005 Author Posted October 24, 2005 hmm, i looked back at the fishbot and made a few changes and it's still not working. Take a look at this- (note: the XY axis has changed) $x = "797" $y = "658" $i = "0" $Colour = 0xFFFFFF while $i <=5 If PixelGetColor($x,$y) = $colour then Send("{LSHIFT DOWN}") MouseClick("right", $x, $y, 1) Send("{LSHIFT UP}") endif $i = $i + 1 $x = $x + 50 Wend $y = $y + 50 while $i <=5 If PixelGetColor($x,$y) = $colour then Send("{LSHIFT DOWN}") MouseClick("right", $x, $y, 1) Send("{LSHIFT UP}") endif $i = $i + 1 $x = $x + 50 Wend $y = $y + 50 ;and the rest of the script
Moderators SmOke_N Posted October 24, 2005 Moderators Posted October 24, 2005 Have you tried debugging? Your Way: $i = "0" While $i <= "5" $i = $i + 1 If $i = "5" Then MsgBox(0, "First Loop Ending", "The first loop is ending") EndIf WEnd While $i <= "5" $i = $i + 1 If $i = "5" Then MsgBox(0, "Second Loop Ending", "The second loop is ending") EndIf WEnd Or, If you had looked at mine at all: $i = "0" While $i <= "5" $i = $i + 1 If $i = "5" Then MsgBox(0, "First Loop Ending", "The first loop is ending") EndIf WEnd $i = "0" While $i <= "5" $i = $i + 1 If $i = "5" Then MsgBox(0, "Second Loop Ending", "The second loop is ending") EndIf WEnd As per my "edit" from yesterday... you have to reset $i value 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.
LxP Posted October 24, 2005 Posted October 24, 2005 And of course you could always use a For loop -- this is precisely what they're For.
sshrum Posted October 24, 2005 Posted October 24, 2005 Well you know what they say when the fish aren't working. Maybe your using the wrong de-bug...have you tried de-worm? Sorry...couldn't resist. I add nothing. Sean Shrum :: http://www.shrum.net All my published AU3-based apps and utilities 'Make it idiot-proof, and someone will make a better idiot'
Moderators SmOke_N Posted October 25, 2005 Moderators Posted October 25, 2005 lol... I like that sshrum... When the fish aren't biting... de-bug is wrong try de-worm!! 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.
=sinister= Posted October 25, 2005 Author Posted October 25, 2005 I searched the forums, can't find anything working. hmm... I guess I should google it.
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