reset automacro timeout...how?

All about the macro plugin can be found in this forum. This forum is intended for the macro plugin only.

Moderator: Moderators

c4c1n6kr3m1
The Way Of Human
The Way Of Human
Posts: 150
Joined: 24 Mar 2012, 04:13
Noob?: Yes

reset automacro timeout...how?

#1 Post by c4c1n6kr3m1 »

Code: Select all

macro resettried {
     do something
     do ...reset automacro fish

automacro fish {
     timeout 19
     call {
          do something
}
}
how to reset automacro fish{time}
User avatar
SkylorD
Moderators
Moderators
Posts: 1202
Joined: 16 Dec 2011, 02:53
Noob?: No
Location: Brazil

Re: reset automacro timeout...how?

#2 Post by SkylorD »

Code: Select all

6. timeout 10 – This isn't a condition or a command, it works the same way it works in normal Kore blocks, so this automacro cannot trigger within 10 seconds of it already having been triggered. I ALWAYS put timeouts, so even if my conditions are faulty, the automacro doesn't spam and mess up whatever my bot is doing. Otherwise if your automacro is messed up then you could die or something, so its better to put an appropriate timeout.
automacro falala {
run-once 1
call {
do something
release $.caller or falala
}
}
Learn rules
c4c1n6kr3m1
The Way Of Human
The Way Of Human
Posts: 150
Joined: 24 Mar 2012, 04:13
Noob?: Yes

Re: reset automacro timeout...how?

#3 Post by c4c1n6kr3m1 »

No, that "run-once" is not what i want. i'm asking how to reset timeout by set {time} from other macro. inside src/doc/srcdoc/artificial-intelligence.html we'll find

Code: Select all

                        # Store the current time in a variable
                        $ai_seq_args[0]{waitTwoSecs}{time} = time;
                        # We want to wait two seconds
                        $ai_seq_args[0]{waitTwoSecs}{timeout} = 2;
and inside automacro.pm

Code: Select all

$automacro{$am}->{time} = time  if $automacro{$am}->{timeout};
but i'm a noob, failed to understand $am and how this plugin store inside %automacro and %macro , by name? by index? what is inside %automacro visible looks like.
Sorry for bad english

*edited*

ah..got it. so it store inside %automacro by name as keys. din't know that i must add:
use Macro::Data;
inside eval
inside eval.