Originally Posted by
thevadar
I just double checked everything.
The script doesn't seem to work as is for items. It will pick up gold fine (it crashes with an error sometimes but it works most of the time).
I tested this with unidentified and identified rares, as well as fresh rares that just dropped from a mob.
Does anyone have a working example for detecting rares on the ground?
Code:
Func Loot()
while 1
$OBject = IterateObjectList(0)
$foundobject = 0
_ArraySort($OBject, 0 , 0 , 0 ,8)
for $i = 0 to UBound ( $OBject ,1 )-1
if $OBject[$i][6] = 2 and $OBject[$i][7] = -1 and $OBject[$i][1] <> 0xFFFFFFFF or StringInStr($OBject[$i][2],"GoldCoins") Then ;checking for loot and goldcoins
if IterateActorAtribs($OBject[$i][1],$Atrib_Item_Quality_Level) >= 6 or StringInStr($OBject[$i][2],"Gold") or StringInStr($OBject[$i][2],"Topaz_08") or StringInStr($OBject[$i][2],"Amethyst_08") or StringInStr($OBject[$i][2],"Emerald_08") or StringInStr($OBject[$i][2],"Ruby_08") or StringInStr($OBject[$i][2],"Lore_Book_Flippy") Then ;lets check if they are rare or better, and ignore if its goldcoins.
logger("looting: " & $OBject[$i][1])
if isDead() then ExitLoop
PowerUseGUID($OBject[$i][1],0x7545)
$foundobject = 1
ExitLoop
EndIf
EndIf
Next
if $foundobject = 0 then ExitLoop
wend
EndFunc
This works fine for me. Did a java implementation and this works as well. I'm pretty sure that I didn't modify the code besides adding those functions and looting the gems and tomes. Disregard the additional functions I have added..