can anyone help to make this auto potion?

07/08/2011 22:04 shfdkqhwk#1
[Only registered and activated users can see links. Click Here To Register...]

I tired to make this AutoIT. But unfortunately I was failed to make this.

Can any one help me to make this?

Function

1. If HP, MP, or SP are downed under specific percentage, Insert Specific Key.

2. Key : F1(HP), F2(MP), F3(SP)

Please help me. Hope to get wonderful thing.

please leave your comments or AutoIT code.
07/09/2011 13:30 Ludder231#2
Simple functions would be:

PHP Code:
send("{F1}"
or
PHP Code:
ControlSend("Windowname""""""{F1}"
07/09/2011 15:33 shfdkqhwk#3
Thank you for replying.

But I really wonder if that needs some color code, how do I do that?

For example, specific percentage means the color is different by specific point.

The message you left doesn't exist any color code for regconizing difference.

Could you let me know that, too?
07/09/2011 17:19 Reeek#4
If I were you, I'd work with memory values... If you don't know how to, use PixelGetColor
07/09/2011 17:19 Ludder231#5
Sorry but im from Germany so my english isn't very well :D

You mean, how i post my code in this color?
Do that: write ["php"](without the "") in front of your code you want to color then write ["/php"](without the "") behind your code.

Example for your Bot:
PHP Code:
msgbox(0"Start""Click OK and Bot will drink Potions")

while 
1
winwaitactive
("Windowname")
send("{F1}")
sleep(2000)
send("{F2}")
sleep(2000)
send("{F3}")
wend 
07/09/2011 17:22 Ludder231#6
Quote:
Originally Posted by Reeek View Post
If I were you, I'd work with memory values... If you don't know how to, use PixelGetColor
Ich glaube nicht das er weiß wie man mit beiden genannten Sachen umgeht :)
07/09/2011 18:48 shfdkqhwk#7
Thank you, Ludder231.

Unfortunately, I already knew code for pushing button.

What I want to know is code for using potion by the color and each position.

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

(1) If HP downed like this, Key"F1" is pushed automatically.

or

(2) If HP doesn't, Key"F1" isn't activated.
07/09/2011 19:02 Ludder231#8
[Only registered and activated users can see links. Click Here To Register...]
07/10/2011 04:03 =Warmonger=#9
You should look more into memory hacking.

PHP Code:
Func _AutoHP() 
    ;~ 
Get HP Key From Ini File
    $HPP_KEY 
IniRead('AutoBot.ini''KEYS''HPP_KEY'0)
    ;~ 
Get Title Of Game Client
    $TITLE 
WinGetTitle('[CLASS:Nksp]')
    ;~ 
Read Current HP And Max HP Memory
    $PROCESS 
ProcessExists('Nksp.exe')
    ;~ 
Get Handle
    $HANDLE 
_MemoryOpen($PROCESS)
    ;~ 
Begin Function While Loop
    
While 1
        
;~ Pull Max HP And Current HP From Memory
        $POINTER 
_MemoryRead(0x106B0D80$HANDLE)
        
$MAX_HP _MemoryRead($POINTER 0x109464$HANDLE)
        
$CURRENT_HP _MemoryRead($POINTER 0x109460$HANDLE)
        ;~ 
Check If HP Is Below 50Then Autopot
        
If $CURRENT_HP $MAX_HP/2 Then
            ControlSend
($TITLE'''ViewPort Window1''{' $HPP_KEY '}')
            ;~ 
Let Pot Heal 15 Seconds
            Sleep
(15000)
        EndIf
    ;~ 
Check If Bot Closed Then Exit
    If 
ProcessExists($gi_CoProcParent) = 0 Then Exit
    ;~ Function 
Idle
    Sleep
(100)
    
WEnd
EndFunc 
You should take a look at NomadMemory.au3