Thanks, although I'm still getting an error, further up in the code, in this function:
Code:
Func GetExtraItemInfo($aitem)
If IsDllStruct($aitem) = 0 Then $aAgent = GetItemByItemID($aitem)
$lItemExtraPtr = DllStructGetData($aitem, "namestring")
DllCall($mHandle[0], 'int', 'ReadProcessMemory', 'int', $mHandle[1], 'int', $lItemExtraPtr, 'ptr', $lItemExtraStructPtr, 'int', $lItemExtraStructSize, 'int', '')
Return $lItemExtraStruct
EndFunc ;==>GetExtraItemInfo
The error is on the 4th line (DllCall), I've been looking at it with Google and ChatGPT but no luck so far.
EDIT. Ok, think I've fixed it, I removed some brackets from the code you sent, here's the new version:
Code:
Func CanPickUp($aitem)
Local $r = DllStructGetData($aItem, 'rarity')
Local $m = DllStructGetData($aitem, 'ModelID')
Switch $m
Case 467, 468, 37765, 933, 2511, 934, 442, 5965, 444, 921, 923, 932, 813, 22190, 22191, 27040, 454, 1660, 499, 1578
Return True
Case Else
If $r = $RARITY_GREEN Then Return True
Return False
EndSwitch
EndFunc ;=> CanPickUp
It's not crashing anymore, will test to see if it picks up Dubloons + Greens now...