Log in

View Full Version : Is there any log when executing your scripts?



Afwasmidd
05-31-2013, 13:10
Does Blackdtools generate logs when you execute your scripts?
I am currently working on some scripts and in one of them I found a loop while testing it. However I can't get to the source of the problem. I've checked all lines over and over and now I am not sure if it's the script that has an error in it, or if it's blackdtools that's bugging. So I figured out it would be nice to have some sort of logfile or a scriptdebugger so I can see where it goes wrong.

More detailed information about the problem:
The script starts by checking your inventory for any loot that can be sold. If there is nothing to sell it will check the amount of potions in your inventory with:

IfTrue ($countitems:0A 01$#number<#3) Goto $nlineoflabel:buyPotion$
If you have 3 or more health potions (item ID:0A 01) with you it will proceed hunting. After selling any loot it will check for your potions with the same line. If there is need for more potions it will move to the following line where it will check for any leftover loot to sell and if the required amount of money for the 5 potions is present. If not it will withdraw the amount of money from the bank and then buy the potions from the shop (and deposit any empty flasks (1D 01) if present)

:buyPotion
IfTrue ($countitems:FB 2C$#number>#4) Goto $nlineoflabel:selltrollroot$
IfTrue ($countitems:23 28$#number>#4) Goto $nlineoflabel:sellfangs$
IfTrue ($countitems:DC 25$#number>#9) Goto $nlineoflabel:selldirt$
IfTrue ($countitems:C0 0C$#number>#0) Goto $nlineoflabel:SellAndDeposit$
IfTrue ($countitems:D6 0C$#number>#0) Goto $nlineoflabel:SellAndDeposit$
IfTrue ($countitems:0A 01$#number>#2) Goto $nlineoflabel:deposit$
IfTrue ($countitems:D7 0B$#number<#225) Goto $nlineoflabel:withdrawpotion$
gotoScriptLine $nlineoflabel:buyPotion2$
:buyPotion2
fastExiva < B4 11 $hex-tibiastr:Depositing empty Flasks and buying new Potions.$
waitx 1
IfTrue ($countitems:0A 01$#number>#2) Goto $nlineoflabel:deposit$
move 33245,31841,7
move 33247,31840,6
move 33255,31840,6
move 33255,31841,7
IfTrue ($countitems:1D 01$#number>#0) Goto $nlineoflabel:depositFlasksBuyPotions$
sayMessage hi
waitX 1
sayInTrade trade
waitX 2
sayMessage exiva buy:0A 01:5
waitX 1
stackItems
move 33255,31840,6
move 33247,31840,6
move 33245,31841,7
gotoScriptLine $nlineoflabel:deposit$
:depositFlasksBuyPotions
IfTrue ($countitems:0A 01$#number>#2) Goto $nlineoflabel:deposit$
sayMessage hi
waitX 1
sayInTrade deposit
waitx 1
SayInTrade no
waitx 1
SayInTrade yes
waitX 1
sayInTrade trade
waitX 2
sayMessage exiva buy:0A 01:5
waitX 1
stackItems
move 33255,31840,6
move 33247,31840,6
move 33245,31841,7
gotoScriptLine $nlineoflabel:deposit$
#
#Withdrawing gold for new potions.
:withdrawpotion
IfTrue ($countitems:0A 01$#number>#2) Goto $nlineoflabel:deposit$
fastExiva < B4 11 $hex-tibiastr:Withdrawing gold for new Potions.$
waitx 1
move 33170,31808,7
move 33173,31803,7
waitX 1
sayMessage hi
waitX 2
sayInTrade deposit all
waitX 1
sayInTrade yes
waitX 1
sayInTrade withdraw 225
waitX 1
sayInTrade yes
waitX 1
gotoScriptLine $nlineoflabel:buyPotion2$
After depositing any remaining gold it will go back to the top of the script where it will check for loot and potions again before it starts hunting again. However sometimes it decides to buy new potions over and over while the count is definitely higher than 2. Which should trigger hunting and not buying potions again. I know the script goes back to the top after buying the potions. This didn't make sense to me since I don't see a problem with the line there. Even if it decides to buy potions again, it should jump to the deposit line since I put this line at the start of every label concerning the potions:

IfTrue ($countitems:0A 01$#number>#2) Goto $nlineoflabel:deposit$
I don't get errors while running the script so there aren't any typo's in it. I am just confused that it doesn't recognize the last mentioned line when it uses the same item ID that does get recognized when buying the potions. Is there some command I am missing here that prevents this from happening?

Help pls!