The following application will recognize the highest apothecary pot in your inventory and use it when appropriate ( defined in config.ini, in % ); you can kill the application by pressing {End} and/or in the tray bar.
I wrote this for my upcoming API, but thought it might be useful to release.
Bug reports and suggestions are appreciated.
Source
AV results ( [Only registered and activated users can see links. Click Here To Register...] )
I wrote this for my upcoming API, but thought it might be useful to release.
Bug reports and suggestions are appreciated.
Source
Code:
#RequireAdmin
#include "globals.au3"
HotKeySet("{END}", "__Terminate")
Global Const $HP_PERCENT = IniRead("config.ini", "AutoPot", "HP", 0)
Global Const $MP_PERCENT = IniRead("config.ini", "AutoPot", "MP", 0)
Global $HP_TIMER = TimerInit()
Global $MP_TIMER = TimerInit()
While 1
If _Char_HP_Percentage() <= $HP_PERCENT And TimerDiff($HP_TIMER) >= 15000 Then
_Use_Potion(1)
$HP_TIMER = TimerInit()
EndIf
If _Char_MP_Percentage() <= $MP_PERCENT And TimerDiff($MP_TIMER) >= 15000 Then
_Use_Potion(2)
$MP_TIMER = TimerInit()
EndIf
Sleep(25)
WEnd
Func _Use_Potion($POTION_TYPE)
Local $POTION_LEVEL = -1
Local $POTION_INDEX = -1
Local $i
For $i = 0 To _Inventory_Get_Count()
If _Inventory_Get_Type($i) == 9 Then
If _Inventory_Get_Level($i) <= _Char_Get_Level() And _Inventory_Get_Level($i) >= $POTION_LEVEL And _Get_Potion_Type(_Inventory_Get_Type_ID($i)) == $POTION_TYPE Then
$POTION_LEVEL = _Inventory_Get_Level($i)
$POTION_INDEX = $i
EndIf
EndIf
Next
If $POTION_INDEX <> -1 And $POTION_LEVEL <> -1 Then
_Use_Item($POTION_INDEX, _Inventory_Get_Type_ID($POTION_INDEX))
EndIf
EndFunc ;==>_Use_Potion
Func _Get_Potion_Type($POTION_TYPE_ID)
; ===============================================
; Return values
;
; 0 - Special potion (not supported)
; 1 - Health potion
; 2 - Mana potion
; ================================================
Switch $POTION_TYPE_ID
Case 8617 To 8621
Return 1
Case 8612 To 8614
Return 1
Case 8647 To 8651
Return 2
Case 8642 To 8644
Return 2
Case Else
Return 0
EndSwitch
EndFunc ;==>_Get_Potion_Type
Func _Use_Item($INVENTORY_INDEX, $INVENTORY_TYPE_ID, $EQUIPMENT = 0)
Local $PACKET
$PACKET = "2800"
$PACKET &= _Reverse_Bytes($EQUIPMENT, 2)
$PACKET &= "01"
$PACKET &= _Reverse_Bytes($INVENTORY_INDEX, 2)
$PACKET &= "00"
$PACKET &= _Reverse_Bytes($INVENTORY_TYPE_ID)
_Send_Packet($PACKET)
EndFunc ;==>_Use_Item
Quote:
Originally Posted by Jotti2012-05-19 Found nothing 2012-05-19 Found nothing
2012-05-19 Found nothing 2012-05-19 Found nothing
2012-05-19 Found nothing 2012-05-19 Found nothing
2012-05-18 Found nothing 2012-05-19 Found nothing
2012-05-19 Found nothing 2012-05-19 Found nothing
2012-05-19 Found nothing 2012-05-19 Found nothing
2012-05-19 Found nothing 2012-05-19 Found nothing
2012-05-19 Found nothing 2012-05-19 Found nothing
2012-05-19 Found nothing 2012-05-18 Found nothing
2012-05-19 Found nothing 2012-05-18 Found nothing