How can I use sura skill "Dash like a bullet" on route?

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 use sura skill "Dash like a bullet" on route?

#1 Post by bluesky »

I want to use sura skill "Dash like a bullet" on long move route
example 50,50 to 300,300

But map "wall" or "river" that me fail :cry:
Now I have no idea :cry:

How can I use "macros" or "config-onAction route?" or "plugins" to do?
Thank you very much :)

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

Re: How can I use sura skill "Dash like a bullet" on route?

#2 Post by Mortimal »

Code: Select all

$i = @eval (Misc::checkLineWalkable ({x => <your x position>, y => <your y position>}, {x => <target x>, y => <target y>},0))
if $i == 1 line is free from obstacles...


u need to change message from your previous post:

Code: Select all

message TF("%s steps to destination at x=%s y=%s\n", $stepsleft, $self->{new_x}, $self->{new_y}), "info";
it will give you sms like that:

Code: Select all

20 steps to destination at x=300 y=300
rewrite AM to this message and use condition:

Code: Select all

    blablabla
   console /(\d*) steps to destination at x=(\d*) y=(\d*)/i
    blablabla
call{
    blablabla
   $i = @eval (Misc::checkLineWalkable ({x => $::char->{pos}{x}, y => $::char->{pos}{y}}, {x => $.lastMatch2, y => $.lastMatch3},0))
if ($i == 1){
   <do sms you need>
}}
Dunno if it will work not shure about char body position.... give it a try :)
Last edited by Mortimal on 07 Feb 2017, 21:53, edited 1 time in total.
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 use sura skill "Dash like a bullet" on route?

#3 Post by bluesky »

Mortimal wrote:

Code: Select all

$i = @eval (Misc::checkLineWalkable ({x => <your x position>, y => <your y position>}, {x => <target x>, y => <target y>},0))
Thank you!!

But I got a error message@@

Code: Select all

move 94 65
[route] Calculating route to: geffen: 94, 65
[info] 4 steps to destination at x=94 y=65
[macro] [macro] automacro dashroute triggered.
[macro] [macro] dashroute.call error: error in 0: @eval (Misc::checkLineWalkable ({x => $::char->{pos}{x}, y => <$::char->{pos}{y}}, {x => $.lastMatch2, y => $.lastMatch3},0)) failed
[info] 3 steps to destination at x=94 y=65
[macro] [macro] automacro dashroute triggered.
[macro] [macro] dashroute.call error: error in 0: @eval (Misc::checkLineWalkable ({x => $::char->{pos}{x}, y => <$::char->{pos}{y}}, {x => $.lastMatch2, y => $.lastMatch3},0)) failed
This is my automacro

Code: Select all

automacro dashroute {
	console /(\d*) steps to destination at x=(\d*) y=(\d*)/i
        exclusive 1
        call {
   	$i = @eval (Misc::checkLineWalkable ({x => $::char->{pos}{x}, y => <$::char->{pos}{y}}, {x => $.lastMatch2, y => $.lastMatch3},0))
	if ($i == 1){
		do sl 264 $.lastMatch2 $.lastMatch3 1
	}
    }
}

I don't know where is wrong with me@@

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

Re: How can I use sura skill "Dash like a bullet" on route?

#4 Post by Mortimal »

try

Code: Select all

automacro dashroute {
   console /(\d*) steps to destination at x=(\d*) y=(\d*)/i
        exclusive 1
        call {
      $x = $.lastMatch2
      $y = $.lastMatch3
      $i = @eval (Misc::checkLineWalkable ({x => $::char->{pos}{x}, y => $::char->{pos}{y}}, {x => $x, y => $y},0))
   if ($i == 1){
      do sl 264 $.lastMatch2 $.lastMatch3 1
   }
    }
}
Last edited by Mortimal on 07 Feb 2017, 21:53, edited 1 time in total.
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 use sura skill "Dash like a bullet" on route?

#5 Post by bluesky »

the same error

Code: Select all

move 201 95
[route] Calculating route to: amatsu: 201, 95
[info] 7 steps to destination at x=201 y=95
[macro] [macro] automacro dashroute triggered.
[macro] [macro] dashroute.call error: error in 2: @eval (Misc::checkLineWalkable ({x => $::char->{pos}{x}, y => <$::char->{pos}{y}}, {x => $x, y => $y},0)) failed
[info] 6 steps to destination at x=201 y=95
[macro] [macro] automacro dashroute triggered.
[macro] [macro] dashroute.call error: error in 2: @eval (Misc::checkLineWalkable ({x => $::char->{pos}{x}, y => <$::char->{pos}{y}}, {x => $x, y => $y},0)) failed
[info] 3 steps to destination at x=201 y=95
[macro] [macro] automacro dashroute triggered.
[macro] [macro] dashroute.call error: error in 2: @eval (Misc::checkLineWalkable ({x => $::char->{pos}{x}, y => <$::char->{pos}{y}}, {x => $x, y => $y},0)) failed
maybe wrong in my src/misc.pm?
here is my misc https://drive.google.com/file/d/0B0llpH ... sp=sharing
my openkore version is r8871,a little old@@

thank you!

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

Re: How can I use sura skill "Dash like a bullet" on route?

#6 Post by Mortimal »

OMG!!!!

F********NG typo!


$i = @eval (Misc::checkLineWalkable ({x => $::char->{pos}{x}, y => <$::char->{pos}{y}}, {x => $.lastMatch2, y => $.lastMatch3},0))

try this x)

Code: Select all

$i = @eval (Misc::checkLineWalkable ({x => $::char->{pos}{x}, y => $::char->{pos}{y}}, {x => $x, y => $y},0))
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 use sura skill "Dash like a bullet" on route?

#7 Post by bluesky »

Mortimal wrote:

Code: Select all

$i = @eval (Misc::checkLineWalkable ({x => $::char->{pos}{x}, y => $::char->{pos}{y}}, {x => $x, y => $y},0))
Now it's worked :D :D :D
Thank you very much :D

Locked