Sign in to follow this  
Followers 0
BuddyBoy

A quick 1 min question about pixelsearch.

37 posts in this topic

Ok im stuck on this...

PixelSearch ( left, top, right, bottom, color [, shade-variation] [, step]] )

How do i find the exact left,top,right,bottom of the part i want on the screen... I tried the window autoit help thing that gives you alot of information and i found x,y,h,w but its just the WHOLE screen its looking at, i just want mine for this tiny box on my screen... But the windowhelp thing for autoit wont read the box, idk why so is there any other way to figure it out?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Do you know where the box is one your screen, if you do then pixel search in only that area. What is this bo, is it a window, a picture, a button...?

What program generates "the box"?

Answer those questions and then itll prob be much easier to help you. :D

EDIT: Typo

Edited by Don N

_____________________________________________________"some people live for the rules, I live for exceptions"Wallpaper Changer - Easily Change Your Windows Wallpaper

Share this post


Link to post
Share on other sites

Yes the box is on my game therefore it is a picture more. It takes up about 2/5 of the screen on the left side but dont touch the bottom of screen and stuff but that wont matter, i jsut needa know how to find the coords of the box because i dont even know where to start :D

Share this post


Link to post
Share on other sites

Yes the box is on my game therefore it is a picture more. It takes up about 2/5 of the screen on the left side but dont touch the bottom of screen and stuff but that wont matter, i jsut needa know how to find the coords of the box because i dont even know where to start :D

Use the AutoIt Window Info Tool. Position mouse at top left of box and read mouse position the repeat for bottom right and you will then have your co-ordinates.


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

But it says here..

PixelSearch ( left, top, right, bottom, color [, shade-variation] [, step]] )

not top left and bottom right... ? On the autoit help it says the computer reads the box top to bottom, left to right... so you sure thats how it works?

Share this post


Link to post
Share on other sites

Ekk that looks confusing, i wouldnt know how to put it into my online game lol. Looks like some nice work tho man. Valu any idea on how to get the coords of a rectangle on a picture on my game?

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

try this... it will get the color for you too...

just read the first few lines on

HOW TO USE IT

http://www.autoitscript.com/forum/index.ph...6789&hl=Script#

8)

I might use this to find the things but my trouble is this. When i mine an pre on my game its gray like the mine floor. So in my inventory is a rectangle shape so if i have it to just look at the rectangle area and search for the ore to drop it it will pick up the mine floor colors because it is jsut searching my inventory, any suggestion valu?

Any suggestion anyone?

Edited by BuddyBoy

Share this post


Link to post
Share on other sites

Whats the name of the game

RuneScape???

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Says i got error on function call on

While 1

$pixelsearch = Pixelsearch( 775, 24, 553, 313, @Desktopwidth, @DesktopHeight, "0xBDBABD", 1, 38) ^ ERROR HERE!!!! Incorect number of parameters

If @error <> 1 then

MouseClick("left", $pixelsearch[0], $pixelsearch[1] )

MouseClick("left", 657, 276)

EndIf

Share this post


Link to post
Share on other sites

Whats the name of the game

RuneScape???

8)

No Conquer :D Its about 20 times better than runescape :D

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

#include <GuiConstants.au3>

Opt("GUIOnEventMode",1)

HotKeySet("{F5}", "_Start")

HotKeySet("{F7}", "_NoClick")

HotKeySet("{ESC}","Terminate")

HotKeySet("^g", "_GetPos")

$ClickIt = 0

GUICreate("CO-MacroBot", 400, 300)

GUISetOnEvent($GUI_EVENT_CLOSE,"Terminate")

$Checkbox_1 = GUICtrlCreateCheckbox("Auto-Follow", 20, 40, 150, 20)

$Checkbox_2 = GUICtrlCreateCheckbox("Move-Miner", 20, 80, 150, 20)

$Checkbox_3 = GUICtrlCreateCheckbox("Fire circle lvler", 20, 120, 150, 20)

$Checkbox_4 = GUICtrlCreateCheckbox("Right-clicker", 20, 160, 150, 20)

$Checkbox_5 = GUICtrlCreateCheckbox("Left-clicker", 20, 200, 150, 20)

$Checkbox_6 = GUICtrlCreateCheckbox("Sit, Then Meditate", 20, 240, 200, 20)

$Checkbox_7 = GUICtrlCreateCheckbox("Auto-Reconnector", 180, 40, 300, 20)

$Checkbox_8 = GUICtrlCreateCheckbox("Ctrl Down", 180, 80, 300, 20)

$Checkbox_9 = GUICtrlCreateCheckbox("Press CTRL+g For coordinates", 180, 120, 300, 20)

$Checkbox_10 = GUICtrlCreateCheckbox("Aimbot right clicker for monsters only", 180, 160, 300, 20)

$Checkbox_11 = GUICtrlCreateCheckbox("Aimbot right clicke", 180, 200, 300, 20)

GUISetState()

While 1

Sleep( 10 )

WEnd

Exit

Func _Start ()

$ClickIt = 1

While $ClickIt = 1

If BitAND(GUICtrlRead($Checkbox_1), $GUI_CHECKED) = $GUI_CHECKED Then

While 1

MouseClick("left", 459, 79)

WEnd

EndIf

If BitAND(GUICtrlRead($Checkbox_2), $GUI_CHECKED) = $GUI_CHECKED Then

MouseClick("left", 429, 443)

MouseClick("right", 503, 330)

Sleep(120000)

EndIf

If BitAND(GUICtrlRead($Checkbox_3), $GUI_CHECKED) = $GUI_CHECKED Then

MouseClick("right", 503, 330)

Sleep(4500)

EndIf

If BitAND(GUICtrlRead($Checkbox_4), $GUI_CHECKED) = $GUI_CHECKED Then

MouseClick("right")

EndIf

If BitAND(GUICtrlRead($Checkbox_5), $GUI_CHECKED) = $GUI_CHECKED Then

MouseClick("left")

EndIf

If BitAND(GUICtrlRead($Checkbox_6), $GUI_CHECKED) = $GUI_CHECKED Then

While 1

MouseClick("right", 111, 748, 20)

Sleep(10500)

MouseClick("right", 235, 749, 1)

Sleep(3500)

WEnd

EndIf

If BitAND(GUICtrlRead($Checkbox_7), $GUI_CHECKED) = $GUI_CHECKED Then

While 1

WinWaitActive("Instruction")

WinClose("Instruction")

Sleep(360000)

MouseClick("left", 943, 670, 1)

Sleep(8000)

MouseClick("right")

WEnd

EndIf

If BitAND(GUICtrlRead($Checkbox_8), $GUI_CHECKED) = $GUI_CHECKED Then

While 1

Send('{CTRLDOWN}')

WEnd

EndIf

If BitAND(GUICtrlRead($Checkbox_9), $GUI_CHECKED) = $GUI_CHECKED Then

If BitAND(GUICtrlRead($Checkbox_7), $GUI_CHECKED) = $GUI_CHECKED Then

_GetPos ()

While 1

Sleep(10000)

WEnd

EndIf

EndIf

If BitAND(GUICtrlRead($Checkbox_10), $GUI_CHECKED) = $GUI_CHECKED Then

While 1

$pixelsearch = Pixelsearch(0, 0, @Desktopwidth, @DesktopHeight, "0xB50400", 1, 38)

If @error <> 1 then

MouseClick("right", $pixelsearch[0], $pixelsearch[1] )

Endif

Wend

EndIf

If BitAND(GUICtrlRead($Checkbox_11), $GUI_CHECKED) = $GUI_CHECKED Then

While 1

$pixelsearch = Pixelsearch( 775, 24, 553, 313, @Desktopwidth, @DesktopHeight, "0xBDBABD", 1, 38)

If @error <> 1 then

MouseClick("left", $pixelsearch[0], $pixelsearch[1] )

MouseClick("left", 657, 276)

EndIf

WEnd

EndIf

WEnd

EndFunc ;==>_Start

Func _GetPos ()

Local $pos = MouseGetPos()

MsgBox(0,'',$pos[0] & "<---X Coord | Y Coord --->" & $pos[1])

EndFunc ;==>_GetPos

Func _NoClick ()

ToolTip("")

$ClickIt = 0

EndFunc ;==>_NoClick

Func Terminate ()

Exit

EndFunc ;==>Terminate

Alright valuater said i should probably post my script here... So there it is i need help on checkbox 11 I just cant figure out how to do the rectangle thing on my inventory on my game... Can anyone help me?

If soemone can help but needs screeny ill be glad to get one

Edited by BuddyBoy

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

yes... please post a pic

and use ( on the above post )

[ code] ; no space

; paste script

[ /code] ; no space

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

Dim $xTopLeft = 553, $yTopLeft = 24, $xBottomRight = 775, $yBottomRight = 313
Dim $iColor = 0xBDBABD, $iShades = 1, $iStep = 38
$pixelsearch = Pixelsearch($xTopLeft, $yTopLeft, $xBottomRight, $yBottomRight, $iColor, $iShades, $iStep)

Ok, the "Starting Point" to search would be $xTopLeft/$yTopLeft and the "Ending Point" would be $xBottomRight/$yBottomRight, this conforms a rectangel of some sort when you go from Right/down/left/up. $iShades is the different shades (you chose 1 so it will only look for for 1 shade difference) for an "exact match it would be 0". $iStep is the amount of Pixels it will skip to find the color... 38 seems a tad bit extreme IMHO (In My Humble Opinion).

Hope the helps.

Edited by SmOke_N

[center]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.[/center]

Share this post


Link to post
Share on other sites

1 min smoke n ill try it out, then will edit to see if it works or not, thx... 1 min tho...

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

Here you go, I made this so you can get an idea of what area you would be searching. Save this to a seperate .au3 file by itself and run it... and you will see what areas you will be searching and how it looks:

Dim $xTopLeft = 553, $yTopLeft = 24, $xBottomRight = 775, $yBottomRight = 313

For $xMove1 = $xTopLeft To $xBottomRight
    MouseMove($xMove1, $yTopLeft, 1)
Next
For $yMove1 = $yTopLeft To $yBottomRight
    MouseMove($xBottomRight, $yMove1, 1)
Next
For $xMove2 = $xBottomRight To $xTopLeft Step - 1
    MouseMove($xMove2, $yBottomRight, 1)
Next
For $yMove2 = $yBottomRight To $yTopLeft Step - 1
    MouseMove($xTopLeft, $yMove2, 1)
Next
You will also, with PixelSearches need to from time to time play with PixelCoordMode() 0,1,2 - to test those areas out you would use MouseCoordMode() 0,1,2 perspectively on this example.

Edit:

Grammar is not my strong point lol.

Edited by SmOke_N

[center]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.[/center]

Share this post


Link to post
Share on other sites

I forgot i can type so i said little bit by writing it lol, read the text tho.

Posted Image

Share this post


Link to post
Share on other sites

Here you go, I made this so you can get an idea of what area you would be searching. Save this to a seperate .au3 file by itself and run it... and you will see what areas you will be searching and how it looks:

Dim $xTopLeft = 553, $yTopLeft = 24, $xBottomRight = 775, $yBottomRight = 313

For $xMove1 = $xTopLeft To $xBottomRight
    MouseMove($xMove1, $yTopLeft, 1)
Next
For $yMove1 = $yTopLeft To $yBottomRight
    MouseMove($xBottomRight, $yMove1, 1)
Next
For $xMove2 = $xBottomRight To $xTopLeft Step - 1
    MouseMove($xMove2, $yBottomRight, 1)
Next
For $yMove2 = $yBottomRight To $yTopLeft Step - 1
    MouseMove($xTopLeft, $yMove2, 1)
Next
You will also, with PixelSearches need to from time to time play with PixelCoordMode() 0,1,2 - to test those areas out you would use MouseCoordMode() 0,1,2 perspectively on this example.

Edit:

Grammar is not my strong point lol.

Ok thats not what i wanted, as you can see in my screeny lol. How can i find out the size of that box on that screeny you can see..?

Share this post


Link to post
Share on other sites

There are 40 boxes there, and from your pic you want to read all 40 and it looks like you want to be able to tell what each one of those items are.

In that case you would need a For / Next loop and do a PixelCheckSum() all 40 times (1 to 40) with the different x,y,x,y coords... but you would have to use the AutoInfo Tool to get the exact location of each x and y for top and bottom for each box, then you would have to do your homework and get a definition of each item for the checksum it returned.

It's a pain, but it's work you'll have to do.


[center]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.[/center]

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