Hi, I'm having this bug since 1.2.3 beta and just noticed why it's happening now.
I make it say "potions" to the NPC so it won't have any kind of errors trying to buy wrong stuff like HMM, but what happens is that when it says potions to a few NPCs, it considers $tradeopen as false even though trade is open for more than 10 seconds.
Code I'm using below:
--buy potions
if islocation(1) then
waitping(2,3)
sellflasks()
waitping(3,4)
if not $tradeopen then
npctalk('hi', 'trade')
waitping(2,3)
end
waitping(2,3)
if itemcount(MP) < HuntMp then
npctalk('potions')
waitping(4,5)
while $tradeopen and itemcount(MP) < AmountMp and windowcount(SupplyBP) > 0 do
buyitemsupto(MP, AmountMp)
waitping()
end
end
if itemcount(HP) < HuntHp then
npctalk('potions')
waitping()
while $tradeopen and itemcount(HP) < AmountHp and windowcount(SupplyBP) > 0 do
buyitemsupto(HP, AmountHp)
waitping()
end
end
npctalk('bye')
else
waitping()
gotolabel("Nelly")
end