Updated GWA2

02/21/2020 10:44 iTeX-#46
possible that Func TargetNearestEnemy()
Return PerformAction(0x93, 0x1E)
EndFunc ;==>TargetNearestEnemy

is broken ?
02/21/2020 16:15 ewrt#47
Hey did any1 manage to fix the "StartSalvage" function? Any help is appriciated.
;~ Description: Starts a salvaging session of an item.
Func StartSalvage($aItem)
Local $lOffset[4] = [0, 0x18, 0x2C, 0x690]
Local $lSalvageSessionID = MemoryReadPtr($mBasePointer, $lOffset)

If IsDllStruct($aItem) = 0 Then
Local $lItemID = $aItem
Else
Local $lItemID = DllStructGetData($aItem, 'ID')
EndIf

Local $lSalvageKit = FindSalvageKit()
If $lSalvageKit = 0 Then Return

DllStructSetData($mSalvage, 2, $lItemID)
DllStructSetData($mSalvage, 3, FindSalvageKit())
DllStructSetData($mSalvage, 4, $lSalvageSessionID[1])

Enqueue($mSalvagePtr, 16)
EndFunc ;==>StartSalvage
02/22/2020 02:28 sadusten#48
Quote:
Originally Posted by iTeX- View Post
possible that Func TargetNearestEnemy()
Return PerformAction(0x93, 0x1E)
EndFunc ;==>TargetNearestEnemy

is broken ?
Shouldn't be, i was using it today and worked fine for me:(
02/22/2020 02:29 list comprehension#49
Quote:
Originally Posted by ewrt View Post
Hey did any1 manage to fix the "StartSalvage" function? Any help is appriciated.
;~ Description: Starts a salvaging session of an item.
Func StartSalvage($aItem)
Local $lOffset[4] = [0, 0x18, 0x2C, 0x690]
Local $lSalvageSessionID = MemoryReadPtr($mBasePointer, $lOffset)

If IsDllStruct($aItem) = 0 Then
Local $lItemID = $aItem
Else
Local $lItemID = DllStructGetData($aItem, 'ID')
EndIf

Local $lSalvageKit = FindSalvageKit()
If $lSalvageKit = 0 Then Return

DllStructSetData($mSalvage, 2, $lItemID)
DllStructSetData($mSalvage, 3, FindSalvageKit())
DllStructSetData($mSalvage, 4, $lSalvageSessionID[1])

Enqueue($mSalvagePtr, 16)
EndFunc ;==>StartSalvage
Both salvage patterns are broken and the asm is commented out if you look in the gwa2 file. Those will need to be updated for that to work.
02/22/2020 03:25 Zvend#50
Quote:
Originally Posted by list comprehension View Post
Both salvage patterns are broken and the asm is commented out if you look in the gwa2 file. Those will need to be updated for that to work.
It will require a lot of assembly know how. Start with the xdbg or IDA to RE.
CheatEngine is also a nice add on.
02/22/2020 20:15 Zvend#51
Quote:
Originally Posted by CoderAndy View Post
i'm saying again for all the ppl that trying to run old scripts with the new api: GWA2 isn't fully updated and it doesn't work 100%, thats why i asked phat what it needs to be fixed and here is the list again:
probably much more like
rendering
perform action iirc
on-skill event
on-chat event

Basicly almost everything that require ASM in autoit.
02/28/2020 13:46 havochavoc2#52
The rendering works as expected for me, the process uses considerably less resources. It's just that some functions, seem to not be as reliable when the rendering is disabled. At least TargetNearest (All PerformAction functions?) is affected.
02/28/2020 14:10 Restia Ashdoll#53
mind sharing the updated gwa2 for those who are to stupid to update themself like me?
if i could see once how to update them like before and after i might be able to do it myself next time xD

at least i tried
02/28/2020 20:41 sadusten#54
Quote:
Originally Posted by Restia Ashdoll View Post
PickupLoot Func seems to not work here for me
Pretty sure i used the right header. Could you post your pickup and canpickup functions?
02/28/2020 20:46 Restia Ashdoll#55
Quote:
Originally Posted by sadusten View Post
Pretty sure i used the right header. Could you post your pickup and canpickup functions?
i just deleted my comment because i am retarded pickuploot func was missing edit it in and works now perfectly fine sry ma bad XD as i said i am a nooby

for people who need it this should work doe:

Func PickUpLoot()
Local $lAgent
Local $aitem
Local $lDeadlock
For $i = 1 To GetMaxAgents()
If GetIsDead(-2) Then Return
$lAgent = GetAgentByID($i)
If DllStructGetData($lAgent, 'Type') <> 0x400 Then ContinueLoop
$aitem = GetItemByAgentID($i)
If CanPickUp($aitem) Then
PickUpItem($aitem)
$lDeadlock = TimerInit()
While GetAgentExists($i)
Sleep(100)
If GetIsDead(-2) Then Return
If TimerDiff($lDeadlock) > 10000 Then ExitLoop
WEnd
EndIf
Next
EndFunc
02/28/2020 20:48 sadusten#56
Quote:
Originally Posted by Restia Ashdoll View Post
i just deleted my comment because i am retarded pickuploot func was missing edit it in and works now perfectly fine sry ma bad XD as i said i am a nooby
haha no worries, glad it works :)
02/29/2020 01:27 Zvend#57
You guys should really start working together. Create a git, get some control, remove unnecessary functions, get more structure inside. That "API" is such a mess...

you can split the api into a few files to get more structure.. uff

Or get lost from autoit and start working on sth better, like c++ e.g.
You already have an open source up to date api which needs some extensions but its already better than this :S ^^
02/29/2020 01:39 sadusten#58
Quote:
Originally Posted by Zvend View Post
You guys should really start working together. Create a git, get some control, remove unnecessary functions, get more structure inside. That "API" is such a mess...

you can split the api into a few files to get more structure.. uff

Or get lost from autoit and start working on sth better, like c++ e.g.
You already have an open source up to date api which needs some extensions but its already better than this :S ^^
That's very true, been quite claustrofobic over the years, i said to myself to start learning c++ and other languages but never did :(
03/02/2020 16:49 Restia Ashdoll#59
Working on old dust farmer anyone having an idea why the loot doesn't get collected at all?
Here the functions used:



Func Farm()
If Not $WeAreDead Then CurrentAction("Nightmare Group 1/3")
If Not $WeAreDead Then Engage()
If Not $WeAreDead Then CollectObject()
If CheckIfInventoryIsFull() and Not $WeAreDead then $WeAreDead = True
If Not $WeAreDead Then CurrentAction("Nightmare Group 2/3")
If Not $WeAreDead Then Engage()
If Not $WeAreDead Then CollectObject()
If CheckIfInventoryIsFull() and Not $WeAreDead then $WeAreDead = True
If Not $WeAreDead then CurrentAction("Recharging Life-Energy-Skills")
local $timertobethebest = TimerInit()
If Not $WeAreDead then
Do
Sleep(200)
$me2 = GetAgentByID(-2)
Until (DllStructGetData($me2, 'EnergyPercent') = .7 And DllStructGetData($me2, 'HP') = .8) or TimerDiff($timertobethebest) > 15000
EndIf
If Not $WeAreDead then MoveTo(7321, -3438)
If Not $WeAreDead Then CurrentAction("Nightmare Group 3/3")
If Not $WeAreDead Then Engage()
If Not $WeAreDead Then CollectObject()
If CheckIfInventoryIsFull() and Not $WeAreDead then $WeAreDead = True
If Not $WeAreDead Then $enemy = "Nightmares"
If Not $WeAreDead Then AggroMoveToEx(10338, -5940, $enemy)
If CheckIfInventoryIsFull() and Not $WeAreDead then $WeAreDead = True
If Not $WeAreDead Then $enemy = "Nightmares"
If Not $WeAreDead Then AggroMoveToEx(12720, -5286, $enemy)
If CheckIfInventoryIsFull() and Not $WeAreDead then $WeAreDead = True
If Not $WeAreDead Then $enemy = "Nightmares"
If Not $WeAreDead Then AggroMoveToEx(12588, -818, $enemy)
If CheckIfInventoryIsFull() and Not $WeAreDead then $WeAreDead = True
If Not $WeAreDead Then $enemy = "Nightmares"
If Not $WeAreDead Then AggroMoveToEx(12432, 1077, $enemy)
If CheckIfInventoryIsFull() and Not $WeAreDead then $WeAreDead = True
If Not $WeAreDead Then $enemy = "Nightmares"
If Not $WeAreDead Then AggroMoveToEx(10303, 980, $enemy)
If CheckIfInventoryIsFull() and Not $WeAreDead then $WeAreDead = True
If Not $WeAreDead Then $enemy = "Nightmares"
If Not $WeAreDead Then AggroMoveToEx(9720, 2245, $enemy)
AdlibUnRegister("CheckDeath")
AdlibUnRegister("HealYourself")
CurrentAction("End Of Run")
EndFunc

Func CollectObject()
Sleep(800)
If Not $WeAreDead Then CurrentAction("Pickup Loot")
PickupLoot()
;PickupLoot() ;Need to edit Canpickup list and create checkbox for: pickup all = PickupItems
CheckIfInventoryIsFull()
If Not $WeAreDead Then CurrentAction("Recharging")
Do
local $NearestAgent = GetNearestEnemyToAgent(-2)
$distance = @[Only registered and activated users can see links. Click Here To Register...]
If $distance < 1020 Then
Fight2()
CollectObject()
EndIf
If Not $WeAreDead Then RndSlp(500)
Until (DllStructGetData(GetAgentByID(-2), 'EnergyPercent') >= 0.9 OR $WeAreDead)
UseSkillEx(8,0)
UseSkillEx(7,0)
EndFunc;==>CollectObject

Func CanPickUp($aItem)
Local $lModelID = DllStructGetData(($aItem), 'ModelId')
Local $aExtraID = DllStructGetData($aItem, 'ExtraId')
Local $lRarity = GetRarity($aItem)
Local $Requirement = GetItemReq($aItem)
If ($lModelID == 2511) Then
If (GetGoldCharacter() < 99000) Then
Return True ; gold coins (only pick if character has less than 99k in inventory)
Else
Return False
EndIf

ElseIf ($lModelID == $ITEM_ID_Dyes) Then ; if dye
If (($aExtraID == $ITEM_ExtraID_BlackDye) Or ($aExtraID == $ITEM_ExtraID_WhiteDye)) Then ; only pick white and black ones
Return True
EndIf

ElseIf ($lRarity == $RARITY_Gold) Then ; gold items
$GoldsCount = $GoldsCount + 1
GUICtrlSetData($GUI_Golds,$GoldsCount)
Return True
ElseIf ($lRarity == $RARITY_Purple) Then ; purple items
Return True
ElseIf ($lRarity == $RARITY_Blue) Then ; blue items
Return True
ElseIf ($lRarity == $RARITY_White) Then ; White items
Return True

Else
Return False
EndIf
EndFunc

Func PickupItems($iItems = -1, $fMaxDistance = 1012)
Local $aItemID, $lNearestDistance, $lDistance
$tDeadlock = TimerInit()
Do
$aItem = GetNearestItemToAgent(-2)
$lDistance = @[Only registered and activated users can see links. Click Here To Register...]

$aItemID = DllStructGetData($aItem, 'ID')
If $aItemID = 0 Or $lDistance > $fMaxDistance Or TimerDiff($tDeadlock) > 30000 Then ExitLoop
PickUpItem($aItem)
$tDeadlock2 = TimerInit()
Do
Sleep(500)
If TimerDiff($tDeadlock2) > 5000 Then ContinueLoop 2
Until DllStructGetData(GetAgentById($aItemID), 'ID') == 0
$iItems_Picked += 1
;UpdateStatus("Picked total " & $iItems_Picked & " items")
Until $iItems_Picked = $iItems
Return $iItems_Picked
EndFunc ;==>PickupItems
03/02/2020 16:54 Zvend#60
Quote:
Originally Posted by Restia Ashdoll View Post
Working on old dust farmer anyone having an idea why the loot doesn't get collected at all?
Here the functions used:
Please use the [.CODE][./CODE] tags next time.

this is horrible