Jump to content

My fish bot isn't working!


Recommended Posts

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=
Link to comment
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 *

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

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
Link to comment
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
Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...