Hello.
Your code works, however, itemcount() returns the count from open containers only.
There are many ways:
1. Using itemcount() to check current count from open containers. If you are using runes by hotkey then you just need to leave the LAST BP open. But if you are using runes directly from backpack then you can use this script:
|Only Registered members can see download links. | Click here to buy subscription or here to register.
2. Using getnewmessages() from server log, but you must leave that channel selected which is not good due to alerts.
3. Using getmessages() from server log, so you could just select the channel on the action that you check supplies and then select "Default" channel back.
4. Using itemcountmsg(string item_name, string message) that returns the item count from that using message "Using one of X..." and screenmessage(boolean visibleOnly) to get last green message, the parameter means if would get message only if it's visible or not.
And soon, i will add a function to return item count from ACTION BARS.
If are going to use this code on Cavebot->Action then
I recommend method 1 or 3.
Method 1 and 4 are good for persistents.
Tell me which method above you prefer and i will try to help you.