deathcrow
2013-04-04 14:28:47
I made a script for stealing from a chest and it works so far. I am just working on adding fail-safes.
Sometimes when you "search for traps" on a chest nothing will change in the chat box if it was at the perfect time. The way I have made the script so far it makes it think it successfully looted the chest, which is incorrect.
So I want to make it count how many of a stackable item is in the inventory or/and count how many coins are in the inventory. With this I could make it check to see if there is more of that item/coins than there was before it stole from the chest. If not then it didn't steal and it could try again.
I tried using the builtin function CoinAmount and CountItems but they don't seem to be working properly.
This is the code I have tried:
Also, I have tried this:
The first part of the code doesn't get the number of my stackable item in my inventory so I tried doing coins instead (2nd part of code). When it counts the coins it always tells me there are 0 coins in the inventory.
Any ideas?
I appreciate the help! Thank you.
Sometimes when you "search for traps" on a chest nothing will change in the chat box if it was at the perfect time. The way I have made the script so far it makes it think it successfully looted the chest, which is incorrect.
So I want to make it count how many of a stackable item is in the inventory or/and count how many coins are in the inventory. With this I could make it check to see if there is more of that item/coins than there was before it stole from the chest. If not then it didn't steal and it could try again.
I tried using the builtin function CoinAmount and CountItems but they don't seem to be working properly.
This is the code I have tried:
Procedure CheckInvItem;
Var
ItemsInInv, ItemDTM: Integer;
Begin
ItemDTM := DTMFromString('mWAAAAHicY2FgYHBiYmCwAGJnIPYFYg5GBgYBIP4DlOMD0r3NzQwxoaEMuzZsYFg0bRoDOmBEwyAAALteCME=');
ItemsInInv := CountItems('dtm', ItemDTM, []);
End;
Also, I have tried this:
WriteLn('Coins found: '+toStr(CoinAmount('inventory')));The first part of the code doesn't get the number of my stackable item in my inventory so I tried doing coins instead (2nd part of code). When it counts the coins it always tells me there are 0 coins in the inventory.
Any ideas?
I appreciate the help! Thank you.