Jump to content
Sign in to follow this  
Splitz

Help with this small program

Recommended Posts

Splitz

i have only made probally 2-3 things with autoit, so i was wondering if anyone here could help me out with this, see what i want to do is:

see in the 1st image how the life bar is full

Posted Image

now when it goes down like this

Posted Image

i want autoit to preform an action to send a mouse click or (a packet into the game to click on that area without moving my mouse there?) on this area

Posted Image

Share this post


Link to post
Share on other sites
evilelf

Read in Auto It about Pixel Search.

; Find a pure red pixel in the range 0,0-20,300
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )
If Not @error Then
    MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1])
EndIf


; Find a pure red pixel or a red pixel within 10 shades variations of pure red
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )
If Not @error Then
   Send("1") ; 1 is to heal. 
EndIf
Edited by evilelf

Share this post


Link to post
Share on other sites
onestcoder

Use your info finder tool that comes with autoit and get pixel colors and locations. Write your code with statments like

If some pixel colors are persent then do this and if they are not, do something else.

you can look up some of my code I did for FFXI to see a ton of examples.


Need a website: http://www.iconixmarketing.com

Share this post


Link to post
Share on other sites
SmOke_N

To answer your question... look at MouseClickPlus() (doesn't always work) or maybe ClickInControl() ... you'll need to search the forums for it.


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.

Share this post


Link to post
Share on other sites
Splitz

so confusing O_o

my thing looks like this but i keep getting error's

If WinActivate("Diablo II")

Then

$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )

If Not @error Then

MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1])

EndIf

$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )

If Not @error Then

Send("1") ; 1 is to heal.

EndIf

Edited by Fenix`

Share this post


Link to post
Share on other sites
mikehunt114

I think you are missing an EndIf.


IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

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  

×