Good Day, I want to make a macro that will use @rand as variable assignments. How can I properly construct this?
The bot will try to detect a player within 6 cells , and if someone comes in within 6 cells , it will trigger the macro and the bot will execute the seq in which chosen by @rand .
automacro check {
player (.*) 6
call mymacro
}
macro mymacro {
@rand (1,4)
$var = @rand
if (($var == 1) call seq1 1 { )
if (($var == 2) call seq2 1 { )
if (($var == 3) call seq3 1 { )
if (($var == 4) call seq4 1 { )
}
macro seq1 {
do blah blah
do put command here
}
macro seq2 {
do blah blah
do put command here
}
macro seq3 {
do blah blah
do put command here
}
macro seq4 {
do blah blah
do put command here
}
I'm playing in a pk server and I use this bot to cast skills . So if a player comes near my bot or tries to kill me , my bot will transfer to a different savepoint ( the new sp will depend on the result of the @rand ) , save in the kafra then continue what it's supposed to do.
automacro Attacked {
console /oh no im attacked or what ever it is>
run-once 1
call {
$random = <ur maps
do warp $random
release all
}
}
automacro map1 {
location
run-once 1
call {
do go save or whate ver you want
}
}
<some more maps you wnat just like above
I'm myself don't write fancy code or complex stuff. I like it simple
iRO Supporter. Read before you ask is the wisest thing human can do. Unless you're a cat.
automacro Attacked {
console /oh no im attacked or what ever it is>
run-once 1
call {
$random = <ur maps
do warp $random
release all
}
}
automacro map1 {
location
run-once 1
call {
do go save or whate ver you want
}
}
<some more maps you wnat just like above
I'm myself don't write fancy code or complex stuff. I like it simple
I forgot , I need to use If statements because I need to do manual npc talk steps to save to the kafra of the new random map. I'm planning to also use inns as save points so I need IF statements to direct a sequence to a correct macro for steps.