Author Topic: *Instead of* Computing elapsed time from a previously set time variable  (Read 2943 times)

Usidor

  • Newbie
  • *
  • Posts: 10
Problem:

I have 3 commands, "A","B" and "C"

Command "A" can only be used every 60 seconds.

"B" and "C" should always check if command "A" is ready to use, and use it before running their process.

Command "B" and "C" should process without command "A" if 60 seconds has not elapsed.

I am obviously a novice with this sort of thing. So any explanation you can give as to what your solution does and how to input that into the Voice Attack user interface would also be greatly appreciated.

Thanks

*Updated subject to better fit the solution.








Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Computing elapsed time from a previously set time variable
« Reply #1 on: April 18, 2020, 10:48:54 AM »
In situations like these, rather than checking how much time has actually elapsed and whether that time if longer than your timeout, it's more practical to set the point in time where your timeout ends, and then check whether that point has been reached.


E.G.
When command "A" executes, you set a date/time variable to 60 seconds in the future:
Code: [Select]
Set date [60SecondsAfterCommandA] to [60SecondsAfterCommandA] plus [60] seconds
This is a "Set a Date/Time Value" action (make sure to check the "Evaluate Not Set as current date/time" option)

Then, in your other commands, you check whether that point in time is before the current time (I.E. that point in time has passed)
Code: [Select]
Begin Date Compare : [60SecondsAfterCommandA] Is Before Current Date/Time
This is a "Begin a Conditional (If Statement) Block" action (make sure to check the "Evaluate 'Not Set' as 1/1/0001" option)


If you're not familiar with either action, press F1 while VoiceAttack has focus to open VoiceAttackHelp.pdf in your default PDF viewer and use the search function of your PDF viewer to find the documentation on them.

Usidor

  • Newbie
  • *
  • Posts: 10
Re: Computing elapsed time from a previously set time variable
« Reply #2 on: April 18, 2020, 11:07:45 AM »
Works perfectly!

I had been in those options but just couldn't quite get it right.

Thank you for the details and the instructions for entering the code.

Thank you thank you!

Usidor

  • Newbie
  • *
  • Posts: 10
I spoke to soon or my previous question didn't actually line up with the total scope of what I am trying to do. Either way I apologize.

My Goal

Create a voice attack command with a loop that will cycle through a set of skills in a specific sequence.

The loop will continually execute the skills as they come off cooldown.

There are approximately 35 different skills with unique cooldown timers that will need to be checked in a specific order according to their priority.

There is a second Pool of about 9 skills. Any one of these skills needs to be "injectable" into the loop with priority at any given time without breaking the loop.

Each of the 9 skills will have unique inputs (if necessary) so that they can be recognized when they are to be injected.

There is a need to set a variable that will be used to determine if the skill is off cooldown.

The intention is to allow the command to be re started over or resumed with all cooldown information in place so that skills continue to fire accordingly.

I would like to be able to achieve this with the fewest amount of inputs possible.

Start command input
Stop early command input
Inject command input (may be 9 unique inputs for each injectable skill)
Pause/Resume command input? (may not be necessary with stop and go feature that keeps cooldown timers)

The commands will be delivered to the game with hot key presses and unique pauses for casting times needed to complete the skill.

Text to speech confirmation of each inputs.
Text to speech confirmation when the command has finished

I have had inconsistent luck with this project so far.
The main issue it seems is my lack of understanding of variables as well as loops.
I don’t know how to verify if the date/time value variables are being properly set.
Currently I am setting the date/time value variable when the skill is activated.
I don’t know how to verify if the date/time variables are being retained for reference either later in the loop.


How I approached the project so far.

SKILL COMMANDS
Create a skill command
A skill command starts off with a series of Device Checks in order to “Inject” a skill in place of the skill that is currently being processed if needed.
A skill command also includes an Else Condition that processes the proper keystrokes and pauses for the skill being requested if a skill was not “injected” in its place.

A Skill command also establishes the date/time variable for the skill. The variable is named after the skill. I.e. Shield Bash will be entered as Shieldbash. The variable is created to add the recast time of the skill to the current date/time.

Combo Command
The intention is to use a combo command to process the Skill commands in the proper sequence and continually loop them firing skills as they are available otherwise skipping them to save the dead cast time while also allowing for skills to inject without breaking the loop.
The intended process is for the Combo command to read the Date/time variable of the Shield Bash/“next skill” in the sequence and decide if it is ready or not according to the date/time variable that was set when the Shield Bash/“next skill” was previously Executed.
Shield Bash/”next skill” should be skipped if it is still on cool down.
What am I experiencing with the commands as they are?

Some skills seem to follow the variables and cast on time and do not try to cast when they are off cooldown.
However, there are always skills that try to recast before they are off cooldown.
This problem is intermittent with some and constant with others and a few never has an issue.
The command never runs the same after it has been ran once or stopped early. Often it will stick on one skill pressing it 3 or 4 times before moving on and doing other seemingly random skill presses.
The command always works best when used right after voice attack has been launched. But again, only once pretty much.
When I keep the skills down to 3 or so to test, I can keep the command going by manually pressing the key I assigned to run the command. This only works if I don’t let all the skills cooldowns recover. I.e. I must keep at least one skill on cooldown by continually pressing the input key.
Outside of misspelled variables and the like, I am at a loss.
I don’t know how to get the write a value feature to display my variables as time instead of the variable name. I was misled for a bit by the time that you get when you hover over the log. This time references when the command was processed and not the time value of the variable.
Sorry for the wall of text.
I would appreciate any input the community may have.

Code: [Select]
COMBO STARTER COMBO STARTER COMBO STARTER
PROVOKE
Begin Date Compare : [Provoke] Is Before Current Date/Time
    Execute command, 'Provoke' (and wait until it completes)
End Condition
Pause 0.1 seconds
BASH
Begin Date Compare : [Bash] Is Before Current Date/Time
    Execute command, 'Bash' (and wait until it completes)
End Condition
Pause 0.1 seconds
ACCELERATION STRIKE NEW
Begin Date Compare : [Accelerationstrikenew] Is Before Current Date/Time
    Execute command, 'Acceleration Strike new' (and wait until it completes)
End Condition
Pause 0.1 seconds
BATTLE CRY
Begin Date Compare : [Battle] Is Before Current Date/Time
    Execute command, 'Battle Cry' (and wait until it completes)
End Condition
Pause 0.1 seconds
PERFECT COUNTER
Begin Date Compare : [Perfectcounter] Is Before Current Date/Time
    Execute command, 'Perfect Counter' (and wait until it completes)
End Condition
Pause 0.1 seconds
VITAL TRIGGER VITAL TRIGGER VITAL TRIGGER 1
VITAL TRIGGER
Begin Date Compare : [Vitaltrigger] Is Before Current Date/Time
    Execute command, 'Vital Trigger' (and wait until it completes)
End Condition
Pause 0.1 seconds
PARTISAN CLEAVE
Begin Date Compare : [Partisancleave] Is Before Current Date/Time
    Execute command, 'Partisan Cleave' (and wait until it completes)
End Condition
Pause 0.1 seconds
SENTINAL STRIKE
Begin Date Compare : [Sentinalstrike] Is Before Current Date/Time
    Execute command, 'Sentinal Strike' (and wait until it completes)
End Condition
Pause 0.1 seconds
DECIMATE
Begin Date Compare : [Decimate] Is Before Current Date/Time
    Execute command, 'Decimate' (and wait until it completes)
End Condition
Pause 0.1 seconds
SLAM
Begin Date Compare : [Slam] Is Before Current Date/Time
    Execute command, 'Slam' (and wait until it completes)
End Condition
Pause 0.1 seconds
VITAL TRIGGER VITAL TRIGGER VITAL TRIGGER 2
VITAL TRIGGER
Begin Date Compare : [Vitaltrigger] Is Before Current Date/Time
    Execute command, 'Vital Trigger' (and wait until it completes)
End Condition
Pause 0.1 seconds
DEFENDERS CHARGE
Begin Date Compare : [Defenderscharge] Is Before Current Date/Time
    Execute command, 'Defenders Charge' (and wait until it completes)
End Condition
Pause 0.1 seconds
RETALIATE
Begin Date Compare : [Retaliate] Is Before Current Date/Time
    Execute command, 'Retaliate' (and wait until it completes)
End Condition
Pause 0.1 seconds
RUIN
Begin Date Compare : [Ruin] Is Before Current Date/Time
    Execute command, 'Ruin' (and wait until it completes)
End Condition
Pause 0.1 seconds
CONCUSSION
Begin Date Compare : [Concussion] Is Before Current Date/Time
    Execute command, 'Concussion' (and wait until it completes)
End Condition
Pause 0.1 seconds
VITAL TRIGGER VITAL TRIGGER VITAL TRIGGER 3
VITAL TRIGGER
Begin Date Compare : [Vitaltrigger] Is Before Current Date/Time
    Execute command, 'Vital Trigger' (and wait until it completes)
End Condition
Pause 0.1 seconds
SNEERING ASSAULT
Begin Date Compare : [Sneeringassault] Is Before Current Date/Time
    Execute command, 'Sneering Assault' (and wait until it completes)
End Condition
Pause 0.1 seconds
PRECISE STRIKE
Begin Date Compare : [Precisestrike] Is Before Current Date/Time
    Execute command, 'Precise Strike' (and wait until it completes)
End Condition
Pause 0.1 seconds
SEVER
Begin Date Compare : [Sever] Is Before Current Date/Time
    Execute command, 'Sever' (and wait until it completes)
End Condition
Pause 0.1 seconds
GUT KICK
Begin Date Compare : [Gutkick] Is Before Current Date/Time
    Execute command, 'Gut Kick' (and wait until it completes)
End Condition
Pause 0.1 seconds
OVERPOWER
Begin Date Compare : [Overpower] Is Before Current Date/Time
    Execute command, 'Overpower' (and wait until it completes)
End Condition
Pause 0.1 seconds
TAUNTING BLOW
Begin Date Compare : [Tauntingblow] Is Before Current Date/Time
    Execute command, 'Taunting Blow' (and wait until it completes)
End Condition
Pause 0.1 seconds
COMBO EXTENDER COMBO EXTENDER COMBO EXTENDER
IRRESISTABLE
Begin Date Compare : [Irresistable] Is Before Current Date/Time
    Execute command, 'Irresistable' (and wait until it completes)
End Condition
Pause 0.1 seconds
TAUNTING ASSAULT
Begin Date Compare : [Tauntingassault] Is Before Current Date/Time
    Execute command, 'Taunting Assault' (and wait until it completes)
End Condition
Pause 0.1 seconds
Say, 'Starting loop'
Start Loop : Repeat 200 Times
    PRIORITY START PRIORITY START PRIORITY START PRIORITY START PRIORITY START PRIORITY START PRIORITY START
    BATTLE CRY
    Begin Date Compare : [Battlecry] Is Before Current Date/Time
        Execute command, 'Battle Cry' (and wait until it completes)
    End Condition
    Pause 0.1 seconds
    REINFORCEMENT
    Begin Date Compare : [Reinforcement] Is Before Current Date/Time
        Execute command, 'Reinforcement' (and wait until it completes)
    End Condition
    Pause 0.1 seconds
    PLANT
    Begin Date Compare : [Plant] Is Before Current Date/Time
        Execute command, 'Plant' (and wait until it completes)
    End Condition
    Pause 0.1 seconds
    VITAL TRIGGER
    Begin Date Compare : [Vitaltrigger] Is Before Current Date/Time
        Execute command, 'Vital Trigger' (and wait until it completes)
    End Condition
    Pause 0.1 seconds
    IRRESISTABLE
    Begin Date Compare : [Irresistable] Is Before Current Date/Time
        Execute command, 'Irresistable' (and wait until it completes)
    End Condition
    Pause 0.1 seconds
    PARTISAN CLEAVE
    Begin Date Compare : [Partisancleave] Is Before Current Date/Time
        Execute command, 'Partisan Cleave' (and wait until it completes)
    End Condition
    Pause 0.1 seconds
    PROVOKE
    Begin Date Compare : [Provoke] Is Before Current Date/Time
        Execute command, 'Provoke' (and wait until it completes)
    End Condition
    Pause 0.1 seconds
    SENTINAL STRIKE
    Begin Date Compare : [Sentinalstrike] Is Before Current Date/Time
        Execute command, 'Sentinal Strike' (and wait until it completes)
    End Condition
    Pause 0.1 seconds
    DECIMATE
    Begin Date Compare : [Decimate] Is Before Current Date/Time
        Execute command, 'Decimate' (and wait until it completes)
    End Condition
    Pause 0.1 seconds
    SHOUT
    Begin Date Compare : [Shout] Is Before Current Date/Time
        Execute command, 'Shout' (and wait until it completes)
    End Condition
    Pause 0.1 seconds
    SLAM
    Begin Date Compare : [Slam] Is Before Current Date/Time
        Execute command, 'Slam' (and wait until it completes)
    End Condition
    Pause 0.1 seconds
    DEFENDERS CHARGE
    Begin Date Compare : [Defenderscharge] Is Before Current Date/Time
        Execute command, 'Defenders Charge' (and wait until it completes)
    End Condition
    Pause 0.1 seconds
    RETALIATE
    Begin Date Compare : [Retaliate] Is Before Current Date/Time
        Execute command, 'Retaliate' (and wait until it completes)
    End Condition
    Pause 0.1 seconds
    RUIN
    Begin Date Compare : [Ruin] Is Before Current Date/Time
        Execute command, 'Ruin' (and wait until it completes)
    End Condition
    Pause 0.1 seconds
    CONCUSSION
    Begin Date Compare : [Concussion] Is Before Current Date/Time
        Execute command, 'Concussion' (and wait until it completes)
    End Condition
    Pause 0.1 seconds
    SNEERING ASSAULT
    Begin Date Compare : [Sneeringassault] Is Before Current Date/Time
        Execute command, 'Sneering Assault' (and wait until it completes)
    End Condition
    Pause 0.1 seconds
    PRECISE STRIKE
    Begin Date Compare : [Precisestrike] Is Before Current Date/Time
        Execute command, 'Precise Strike' (and wait until it completes)
    End Condition
    Pause 0.1 seconds
    SEVER
    Begin Date Compare : [Sever] Is Before Current Date/Time
        Execute command, 'Sever' (and wait until it completes)
    End Condition
    Pause 0.1 seconds
    BASH
    Begin Date Compare : [Bash] Is Before Current Date/Time
        Execute command, 'Bash' (and wait until it completes)
    End Condition
    Pause 0.1 seconds
    GUT KICK
    Begin Date Compare : [Gutkick] Is Before Current Date/Time
        Execute command, 'Gut Kick' (and wait until it completes)
    End Condition
    Pause 0.1 seconds
    ACCELERATION STRIKE NEW
    Begin Date Compare : [Accelerationstrikenew] Is Before Current Date/Time
        Execute command, 'Acceleration Strike new' (and wait until it completes)
    End Condition
    Pause 0.1 seconds
    OVERPOWER
    Begin Date Compare : [Overpower] Is Before Current Date/Time
        Execute command, 'Overpower' (and wait until it completes)
    End Condition
    Pause 0.1 seconds
    TAUNTING ASSAULT
    Begin Date Compare : [Tauntingassault] Is Before Current Date/Time
        Execute command, 'Taunting Assault' (and wait until it completes)
    End Condition
    Pause 0.1 seconds
    ASSAULT
    Begin Date Compare : [Assault] Is Before Current Date/Time
        Execute command, 'Assault' (and wait until it completes)
    End Condition
    Pause 0.1 seconds
    DRAGOON SPIN
    Begin Date Compare : [Dragoonspin] Is Before Current Date/Time
        Execute command, 'Dragoon Spin' (and wait until it completes)
    End Condition
    Pause 0.1 seconds
    TAUNTING BLOW
    Begin Date Compare : [Tauntingblow] Is Before Current Date/Time
        Execute command, 'Taunting Blow' (and wait until it completes)
    End Condition
    Pause 0.1 seconds
    STRIKE OF CONSISTENCY
    Begin Date Compare : [Strikeofconsistency] Is Before Current Date/Time
        Execute command, 'Strike of consistency' (and wait until it completes)
    End Condition
    Pause 0.1 seconds
    MANA STONE MANA STONE MANA STONE
    Execute command, 'Manastone' (and wait until it completes)
    Begin Device State Check :  Keyboard Key 'Numeric 1' Is Pressed
        Jump to Marker: jump to ascension
        Say, 'jumping to ascensions'
    End Condition
End Loop
Marker: jump to ascension
COMPOUNDING FORCE
Begin Date Compare : [Compoundingforce] Is Before Current Date/Time
    Execute command, 'Compounding Force' (and wait until it completes)
End Condition
Pause 0.1 seconds
LEVINBOLT
Begin Date Compare : [Levinbolt] Is Before Current Date/Time
    Execute command, 'Levinbolt' (and wait until it completes)
End Condition
Pause 0.1 seconds
FOCUSED BLAST
Begin Date Compare : [Focusedblast] Is Before Current Date/Time
    Execute command, 'Focused Blast' (and wait until it completes)
    Execute command, 'Levinbolt' (and wait until it completes)
End Condition
Pause 0.1 seconds
CASCADING FORCE
Begin Date Compare : [Cascadingforce] Is Before Current Date/Time
    Execute command, 'Cascading Force' (and wait until it completes)
End Condition
Pause 0.1 seconds
Implosion
Begin Date Compare : [Implosion] Is Before Current Date/Time
    Execute command, 'Implosion' (and wait until it completes)
End Condition
Pause 0.1 seconds
ETHERFLASH
Begin Date Compare : [Etherflash] Is Before Current Date/Time
    Execute command, 'Etherflash' (and wait until it completes)
End Condition
Pause 0.1 seconds
FEEDBACK LOOP
Begin Date Compare : [Feedbackloop] Is Before Current Date/Time
    Execute command, 'Feedback Loop' (and wait until it completes)
End Condition
Pause 0.1 seconds
Say, 'Hold right trigger to extend'
Pause 2 seconds
Begin Device State Check :  Keyboard Key 'Numeric 9' Is Pressed
    Say, 'extended'
    Execute command, 'Veilwalkers Energy Inverter' (and wait until it completes)
    Execute command, 'Academics Essence of Power' (and wait until it completes)
    Say, 'fast smash finished'
Else
    Say, 'fast smash finished'
End Condition

SKILL COMMAND

Code: [Select]
Begin Condition : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '2 @' Is Pressed)
    Execute command, 'Bulwark of Order' (and wait until it completes)
Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '5 %' Is Pressed)
    Execute command, 'Champions Interception' (and wait until it completes)
Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '4 $' Is Pressed)
    Execute command, 'Guardian Sphere' (and wait until it completes)
Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '3 #' Is Pressed)
    Execute command, 'Sentry Watch' (and wait until it completes)
Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '7 &' Is Pressed)
    Execute command, 'Defensive Minded' (and wait until it completes)
Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '6 ^' Is Pressed)
    Execute command, 'Tower of Stone' (and wait until it completes)
Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '9 (' Is Pressed)
    Execute command, 'Stand Firm' (and wait until it completes)
Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '9 (' Is Pressed)
    Execute command, 'Perfect Counter' (and wait until it completes)
Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '9 (' Is Pressed)
    Execute command, 'Focused Offensive' (and wait until it completes)
Else
    Say, 'bashing'
    Press 1 key and hold for 0.1 seconds and release
    Pause 0.25 seconds
    Pause 0.25 seconds
    Pause 0.1 seconds
    Set date [Bash] to [Bash] plus [12] seconds (save value to profile)
End Condition

I started to see if I could just house everything in one command and this is what I have so far. This one seems to work sometimes. However only once. Then I have to shut voice attack down and relaunch it. Sometimes it hangs on bash.

Code: [Select]
Start Loop : Repeat 75 Times
    Begin Date Compare : [Partisan] Is Before Current Date/Time
        Begin Condition : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '2 @' Is Pressed)
            Execute command, 'Bulwark of Order' (and wait until it completes)
        Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '5 %' Is Pressed)
            Execute command, 'Champions Interception' (and wait until it completes)
        Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '4 $' Is Pressed)
            Execute command, 'Guardian Sphere' (and wait until it completes)
        Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '3 #' Is Pressed)
            Execute command, 'Sentry Watch' (and wait until it completes)
        Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '7 &' Is Pressed)
            Execute command, 'Defensive Minded' (and wait until it completes)
        Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '6 ^' Is Pressed)
            Execute command, 'Tower of Stone' (and wait until it completes)
        Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '9 (' Is Pressed)
            Execute command, 'Stand Firm' (and wait until it completes)
        Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '9 (' Is Pressed)
            Execute command, 'Perfect Counter' (and wait until it completes)
        Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '9 (' Is Pressed)
            Execute command, 'Focused Offensive' (and wait until it completes)
        Else
            Say, 'cleaving'
            Press 4 key and hold for 0.1 seconds and release
            Pause 0.5 seconds
            Pause 0.25 seconds
            Pause 0.1 seconds
            Set date [Partisan] to [Partisan] plus [1] minutes
            Write [Blue] 'Partisan' to log
        End Condition
    End Condition
    Pause 0.1 seconds
    Begin Date Compare : [Decimate] Is Before Current Date/Time
        Begin Condition : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '2 @' Is Pressed)
            Execute command, 'Bulwark of Order' (and wait until it completes)
        Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '5 %' Is Pressed)
            Execute command, 'Champions Interception' (and wait until it completes)
        Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '4 $' Is Pressed)
            Execute command, 'Guardian Sphere' (and wait until it completes)
        Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '3 #' Is Pressed)
            Execute command, 'Sentry Watch' (and wait until it completes)
        Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '7 &' Is Pressed)
            Execute command, 'Defensive Minded' (and wait until it completes)
        Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '6 ^' Is Pressed)
            Execute command, 'Tower of Stone' (and wait until it completes)
        Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '9 (' Is Pressed)
            Execute command, 'Stand Firm' (and wait until it completes)
        Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '9 (' Is Pressed)
            Execute command, 'Perfect Counter' (and wait until it completes)
        Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '9 (' Is Pressed)
            Execute command, 'Focused Offensive' (and wait until it completes)
        Else
            Say, 'decimating'
            Press 6 key and hold for 0.1 seconds and release
            Pause 0.25 seconds
            Pause 0.25 seconds
            Pause 0.1 seconds
            Set date [Decimate] to [Decimate] plus [31] seconds
            Write [Red] 'Decimate' to log
        End Condition
    End Condition
    Pause 0.1 seconds
    Begin Date Compare : [Bash] Is Before Current Date/Time
        Begin Condition : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '2 @' Is Pressed)
            Execute command, 'Bulwark of Order' (and wait until it completes)
        Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '5 %' Is Pressed)
            Execute command, 'Champions Interception' (and wait until it completes)
        Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '4 $' Is Pressed)
            Execute command, 'Guardian Sphere' (and wait until it completes)
        Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '3 #' Is Pressed)
            Execute command, 'Sentry Watch' (and wait until it completes)
        Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '7 &' Is Pressed)
            Execute command, 'Defensive Minded' (and wait until it completes)
        Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '6 ^' Is Pressed)
            Execute command, 'Tower of Stone' (and wait until it completes)
        Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '9 (' Is Pressed)
            Execute command, 'Stand Firm' (and wait until it completes)
        Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '9 (' Is Pressed)
            Execute command, 'Perfect Counter' (and wait until it completes)
        Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '9 (' Is Pressed)
            Execute command, 'Focused Offensive' (and wait until it completes)
        Else
            Say, 'bashing'
            Press 1 key and hold for 0.1 seconds and release
            Pause 0.25 seconds
            Pause 0.25 seconds
            Pause 0.1 seconds
            Set date [Bash] to [Bash] plus [11] seconds
            Write [Green] 'Bash' to log
        End Condition
    End Condition
End Loop
Say, 'all loops finished'

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
I don’t know how to get the write a value feature to display my variables as time
Use the relevant tokens for the variable type you want to display the value of.

The "Date" type has a number of options, as it is a representation of a point in time, and you can choose which parts you're interested in (E.G. usually the year isn't that relevant, so you can exclude that).

the "{TIMESTAMP:}" token will display pretty much everything, though not in the most human-readable format.

To get the data you want, have a look at the "{DATETIMEFORMAT:}" token, so you can choose for yourself (assuming there isn't a pre-existing token that displays what you need).
The syntax can be found here.


Code: [Select]
Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '9 (' Is Pressed)
    Execute command, 'Stand Firm' (and wait until it completes)
Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '9 (' Is Pressed)
    Execute command, 'Perfect Counter' (and wait until it completes)
Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '9 (' Is Pressed)
    Execute command, 'Focused Offensive' (and wait until it completes)
This will always execute the first of these itself of both statements are true, thus making the other two unreachable.


Code: [Select]
    Set date [Bash] to [Bash] plus [12] seconds (save value to profile)
Does this take into account the time the action takes to execute, and the point within the loop where it executes?

You're adding twelve seconds to the previous value set to that date variable, not to the current time, so any variation in the actual timing will offset value, and it will drift more and more in this way with each cycle.

You'll want to set the value to the current time first, then add the timeout to that point, as you presumably do initially as well.



I'm also not quite sure why you have 100ms delay between each check, including inside the loop, especially as you're waiting for commands to finish executing anyway.
Not that you shouldn't have any delay (though the multi-second total you have currently is way more than required), but I'd put that into one action at the start or end of the loop, not sprinkled in between.

Usidor

  • Newbie
  • *
  • Posts: 10

The synrax can be found here.

Thanks for this.


Code: [Select]
Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '9 (' Is Pressed)
    Execute command, 'Stand Firm' (and wait until it completes)
Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '9 (' Is Pressed)
    Execute command, 'Perfect Counter' (and wait until it completes)
Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '9 (' Is Pressed)
    Execute command, 'Focused Offensive' (and wait until it completes)
This will always execute the first of these itself of both statements are true, thus making the other two unreachable.

Yep, duplicated lines that I didn't change. Thanks for that. Even the tires on this one suck ;)

Code: [Select]
    Set date [Bash] to [Bash] plus [12] seconds (save value to profile)
Does this take into account the time the action takes to execute, and the point within the loop where it executes?

You're adding twelve seconds to the previous value set to that date variable, not to the current time, so any variation in the actual timing will offset value, and it will drift more and more in this way with each cycle.

You'll want to set the value to the current time first, then add the timeout to that point, as you presumably do initially as well.

This may be the seed of my folly. I'm not sure.

My assumptions due to unknowns

Time is managed through the skill command.

Assumption is that voice attack will process the entire Skill Command which has 3 separate pauses. The skill command presses the proper in game button. The first pause is the listed cast time on in game skill .25, second pause is recovery time .25, recovery time is time attached at the end of cast time which keeps the character from doing any other actions, including casting the next skill. The third pause .1 is lack of knowledge thinking maybe I need just a little slack on each process for lag or the boogie man. Or maybe the code is like a train bunching up on the tracks. Your inquiry makes me realize that is naive =)

So thats how the extra extra slack ended up in the main Combo Command.
 
Next assumption

The date/time variable works like a stamp. Every time the code reaches the skill and executes it voice attack stamps the current time plus the extra seconds added in the menu.

Shield Bash Skill fires and registers stamp, code continues and casts other avaialble skills, loop comes back and skips Shield Bash because the current stamp says its to early, no new stamp is created because Shield Bash is not executed., code continues around but this time reads that Shield Bash stamp says its ready and fires, loop continues etc..

Pfeil
You're adding twelve seconds to the previous value set to that date variable, not to the current time, so any variation in the actual timing will offset value, and it will drift more and more in this way with each cycle.

You'll want to set the value to the current time first, then add the timeout to that point, as you presumably do initially as well.


The drift you describe is present. Integrity gets pretty bad around the 2.5 - 3 min mark. I am still trying to take in your comments on this. I haven't connected the "mechanical" dots here if you will. Not sure what in the settings/code I need to adjust. As you can probably easily see from the code and my assumptions.



I'm also not quite sure why you have 100ms delay between each check, including inside the loop, especially as you're waiting for commands to finish executing anyway.
Not that you shouldn't have any delay (though the multi-second total you have currently is way more than required), but I'd put that into one action at the start or end of the loop, not sprinkled in between.
[/quote]

Usidor

  • Newbie
  • *
  • Posts: 10
I think I understand what you mean now by reseting to current time.

I was confused, I thought I had to find an option in the variable window for both setting current then adding.

I used two different lines. I believe that is one realization I needed to come to.

Thanks to you I may get another 3 years out of these hands. Thank you kindly sir. You are a blessing.

Code: [Select]
Begin Condition : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '2 @' Is Pressed)
    Execute command, 'Bulwark of Order' (and wait until it completes)
Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '5 %' Is Pressed)
    Execute command, 'Champions Interception' (and wait until it completes)
Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '4 $' Is Pressed)
    Execute command, 'Guardian Sphere' (and wait until it completes)
Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '3 #' Is Pressed)
    Execute command, 'Sentry Watch' (and wait until it completes)
Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '7 &' Is Pressed)
    Execute command, 'Defensive Minded' (and wait until it completes)
Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '6 ^' Is Pressed)
    Execute command, 'Tower of Stone' (and wait until it completes)
Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '9 (' Is Pressed)
    Execute command, 'Stand Firm' (and wait until it completes)
Else If : (Keyboard Key 'Shift' Is Pressed AND Keyboard Key '8 *' Is Pressed)
    Execute command, 'Perfect Counter' (and wait until it completes)
Else If : (Keyboard Key 'Alt' Is Pressed AND Keyboard Key 'Ctrl' Is Pressed AND Keyboard Key '2 @' Is Pressed)
    Execute command, 'Focused Offensive' (and wait until it completes)
Else
    Say, 'bashing'
    Press 1 key and hold for 0.1 seconds and release
    Pause 0.25 seconds
    Pause 0.25 seconds
    Pause 0.1 seconds
    Set date [Bash] value to the current date/time
    Set date [Bash] to [Bash] plus [12] seconds
End Condition


Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Every time the code reaches the skill and executes it voice attack stamps the current time plus the extra seconds added in the menu.
It does not. You need to manually set the time to the current time again, then add the new interval.


Again, you are adding a set amount of time to a previous set amount of time.

E.G. if you start at 00:00, the first command executes, and takes 700ms to get to the point where the date value is added to.
The date value is now set to 12 seconds past 00:00, 700ms short of where the cooldown will end.

Next cycle, add, say, 500ms (as your loop has a bunch of pauses in it you can't be sure when it'll actually come to the relevant check) before the command is actually executed.
Again it takes 700ms for the command to execute, and 12 seconds are added to the date value.
The date value is now set to 24 seconds past 00:00, 1.9 seconds short of where the cooldown will end.

The longer your command runs, the bigger the time deficit becomes.



I used two different lines. I believe that is one realization I needed to come to.
That is the intent, yes.