Log in

View Full Version : Cavebot isTrue issue



Hans Henrik
07-13-2012, 18:56
(not sure if it belongs to "Support" or "Script Factory", please move it if placed wrong)
hoping i could get some help with my cavebot script, i use BlackD Proxy 24.5, Tibia 7.6, and
i have this line:
IfTrue ($countitems:53 0C$#number<=# 4) Goto needtoStop1
and it ALWAYS jump to needtoStop1
(afaik) That is the ONLY way to get to needtoStop1 (its at the bottom of the script, and every other path leads to an unconditional "jump back")
and $countitems:53 0C$ == 16
why does it jump to needtoStop1 ?

full script:

setMeleeKill Evil Morder
SetMaxAttackTimeMs 40000
onGMpause
setRetryAttacks
setNoFollow
setLootDistance 99
#setBot LootAll=1
:caveloop
#check SDs
IfTrue ($countitems:53 0C$#number<=# 4) Goto needtoStop1
#it always jumps even when $countitems:53 0C# is 16
:<place
move 367,313,6
IfTrue ($hpofhex-id:{$hex-lastattackedid$}$#number>=#3) Goto <place
:2.5
move 363,305,6
IfTrue ($hpofhex-id:{$hex-lastattackedid$}$#number>=#3) Goto 2.5
:^place
move 376,305,6
IfTrue ($hpofhex-id:{$hex-lastattackedid$}$#number>=#3) Goto ^place
gotoScriptLine $nlineoflabel:caveloop$
:needtoStop1
setLootOff
resetLoot
resetKill
:needtoStop
move 375,309,6
sayMessage {$countitems:53 0C$}BLEHAS
#says 16BLEHAS and exits

Hans Henrik
07-13-2012, 19:42
tried to debug it, changed a few things, and found out that its actually jumping on a Move x y z command :eek:

The following code will make the char say
18:39 Gal: 1
18:39 Gal: 16BLEHAS
18:39 Cavebot script finished!
code:
SetMaxAttackTimeMs 40000
onGMpause
setRetryAttacks
setNoFollow
setLootDistance 99
#setBot LootAll=1
setMeleeKill Evil Morder
:caveloop
#check SDs
IfTrue ($countitems:53 0C$#number<=#4) Goto $nlineoflabel:needtoStop1$
:leftplace
sayMessage 1
move 367,313,6
sayMessage 2
IfTrue ($hpofhex-id:{$hex-lastattackedid$}$#number>=#3) Goto $nlineoflabel:leftplace$
:2.5
move 363,305,6
IfTrue ($hpofhex-id:{$hex-lastattackedid$}$#number>=#3) Goto $nlineoflabel:2.5$
:upplace
move 376,305,6
IfTrue ($hpofhex-id:{$hex-lastattackedid$}$#number>=#3) Goto $nlineoflabel:upplace$
gotoScriptLine $nlineoflabel:caveloop$
:needtoStop1
setLootOff
resetLoot
resetKill
:needtoStop
move 375,309,6
sayMessage {$countitems:53 0C$}BLEHAS

Vinnie
07-14-2012, 14:38
Wierd script....Dont know what the problem is with it....What is the script for and what is an Evil Morder!?

Hans Henrik
07-14-2012, 14:57
(note that it is a OT)
it is a VERY dangerous monster that will kill me unless i stand at an exact spot.
i need the cavebot to stand at that exact spot until it kills, and then find the next monster,
stand in an exact spot and kill it, and go to next.. etc
having that said, it is great EXP! :p
if i don't stand exactly where the fucker cant hit me, i will die in seconds. that's why i use
IfTrue ($hpofhex-id:{$hex-lastattackedid$}$#number>=#3) Goto $nlineoflabel:upplace$
(i cant move as long as the mob has at least 3% hp or more left.)

Vinnie
07-14-2012, 16:26
I had a simular problem with a creature in an OT in the end i just got a cond to replace amulet's and bought ton's of stone skin amulet's. Don't know if that would benifit you mind.

blackd
07-15-2012, 16:06
answer to first post:
the problem is you are using bad syntax there.
IfTrue ($countitems:53 0C$#number<=# 4) Goto needtoStop1

the correct syntax to reference the line of the label in this case...
IfTrue ($countitems:53 0C$#number<=# 4) Goto $nlineoflabel:needtoStop1$