[AutoIt] Get current HP

05/18/2009 06:40 clintonselke#1
Okay.

As per requested by Mr swords, here is a AutoIt function for getting the current HP of a player. I wiped this one up real quick, so its not that neat :p
05/18/2009 07:14 griswald#2
very nice
~griswald
05/18/2009 11:13 ace_heart#3
can use it make auto pot hp fast, i use another by PixelSearch in AHK but result not good my account die in war, can help me
05/19/2009 00:03 swords#4
Awesomeeeeeeeeeeeeee


Thanks a bunch... Gonna try whipping up a bot fast to auto-pot. Half credit will go to you though! xD


EDIT:


I tried it out.

What I did was #include your file through my code... But an error keeps coming up, and I honestly can't understand your code (too complex xD)... And it points to Line 1 saying:


Quote:
Global Const $PAGE_EXECUTE_READWRITE = 0x40
^
Error: Can not redeclare a constant.
(Which makes me think it'll do it for all your Globals :S)


Maybe its something simple and I'm looking too hard for the solution... I really don't want to copy and paste allllll my code into your file and make it work that way... Would be too much of a hassle. I was hoping to just use an #include with just your Function (no While loop or ToolTip)...


Thanks :(
05/19/2009 00:48 ookamocka#5
Quote:
Originally Posted by swords View Post
Awesomeeeeeeeeeeeeee


Thanks a bunch... Gonna try whipping up a bot fast to auto-pot. Half credit will go to you though! xD


EDIT:


I tried it out.

What I did was #include your file through my code... But an error keeps coming up, and I honestly can't understand your code (too complex xD)... And it points to Line 1 saying:




(Which makes me think it'll do it for all your Globals :S)


Maybe its something simple and I'm looking too hard for the solution... I really don't want to copy and paste allllll my code into your file and make it work that way... Would be too much of a hassle. I was hoping to just use an #include with just your Function (no While loop or ToolTip)...


Thanks :(
thats a simple one, don't "redeclare" the constant in your au3 file... Global means... well... "Global" lol
05/19/2009 01:30 swords#6
Quote:
Originally Posted by ookamocka View Post
thats a simple one, don't "redeclare" the constant in your au3 file... Global means... well... "Global" lol
I thought of this... But then it wouldn't be in the Global scope... It would just be... well... a variable.

So when his get-hp function tries calling that variable it won't be able to because that variable isn't declared inside that Func...... right? :S
05/19/2009 01:39 ookamocka#7
Quote:
Originally Posted by swords View Post
I thought of this... But then it wouldn't be in the Global scope... It would just be... well... a variable.

So when his get-hp function tries calling that variable it won't be able to because that variable isn't declared inside that Func...... right? :S
what i mean is (i haven't check yet but) if he already claimed the Global constant in his au3 file, don't claim it again in urs, else ur "redeclaring" it as the error states
05/19/2009 01:47 swords#8
Quote:
Originally Posted by ookamocka View Post
what i mean is (i haven't check yet but) if he already claimed the Global constant in his au3 file, don't claim it again in urs, else ur "redeclaring" it as the error states
Nope... I already tried 2 different ways....


1. I left his Global variables in his script and used my #include (so it should grab those variables anyways)

2. I put his varialbes in my script, and deleted his.


Neither worked :S
05/19/2009 04:49 clintonselke#9
Quote:
Originally Posted by swords View Post
Awesomeeeeeeeeeeeeee


Thanks a bunch... Gonna try whipping up a bot fast to auto-pot. Half credit will go to you though! xD


EDIT:


I tried it out.

What I did was #include your file through my code... But an error keeps coming up, and I honestly can't understand your code (too complex xD)... And it points to Line 1 saying:




(Which makes me think it'll do it for all your Globals :S)


Maybe its something simple and I'm looking too hard for the solution... I really don't want to copy and paste allllll my code into your file and make it work that way... Would be too much of a hassle. I was hoping to just use an #include with just your Function (no While loop or ToolTip)...


Thanks :(
Its already defined in one of the header files... just delete that line and it will work
05/19/2009 19:14 swords#10
Quote:
Originally Posted by clintonselke View Post
Its already defined in one of the header files... just delete that line and it will work
So delete JUST that line... Or all the Global variables?
05/19/2009 21:24 swords#11
ooka or clinton... (I ask you ooka cause you said you made a background leveling bot... So maybe you had some idea on how to do it :P)

Never used ControlClick before or ControlSend...

But I guess you can't send the F keys through ControlSend in AutoIt?... Is this true?


My 2nd method of doing it was to ControlClick on the F keys on conquer to use the pots... Well how do I achieve the controlid?

Autoit Help file states:

ControlClick ( "title", "text", controlID [, button [, clicks [, x [, y ]]]] )

Well I can fill in all of those (leave text blank)... EXCEPT for the controlID position...

Do you have any idea how to

1. ControlSend F keys to Conquer

2. ControlClick on the F keys on Conquer


Thanks ><



P.S. - Btw clinton I got the auto-potter to work with your code. The #include file is working correctly now and it is potting accordingly... As well as using boxes, etc. I just need to get those 2 problems (or just 1) solved so I can make it completely background auto-potting :D.
05/20/2009 07:09 ookamocka#12
Quote:
Originally Posted by swords View Post
ooka or clinton... (I ask you ooka cause you said you made a background leveling bot... So maybe you had some idea on how to do it :P)

Never used ControlClick before or ControlSend...

But I guess you can't send the F keys through ControlSend in AutoIt?... Is this true?


My 2nd method of doing it was to ControlClick on the F keys on conquer to use the pots... Well how do I achieve the controlid?
Autoit Help file states:

ControlClick ( "title", "text", controlID [, button [, clicks [, x [, y ]]]] )

Well I can fill in all of those (leave text blank)... EXCEPT for the controlID position...

Do you have any idea how to

1. ControlSend F keys to Conquer

2. ControlClick on the F keys on Conquer


Thanks ><



P.S. - Btw clinton I got the auto-potter to work with your code. The #include file is working correctly now and it is potting accordingly... As well as using boxes, etc. I just need to get those 2 problems (or just 1) solved so I can make it completely background auto-potting :D.
for pressing F-keys in the background... look at clint's other thread...

[Only registered and activated users can see links. Click Here To Register...]

i haven't tested it, but i know it works since thats what he used :p... and as far as i can remember, u can't send keyboard clicks in the background, only foreground... that is if your going to use autoit to send clicks and not do it through memory... and i think ControlClick is for the mouse only which will work in the background for CO, but left click will send u to click jail... not sure how to do a keyboard press w/ autoit, i litterally just started using autoit maybe 2 weeks ago :p ne other language i've worked with i'd be able to tell u ;) but again as i said, it won't work in the background...

EDIT: i found the function u need... [Only registered and activated users can see links. Click Here To Register...] that one, though as i've said, it won't work in the background, i haven't tested it though :p

so for a simple example it'd be...


Code:
While 1
[color=white].....[/color]If $health < 400 Then
[color=white].....[/color][color=white].....[/color]Send("{F1}")
[color=white].....[/color]EndIf
[color=white].....[/color]Sleep(200)
WEnd
05/20/2009 07:38 swords#13
Quote:
Originally Posted by ookamocka View Post
for pressing F-keys in the background... look at clint's other thread...

[Only registered and activated users can see links. Click Here To Register...]

i haven't tested it, but i know it works since thats what he used :p... and as far as i can remember, u can't send keyboard clicks in the background, only foreground... that is if your going to use autoit to send clicks and not do it through memory... and i think ControlClick is for the mouse only which will work in the background for CO, but left click will send u to click jail... not sure how to do a keyboard press w/ autoit, i litterally just started using autoit maybe 2 weeks ago :p ne other language i've worked with i'd be able to tell u ;) but again as i said, it won't work in the background...

EDIT: i found the function u need... [Only registered and activated users can see links. Click Here To Register...] that one, though as i've said, it won't work in the background, i haven't tested it though :p

so for a simple example it'd be...


Code:
While 1
[color=white].....[/color]If $health < 400 Then
[color=white].....[/color][color=white].....[/color]Send("{F1}")
[color=white].....[/color]EndIf
[color=white].....[/color]Sleep(200)
WEnd
no no no xD...

Of course I know send... I actually just released my auto-potter with Exact hp input (Gotta wait for approval)... ControlSend supposably doesn't work, but some people still claim it works for them.... I need some assistance on the ControlClick ControlID so I can at least use that if the controlSend don't work.
05/20/2009 12:28 clintonselke#14
Windows API for triggering keypresses only does the work keyboard side (as if u just pressed the keys).. It will send keys ONLY TO FOCUSED windows.

What ControlSend() does is first try to give the window focus (bring it to the top), then perform a normal Send()

What i did for my bot was... no actually press trigger F-key presses... only found the could that gets executed when u do press F-keys and made my own function for it.

I'm bit busy, but u can translate my c++ f-key version into AutoIt xD

Good Luck :D

[Only registered and activated users can see links. Click Here To Register...]
05/21/2009 00:16 Azothoras#15
Quote:
Originally Posted by swords View Post
ooka or clinton... (I ask you ooka cause you said you made a background leveling bot... So maybe you had some idea on how to do it :P)

Never used ControlClick before or ControlSend...

But I guess you can't send the F keys through ControlSend in AutoIt?... Is this true?


My 2nd method of doing it was to ControlClick on the F keys on conquer to use the pots... Well how do I achieve the controlid?

Autoit Help file states:

ControlClick ( "title", "text", controlID [, button [, clicks [, x [, y ]]]] )

Well I can fill in all of those (leave text blank)... EXCEPT for the controlID position...

Do you have any idea how to

1. ControlSend F keys to Conquer

2. ControlClick on the F keys on Conquer


Thanks ><



P.S. - Btw clinton I got the auto-potter to work with your code. The #include file is working correctly now and it is potting accordingly... As well as using boxes, etc. I just need to get those 2 problems (or just 1) solved so I can make it completely background auto-potting :D.
Use the auto it window info tool... It will display the ControlID for the F-Row