Openkore.com

OpenKore Forums
It is currently 14 Nov 2018, 05:15

All times are UTC - 5 hours [ DST ]





Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: How can I use sura skill "Dash like a bullet" on route?
PostPosted: 07 Feb 2017, 04:31 
Offline
Noob
Noob

Joined: 15 Feb 2016, 02:09
Posts: 13
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 :)


Top
 Profile  
 
 Post subject: Re: How can I use sura skill "Dash like a bullet" on route?
PostPosted: 07 Feb 2017, 06:26 
Offline
Developers
Developers

Joined: 01 Nov 2008, 15:31
Posts: 361
Code:
$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:
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:
20 steps to destination at x=300 y=300


rewrite AM to this message and use condition:
Code:
    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 :)

_________________
Please use pin function for uploading your file contents!


Last edited by Mortimal on 07 Feb 2017, 21:53, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: How can I use sura skill "Dash like a bullet" on route?
PostPosted: 07 Feb 2017, 11:11 
Offline
Noob
Noob

Joined: 15 Feb 2016, 02:09
Posts: 13
Mortimal wrote:
Code:
$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:
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:
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@@


Top
 Profile  
 
 Post subject: Re: How can I use sura skill "Dash like a bullet" on route?
PostPosted: 07 Feb 2017, 11:50 
Offline
Developers
Developers

Joined: 01 Nov 2008, 15:31
Posts: 361
try

Code:
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
   }
    }
}

_________________
Please use pin function for uploading your file contents!


Last edited by Mortimal on 07 Feb 2017, 21:53, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: How can I use sura skill "Dash like a bullet" on route?
PostPosted: 07 Feb 2017, 12:14 
Offline
Noob
Noob

Joined: 15 Feb 2016, 02:09
Posts: 13
the same error

Code:
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/0B0llpHWO90CJNzA1U0QwZ0FDS28/view?usp=sharing
my openkore version is r8871,a little old@@

thank you!


Top
 Profile  
 
 Post subject: Re: How can I use sura skill "Dash like a bullet" on route?
PostPosted: 07 Feb 2017, 14:50 
Offline
Developers
Developers

Joined: 01 Nov 2008, 15:31
Posts: 361
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:
$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!


Top
 Profile  
 
 Post subject: Re: How can I use sura skill "Dash like a bullet" on route?
PostPosted: 07 Feb 2017, 15:09 
Offline
Noob
Noob

Joined: 15 Feb 2016, 02:09
Posts: 13
Mortimal wrote:

Code:
$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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group