PDA

View Full Version : Bot skips oneliner



Kwasek
04-11-2016, 09:25 PM
Hello! I startet botting with this script
http://forums.xenobot.net/showthread.php?39231-shAdOwArt-s-Scripts&p=457459&viewfull=1#post457459
but i figured out that it's getting stuck on ship when npc is out of talking range. So i made small oneliner:
Walker.ConditionalGoto((Self.Position().y == 32022), "Labelone", "Labeltwo")
Where Labelone is label before talking to npc and labeltwo starting my path in my destination city. That didn't solve my problem cuz bot skips it every fucking time. What am I doing wrong?

Oscagi
04-11-2016, 10:33 PM
Hello! I startet botting with this script
http://forums.xenobot.net/showthread.php?39231-shAdOwArt-s-Scripts&p=457459&viewfull=1#post457459
but i figured out that it's getting stuck on ship when npc is out of talking range. So i made small oneliner:
Walker.ConditionalGoto((Self.Position().y == 32022), "Labelone", "Labeltwo")
Where Labelone is label before talking to npc and labeltwo starting my path in my destination city. That didn't solve my problem cuz bot skips it every fucking time. What am I doing wrong?

Maybe ur position on Y its different. IDK, the code its good, I do the same with my scripts but using the large mode:



elseif (labelName == 'GoThais') then
Self.SayToNpc({'hi', 'thais', 'yes'}, 70)
wait(1500)
if Self.Position().y == 32022 then
Walker.Goto('Labelone') --Dont need this u can put return, the script will continue.
else
Walker.Goto('Labeltwo')
end


Try this, but its the same as u have.

shadowart
04-11-2016, 10:56 PM
Walker.ConditionalGoto(Self.DistanceFromPosition(3 2954, 32022, 6) < 15, "Labelone", "Labeltwo") Equality checking on cordinates is rarely a good idea. Also, make sure there's a wait in there so you don't perform the check before the NPC can teleport you.

Oscagi
04-11-2016, 11:06 PM
Walker.ConditionalGoto(Self.DistanceFromPosition(3 2954, 32022, 6) < 15, "Labelone", "Labeltwo") Equality checking on cordinates is rarely a good idea. Also, make sure there's a wait in there so you don't perform the check before the NPC can teleport you.

Then why dont do:


local startpos = Self.Position()

Walker.ConditionalGoto(Self.DistanceFromPosition(s tartpos) > 15, "Labelone", "Labeltwo")


More easy and u dont have to keep checking the positions :>

shadowart
04-11-2016, 11:14 PM
Then why dont do:


local startpos = Self.Position()

Walker.ConditionalGoto(Self.DistanceFromPosition(s tartpos) > 15, "Labelone", "Labeltwo")


More easy and u dont have to keep checking the positions :>
Doesn't always work as you can't know whether you've been teleported or not when you're binding your current position.

Oscagi
04-11-2016, 11:31 PM
Doesn't always work as you can't know whether you've been teleported or not when you're binding your current position.

Yea, but if u put this startpos before talking with npc and u make the DistanceFromPosition bigger than the sqm u can get pushed(depends with the delays you have travel) it will work, its what i use on my news scripts and it works always for me.

shadowart
04-11-2016, 11:35 PM
Yea, but if u put this startpos before talking with npc and u make the DistanceFromPosition bigger than the sqm u can get pushed(depends with the delays you have travel) it will work, its what i use on my news scripts and it works always for me.
You can't do that with one-liners though unless you also want to edit away the already existing NPC travelling label. Doing a quick modification to make a third party script OT compatible is very different from designing a label that you intend to reuse throughout a large number of scripts. Just hard coding the positions is less work when dealing with a single script.

Kwasek
04-12-2016, 08:39 AM
I just checked your propositions but still nothing. I even made simple Walker.Goto("Labelone") and its not working either. Bot just skips it and goes to next waypoint. It seems like bot skips every oneliner i'm adding to this script and i have no idea why.

shadowart
04-12-2016, 08:50 AM
Then youve misspelled the labelname. Upload your modified xbst.

Kwasek
04-12-2016, 07:56 PM
Then youve misspelled the labelname. Upload your modified xbst.
http://speedy.sh/qYmFJ/MS-Hero-Fortress-po-przerobkach2.xbst

shadowart
04-12-2016, 08:29 PM
http://speedy.sh/qYmFJ/MS-Hero-Fortress-po-przerobkach2.xbst


<item text="SIgnore" tag="10"/>
<item text="Stand (32954, 32022, 6)" tag="1"/>
<item text="Sail;Edron:" tag="255"/>
<item text="!cdataread" tag="254"><![CDATA[Walker.ConditionalGoto((Self.Position().y == 31764), "Donetravel", "SIgnore" )]]></item>

SIgnore is not a label so you can't goto it. You need to another label for the failing case.

Kwasek
04-12-2016, 08:48 PM
<item text="SIgnore" tag="10"/>
<item text="Stand (32954, 32022, 6)" tag="1"/>
<item text="Sail;Edron:" tag="255"/>
<item text="!cdataread" tag="254"><=!=[=C=D=A=T=A=[Walker.ConditionalGoto((Self.Position().y == 31764), "Donetravel", "SIgnore" )]=]=></item>

SIgnore is not a label so you can't goto it. You need to another label for the failing case.
Ok. This one is fucked by me but what's going on with the second travel from venore to edron ( last waypoint)?