[Macro-Plugin] Save $.map and $.pos ?

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

Raider
The Kore Devil
The Kore Devil
Posts: 672
Joined: 22 Feb 2013, 03:40
Noob?: No
Location: The Netherlands

[Macro-Plugin] Save $.map and $.pos ?

#1 Post by Raider »

Hello, I started writing my first macro's. I just have a question about a specific thing.
When the macro is triggered I would like to have the macro to save the $.map and $.pos my char is on.
Then my character spawns to a city, from that point the macro needs to use the map and position we saved earlier to teleport back to the first location again.
gamenikko
The Way Of Human
The Way Of Human
Posts: 192
Joined: 16 Aug 2009, 03:47
Noob?: Yes
Location: Gonryun

Re: Macro help

#2 Post by gamenikko »

can you elaborate more, and post a pseudo code of your desired macro.
Just like old times.
Raider
The Kore Devil
The Kore Devil
Posts: 672
Joined: 22 Feb 2013, 03:40
Noob?: No
Location: The Netherlands

Re: Macro help

#3 Post by Raider »

Code: Select all

automacro rewarp {
hp < 8% 
hp > 4%
status not Dead
location not amatsu
call {
my $.map
my $.pos
do c @warp amatsu 
do c @warp $.map $.pos
}
}
Raider
The Kore Devil
The Kore Devil
Posts: 672
Joined: 22 Feb 2013, 03:40
Noob?: No
Location: The Netherlands

Re: Macro help

#4 Post by Raider »

With the awesome help of the user twist3d it now works!
He advised me to make a config variable in the config.txt.
You can store a value in this variable by assigning it with do conf and use it by calling him with the command @config(configname).

Code: Select all

automacro rewarp {
hp < 8% 
hp > 4%
status not Dead
location not amatsu
run-once 1
call {
do conf mymap $.map
do conf mypos $.pos
pause 1
do c @warp amatsu 
pause 14
do c @warp @config(mymap) @config(mypos)
pause 1
release rewarp
}
}