Jo, im coding a new ministerial commendation bot. has some1 a working storage function to store all perfekt items / gold?
Func GoldIs($bagIndex, $numOfSlots)
For $i = 1 To $numOfSlots
ConsoleWrite("Checking items: " & $bagIndex & ", " & $i & [MENTION=3576271]CRLF[/MENTION])
$aItem = GetItemBySlot($bagIndex, $i)
If DllStructGetData($aItem, 'ID') <> 0 And GetRarity($aItem) = $RARITY_Gold Then
Do
For $bag = 8 To 11 ; 6 To 16 are all storage bags
$slot = FindEmptySlot($bag)
If $slot <> 0 Then
$FULL = False
$nSlot = $slot
ExitLoop 2; finding first empty $slot in $bag and jump out
Else
$FULL = True; no empty slots :(
EndIf
Sleep(400)
Next
Until $FULL = True
If $FULL = False Then
MoveItem($aItem, $bag, $nSlot)
ConsoleWrite("Gold item moved ...."& [MENTION=3576271]CRLF[/MENTION])
PingSleep(1000)
EndIf
EndIf
Next
EndFunc ;==>GoldIs
Func FindEmptySlot($bagIndex) ;Parameter = bag index to start searching from. Returns integer with item slot. This function also searches the storage. If any of the returns = 0, then no empty slots were found
Local $lItemInfo, $aSlot
For $aSlot = 1 To DllStructGetData(GetBag($bagIndex), 'Slots')
Sleep(40)
ConsoleWrite("Checking: " & $bagIndex & ", " & $aSlot & [MENTION=3576271]CRLF[/MENTION])
$lItemInfo = GetItemBySlot($bagIndex, $aSlot)
If DllStructGetData($lItemInfo, 'ID') = 0 Then
ConsoleWrite($bagIndex & ", " & $aSlot & " <-Empty! " & [MENTION=3576271]CRLF[/MENTION])
$lReturn = $aSlot
ExitLoop
Else
$lReturn = 0
EndIf
Next
Return $lReturn
EndFunc ;==>FindEmptySlot
If FindEmptyStorageSlot($lStorageNumber, $lSlotNumber) Then
Out("Storing item [" & $I & "," & $J & "]")
MoveItem($lItem, $lStorageNumber, $lSlotNumber)
Do
RndSleep(GetPing() + 1000)
Until DllStructGetData(GetItemBySlot($lStorageNumber, $lSlotNumber), "ID") <> 0
EndIf
Func FindEmptyStorageSlot(ByRef $StorageNumber, ByRef $SlotNumber) For $StorageNumber = 6 To 16 Local $lBag = GetBag($StorageNumber) If $lBag == 0 Then Return False EndIf For $SlotNumber = 1 To 20 Local $lItem = GetItemBySlot($StorageNumber, $SlotNumber) If DllStructGetData($lItem, "ID") = 0 Then Return True EndIf Next Next Return False EndFunc ; <== Find empty storage slot