Func DoLooting()
;Move(400, 200)
Sleep(100)
GUICtrlSetData($lblStatus, "Status: Looting.")
while 1
$OBject = IterateObjectList(0)
$foundobject = 0
_ArraySort($OBject, 0 , 0 , 0 ,

for $i = 0 to UBound ( $OBject ,1 )-1 ;or StringInStr($OBject[$i][2],"GoldCoins")
if $OBject[$i][6] = 2 and $OBject[$i][7] = -1 and $OBject[$i][1] <> 0xFFFFFFFF and not StringInStr($OBject[$i][2],"Gold") Then ;checking for loot and goldcoins
If $LootTomes = 1 Then
If StringInStr($OBject[$i][2],"Lore_Book_Flippy") Then
PowerUseGUID($OBject[$i][1],0x7545)
$TomeCount += 1
$foundobject = 1
ExitLoop
EndIf
EndIf
If $LootGems = 1 Then
If StringInStr($OBject[$i][2],"Ruby") or StringInStr($OBject[$i][2],"Amethys") or StringInStr($OBject[$i][2],"Emerald") or StringInStr($OBject[$i][2],"Topaz") Then
PowerUseGUID($OBject[$i][1],0x7545)
$GemCount += 1
$foundobject = 1
ExitLoop
EndIf
EndIf
If IterateActorAtribs($OBject[$i][1],$Item_Quality_Level) >= $LootQuality Then
PowerUseGUID($OBject[$i][1],0x7545)
$RareCount += 1
$foundobject = 1
ExitLoop
EndIf
EndIf
Next
if $foundobject = 0 then ExitLoop
;Sleep(300)
WEnd
Send("{2}") ;Summon our ferrets, just incase they are not there anymore.
;Move($GoldLoot1[0], $GoldLoot1[1])
( if i uncoment this one with
;Sleep(Random(800, 900))
the sleep it will take arround 1 second break after the first grabing gold right ? )
;Move($GoldLoot2[0], $GoldLoot2[1])
;Sleep(Random(400,500))
;Move($GoldLoot3[0], $GoldLoot3[1])
;Sleep(Random(400,500))