time trigger problem (use eval)

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
azurefox
Noob
Noob
Posts: 4
Joined: 22 Mar 2014, 02:37
Noob?: No

time trigger problem (use eval)

#1 Post by azurefox »

Hi there, I want to try make a automacro to trigger when spcific time is reached.
Here is my code,
1st, I record start time,

Code: Select all

automacro recordstarttime {
console /start/
exclusive 1
call {
$a = $.time
log $a
}
then I want to some action is triggered 20 seconds later from $a was recorded in macro shown above. code here

Code: Select all

automacro OK {
        exclusive 1
        run-once 1
eval ($.time - $a) == 20	
        call {
              log OK
		}
}
and second automacro can not be triggered.

I try to use this macro listed below to check eval syntax, it works, it will give me the difference between current time and recorded time.

Code: Select all

macro tt {
log @eval ($.time - $a))
}
So, could anybody can help me to sove this eval trigger problem?
Last edited by azurefox on 16 Apr 2014, 00:11, edited 1 time in total.

gelo2012
Plain Yogurt
Plain Yogurt
Posts: 58
Joined: 17 Sep 2012, 13:54
Noob?: Yes
Location: Sa Puso Mo

Re: eval time trigger problem

#2 Post by gelo2012 »

Try this:

Code: Select all

automacro OK {
        exclusive 1
        run-once 1
        call {
$i = @eval ($.time - $a)
if ($i >= 21) goto timesup

              :timesup
              log OK
      }
}
Just remove the excess close parenthesis:

Code: Select all

macro tt {
log @eval ($.time)
}
I haven't tested it.

azurefox
Noob
Noob
Posts: 4
Joined: 22 Mar 2014, 02:37
Noob?: No

Re: eval time trigger problem

#3 Post by azurefox »

gelo2012 wrote:Try this:

Code: Select all

automacro OK {
        exclusive 1
        run-once 1
        call {
$i = @eval ($.time - $a)
if ($i >= 21) goto timesup

              :timesup
              log OK
      }
}
Just remove the excess close parenthesis:

Code: Select all

macro tt {
log @eval ($.time)
}
I haven't tested it.
My friend, your code does not work...

User avatar
4epT
Developers
Developers
Posts: 617
Joined: 30 Apr 2008, 14:17
Noob?: No
Location: Moskow (Russia)
Contact:

Re: time trigger problem (use eval)

#4 Post by 4epT »

Code: Select all

automacro recordstarttime {
        console /start/
        exclusive 1
        call {
                release OK
        }
}

automacro OK {
        exclusive 1
        delay 20
        run-once 1
        disabled 1
        call {
                log OK
        }
}
or

Code: Select all

automacro OK {
        exclusive 1
        timeout 20
        call {
                log OK
        }
}
All my posts are made by machine translator!
¤ Manual ¤ Anti BotKiller ¤ Packet Extractor v3 ¤
Image
Image

azurefox
Noob
Noob
Posts: 4
Joined: 22 Mar 2014, 02:37
Noob?: No

Re: time trigger problem (use eval)

#5 Post by azurefox »

Hello 4epT, actually I want to use time-control macro to realize the buff-maintained, like the "PRESERVE" of "Shadow chaser". My goal is monitor the remainning time of the dedicated buff(skill status), if remainning time < x seconds, bot will cast skilll again. So, my design is:

Code: Select all

remainning time = buff duration time - (current time - start time) 
and, I want to make macro like this:

Code: Select all

automacro recast {
remainning time < 10
exclusive 1
run-once 1
aggressives < 1
call {
do ss xxxx
release recast 
}
}
So, that's why i use 2 macros to make it work, 1st record the "start time" of buff, 2nd is used to monitor the "remainning time", but it seems got some problem, could you give us some suggestion? Sorry for my bad english.

User avatar
4epT
Developers
Developers
Posts: 617
Joined: 30 Apr 2008, 14:17
Noob?: No
Location: Moskow (Russia)
Contact:

Re: time trigger problem (use eval)

#6 Post by 4epT »

why do not you use a config option "useSelf_skill"?

example:

Code: Select all

useSelf_skill Attention Concentrate {
	lvl 10
	sp > 70
	whenStatusInactive Attention Concentrate
	notInTown 1
	timeout 3
}
All my posts are made by machine translator!
¤ Manual ¤ Anti BotKiller ¤ Packet Extractor v3 ¤
Image
Image

azurefox
Noob
Noob
Posts: 4
Joined: 22 Mar 2014, 02:37
Noob?: No

Re: time trigger problem (use eval)

#7 Post by azurefox »

4epT wrote:why do not you use a config option "useSelf_skill"?

example:

Code: Select all

useSelf_skill Attention Concentrate {
	lvl 10
	sp > 70
	whenStatusInactive Attention Concentrate
	notInTown 1
	timeout 3
}
Hi 4epT, you know, buff like the "PRESERVE" of "Shadow chaser", duration time is 10 min, and if bot re-cast "whenStatusInactive ", there get risk for losing saved skills(like blizzard), this will be happened frequently when monster have attacking skill which my "Shadow chaser" do not want to copy. I also try to use "useSelf_skill" block for using "timeout" to control only, but bot always copy monster skill to cover blizzard which I need to protect when i wake up in morning. So, I think maybe OP ignore re-casting skills when the time reached and another AI sequence get higher priority.

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

Re: time trigger problem (use eval)

#8 Post by c4c1n6kr3m1 »

then create 2 useselfskill., be creative
the first use timeout to trigger, about 9 minute ( do not use 10 minute , you must use it before preserve end )
the second, use whenStatusInactive to triger, as a backup

User avatar
4epT
Developers
Developers
Posts: 617
Joined: 30 Apr 2008, 14:17
Noob?: No
Location: Moskow (Russia)
Contact:

Re: time trigger problem (use eval)

#9 Post by 4epT »

azurefox wrote: Hi 4epT, you know, buff like the "PRESERVE" of "Shadow chaser", duration time is 10 min, and if bot re-cast "whenStatusInactive ", there get risk for losing saved skills(like blizzard), this will be happened frequently when monster have attacking skill which my "Shadow chaser" do not want to copy. I also try to use "useSelf_skill" block for using "timeout" to control only, but bot always copy monster skill to cover blizzard which I need to protect when i wake up in morning. So, I think maybe OP ignore re-casting skills when the time reached and another AI sequence get higher priority.
I do not understand.

Why not use??

Code: Select all

useSelf_skill Preserve {
   lvl 1
   sp > 30
   timeout 570
}
All my posts are made by machine translator!
¤ Manual ¤ Anti BotKiller ¤ Packet Extractor v3 ¤
Image
Image

skydrake
Noob
Noob
Posts: 5
Joined: 23 Mar 2015, 11:12
Noob?: Yes

Re: time trigger problem (use eval)

#10 Post by skydrake »

I was trying to make a time trigger for 24 hours quest. I tried to make it log into

do conf quest_time $.time_$.minute

but don't know what command to trigger and read config.txt and I even tried as below

if (@config quest_time == $.time_$.minute) goto label
else { log quest time not match }

it don't work, tried many days with several ways. pls help

Locked