So I've made my first script and I ran into a problem. Whenever I run my script from CLI using the -script argument my script starts to behave differently. When my script starts, all getInventory().contains("SOMEITEM") return false for some reason. When using getInventory().getItem("SOMEITEM") it returns null. Whenever this happens, I programmed the bot to retrieve the item from the bank and when it opens the bank it suddenly remembers that it actually has the item already and continues to function normally. Note that getInventory() is not null.
The weird thing is that the script works perfectly when launched manually within the client and the problem only arises when using the -script argument. In the log I'm getting no errors. Anyone have any ideas?