Jump to content

Loop/Sleep


Recommended Posts

Is there anyway i can get the coordiantes of a small square in the top left corner of the map so i can use it for the pixel search health so that when the red health goes past that and changes to white that means something has changed and sends f8 using the AU3info.exe just gives me how big the main window is but i want a small location

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;Pixel Search for Health

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Wait until something changes in the region 0,0 to 50,50

; Get initial checksum

$checksum = PixelChecksum(0,0, 50,50)

; Wait for the region to change, the region is checked every 100ms to reduce CPU load

While $checksum = PixelChecksum(0,0, 50, 50)

Sleep(300)

WEnd

Send("{f8}")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;Pixel Search for Monster

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

While 1

$Coord = PixelSearch ( 0, 0, 500, 500, 0x32331E [, 5] [, 2]] )

If Not @error Then

MouseClick ( "Left" , $Coord[0], $Coord[1] , 2 , 10 )

EndIf

Wend

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;Get Monster Health/Then Pickup

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Wait until something changes in the region 0,0 to 50,50

; Get initial checksum

$checksum = PixelChecksum(0,0, 50,50)

; Wait for the region to change, the region is checked every 100ms to reduce CPU load

While $checksum = PixelChecksum(0,0, 50, 50)

Sleep(300)

WEnd

Send("{f2}")

Edited by thatsgreat2345
Link to comment
Share on other sites

monsters top left of my square was 40, 80 bottom was 116, 130 where i want to end my search.

so my search range relatively small would be

$Coord = PixelSearch ( 40, 80, 116, 113, 0x32331E [, 5] [, 2]] )

Right? er except the pixel will be different

Edited by Seagul
Link to comment
Share on other sites

ok blindley i will try... i imagine you are going to add this to the originasl script...ok

in the "while 1" statement that you already have... ad this

$coord = PixelSearch( 140, 145, 55, 65, 0xEE8785, 5, 2 )
If Not @error Then
    call("Get_Health")
EndIf

at the bottom of your script.... ad this

Func Get_Health()
   
for $gh = 1 to 6
Send("{f2}")
  sleep(500)
next

EndFunc

this way you search in the "While 1" loop and when you find the color(not sure if you sent the color you wanted) then you call the function to get more health

understand??

8)

NEWHeader1.png

Link to comment
Share on other sites

about the whole finding a monster thing how can i limit the search since there is yellow on the bottom of the screen in the hotkey bar so how can i make it only search part of the screen and i removed the last part so its only the first 2 parts and o yeah to make the program start can i use the thing that you put in my skill bot

HotKeySet("{Home}", "ShowMe")

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

Link to comment
Share on other sites

Like that? wait that script was for the monster attacker??

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;Pixel Search for Monster

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

While 1

$Coord = PixelSearch ( 0, 0, 500, 500, 0xFFFFA0 [, 5] [, 2]] )

If Not @error Then

MouseClick ( "Left" , $Coord[0], $Coord[1] , 2 , 0 )

sleep(12000)

Send("{f2}")

sleep(500)

send("{f2}")

sleep(500)

Send("{f2}")

sleep(500)

Send("{f2}")

sleep(500)

EndIf

Wend

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;Pixel Search for Health

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

$coord = PixelSearch( 140, 145, 55, 65, 0xEE8785, 5, 2 )

If Not @error Then

call("Get_Health")

EndIf

Func Get_Health()

for $gh = 1 to 6

Send("{f2}")

sleep(500)

next

EndFunc

Edited by thatsgreat2345
Link to comment
Share on other sites

First

I am not a professional... lol

second

my script needs to be

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

thus, it should have been

$coord = PixelSearch( 140, 55, 145, 65, 0xEE8785, 5, 2 )

sorry

third

post your script with these ( no spaces )

[ code ]

paste your script here

[ / code ]

fourth

try to be clear.. one question at a time... dont confuse health with monsters in your questions

OK

LETS START A "NEW POST" (so i dont get more lost) AND REMEMBER THESE $ POINTS...

8)

start a new post... leave this one alone

NEWHeader1.png

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...