How can I get route steps?

All resolved question will be found here. It is recommended that you browse / search through this section first and see if your question has been answered before

Moderators: Moderators, Documentation Writers

Message
Author
bluesky
Noob
Noob
Posts: 13
Joined: 15 Feb 2016, 02:09
Noob?: No

How can I get route steps?

#1 Post by bluesky »

I using "debug 1" message can get route steps.

Route 在 API 中 - next step moving to (39, 149), index 15, 314 steps left

Then using macros-console to calculate it.

But using "macro_allowDebug 1" will very lag,so this method not good!

Have other method can get "route steps" into macros variable?
thank you!

Code: Select all

automacro checksteps {
            console /Route 在 API 中 \- next step moving to \((\d+)\, (\d+)\)\, index (\d+)\, (\d+) steps left/i
            location prontera
            run-once 1
            call {
               if ("$.lastMatch4 > "100") {
                    do is @inventory(speedup)
               }
    }
}

Mortimal
Developers
Developers
Posts: 389
Joined: 01 Nov 2008, 15:31
Noob?: No

Re: How can I get route steps?

#2 Post by Mortimal »

hmmmmmm it saves that info in intermediate variable....

like that:

src\Task\Route.pm line 309

Code: Select all

my $stepsleft = @{$solution};
blablabla
debug "Route $self->{actor} - next step moving to ($self->{new_x}, $self->{new_y}), index $self->{index}, $stepsleft steps left\n", "route";
no external access...

maybeif create new global variable and resave data there u can use it in AM @eval()

OR

put a line before debug line:

Code: Select all

message TF("%s steps to destination.\n", $stepsleft), "info";
u can connect your AM to this line now without switching debug on. Will work for your purposes...
Please use pin function for uploading your file contents!

bluesky
Noob
Noob
Posts: 13
Joined: 15 Feb 2016, 02:09
Noob?: No

Re: How can I get route steps?

#3 Post by bluesky »

It's perfect!!
Thany you :D :D :D

Locked