Jump to content

Pixel Search help


Recommended Posts

Well I've been having a mega problem with my pixel bot that I've been trying to make, I've got all but two functions to work.

PixelSearch and PixelSearch (Two different occurences using pixel search differently.)

;My First Mining Bot.

$answer = MsgBox(4, "Jonneh's Bot" , "Would you like to run the bot?")

If $answer = 7 Then
    MsgBox(0, "Jonneh's Bot", "Thanks for using my bot, Bye!")
    Exit
EndIf

;=============== Function Declaration.

StartupFunc()
Sleep(500)
WinActivate("[CLASS:#32770; INSTANCE:1]");
Sleep(1000)

MinerFunc()
MsgBox(0, "Jonneh's Bot" , "Starting to Mine.")
Sleep(500)
MouseClick("Right" , 688, 529)
Sleep(500)

DropperFunc()
While @error = 0
$location = PixelSearch(780 ,22 ,994 ,372 , 0x2E4A44, 50, 1)
    MouseClick("left", $location[0], $location[1], 1, 100)
    Sleep(100)
    MouseMove(746,358)
    MouseClick("Left")
WEnd

;=============== Main Part of Code.


Func StartupFunc()
    EndFunc

Func MinerFunc()
    EndFunc

Func DropperFunc()
    EndFunc

My problem starts when it gets to Func DropperFunc() the last function it calls, It gets stuck in an endless loop just "moving" the mouse and never actually "clicking" it...

I've tried several things to find a soloution, ie:

DropperFunc()
$location = PixelSearch(780 ,22 ,994 ,372 , 0x2E4A44, 50, 1)
If Not @error Then
    MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1])
EndIf

Just to see if it finds the item and STILL it finds nothing.

On a second note, would it matter that I've got about 20 of 0x2E4A44 *Health Item* in my inventory?

Any help to fix this so that it scans my inventory properly in the co-ordinates I set and drops the items would be very helpfull.

Edited by Jonneh
Link to comment
Share on other sites

Alrighty, All i really wanted to know was how to fix my problem with PixelSearch because i cant find a soloution to it just glitching.

*Sory for wording it wrong, diddnt realise I wasnt allowed to ask in the way i did.*

Edited by Jonneh
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...