Quote:
Originally Posted by xamkta
Hey all, as the title states. I'm looking for a snippet that will store all platinum on a character in storage in the Isle of Weeping Stone (if that matters). Thanks for any help.
|
Code:
Func DepositGold($aAmount = 0)
Local $lAmount
Local $lStorage = GetGoldStorage()
Local $lCharacter = GetGoldCharacter()
If $aAmount > 0 And $lCharacter >= $aAmount Then
$lAmount = $aAmount
Else
$lAmount = $lCharacter
EndIf
If $lStorage + $lAmount > 1000000 Then $lAmount = 1000000 - $lStorage
ChangeGold($lCharacter - $lAmount, $lStorage + $lAmount)
EndFunc ;==>DepositGold
Code:
Func GetGoldCharacter()
Local $lOffset[5] = [0, 0x18, 0x40, 0xF8, 0x90]
Local $lReturn = MemoryReadPtr($mBasePointer, $lOffset)
Return $lReturn[1]
EndFunc ;==>GetGoldCharacter
functions above should be within the GWA2 you are using, ensure they are if so then you can simple just call the function with something similar to the following. I didn't add anything with Map Traveling, if you want it to be specific to a map make sure you add it below.
Code:
; Check the amount of gold on the character
Local $lCharacterGold = GetGoldCharacter()
If $lCharacterGold > 99000 Then ; If the gold is greater than 99,000, then deposit it
RndSleep(500)
DepositGold(50000); did 50k Plat
RndSleep(500)
EndIf