Sign in to follow this  
Followers 0
=sinister=

My fish bot isn't working!

10 posts in this topic

#1 ·  Posted (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 by =sinister=

Share this post


Link to post
Share on other sites



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 *

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 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.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

This line won't work correctly:

If PixelGetColor($x,$y) >= $colour then

Doing 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 by LxP

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

And of course you could always use a For loop -- this is precisely what they're For.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

I searched the forums, can't find anything working. hmm... I guess I should google it.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0