setting directions for Agent actions works but stops MEE Win11 PC
I have set a simple text string called "Path" hold eg "l123r"
which i have program read each char in the string "Path" then execute the action.
eg
set Path = "lr123"
inside an element loop 0 to length Path
for each element in Path
if Path index = "l" then agent turn left
if Path index = "r" then agent turn right
else agent forward (parse to number Path index)
I have this working but i can not get past a few bugs.
1. agent stops responding to forward commands
2. agent takes 2 steps not 1 sometimes
3. agent goes forward after a turn
My hope was the a string could be decoded into agent actions.
also planning to create a string of the agent's movements.
sorry its very complicated
basically it works ok for a bit then stops or does other things.
adding pause for wait time did not help.
cheers
-
I can add the JS etc later if need be (I built in blocks)
0 -
It is working!!!
player.onChat("x", function () {path = "1rr111r111l1l111l1111r1r111rr11"for (let index3 = 0; index3 <= path.length; index3++) {if (path.charAt(index3) == "l") {agent.turn(LEFT_TURN)} else if (path.charAt(index3) == "r") {agent.turn(RIGHT_TURN)} else if (path.charAt(index3) == "1") {agent.move(FORWARD, 1)}}})1 -
Now to make a Path/string "logbook" of his journeys.
0 -
This most excellent! What a great idea! Thanks for bringing us along on your journey!
0
Please sign in to leave a comment.
Comments
4 comments