Jump to content

Pixel based bot


Recommended Posts

You said i should specify the hex color, how I do that?

As I said before this is the first time I use autoit and don't even know common commands.

I will "study" some autoit tomorrow because I have to take out my graficcard due the fan has stopped and send it back to the store and use

my motherboard graficcard instead.

And how I change this:

@DesktopWidth,@DesktopHeight

To whatever pixels I want?

[center][/center]

Link to comment
Share on other sites

What I first stated was that you should specify the hex color (as in d3mons example) as a number(0x1234567), not as a string("0x1234567").

Use the autoit window info tool, to get the position you want to scan with PixelSearch.

You could also use WinGetPos to get where a window is on the screen(in case you want to scan just the area of a window).

You should also look up on the CaretCoordMode option in autoit for more "options"(the function to look up in the helpfile is called Opt, or AutoItSetOption). muttley

Edited by FreeFry
Link to comment
Share on other sites

What I first stated was that you should specify the hex color (as in d3mons example) as a number(0x1234567), not as a string("0x1234567").

Use the autoit window info tool, to get the position you want to scan with PixelSearch.

You could also use WinGetPos to get where a window is on the screen(in case you want to scan just the area of a window).

You should also look up on the CaretCoordMode option in autoit for more "options"(the function to look up in the helpfile is called Opt, or AutoItSetOption). muttley

Well it's a game so the window take all screen on default if the script find some pixel that's because he should take pixel color on player there are anyway somewhere...youre right for hex color but i prefer put some "" for me ^^

No-life of autoit...what could be better ?LAST SCRIPTS WITH AUTO-IT : CLICK HERE
Link to comment
Share on other sites

The game is only at 800x600, I will try the things you guys said when i get back my computer.

OK so let's make script for 600x800

#include <Misc.au3> ;For _IsPressed Function
$pixelSearch=PixelSearch(0,0,@DesktopWidth,@DesktopHeight,"0xFFEE00");Search the pixelcolor => Start at 0pixel by 0pixel and finish at your DesktopWidth by DesktopHeight
;(replace $pixelcolor by your color found before)

If IsArray($pixelSearch)=1 Then;If the pixel color has been found then

;Then you have pixel Color ($pixelcolorplayer)
$pixelSearchPlayer=PixelSearch(0,0,600,800,"0xCC8888");Search the pixelcolor => Start at 0pixel by 0pixel and finish at your DesktopWidth by DesktopHeight
;(replace $pixelcolorplayer by your color found before)
EndIf

If IsArray($pixelSearchPlayer)=1 Then;If the pixel color for player has been found then
Do
$pixelSearch=PixelSearch(0,0,600,800,"0xFFEE00") ;Always check for moving of animal
$pixelSearchPlayer=PixelSearch(0,0,600,800,"0xCC8888") ;Always check for moving of player

If $pixelsearchplayer[0]>$pixelsearch[0] Then;If the animal is on left by the player then
Do
Send("{LEFT}")
Until $pixelsearchplayer[0]=$pixelsearch[0]+50;When the player is near animal by 50pixel
Send("{LCTRL}")
EndIf

If $pixelsearchplayer[0]<$pixelsearch[0] Then;If the animal is on right by the player then
Do
Send("{RIGHT}")
Until $pixelsearchplayer[0]=$pixelsearch[0]-50;When the player is near animal by -50pixel
Send("{RCTRL}")
EndIf
Until _IsPressed("11"); CTRL key has been pressed by script
EndIf
No-life of autoit...what could be better ?LAST SCRIPTS WITH AUTO-IT : CLICK HERE
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...