Author Topic: Jump state -Hyperjump  (Read 7685 times)

sutex

  • Jr. Member
  • **
  • Posts: 91
Jump state -Hyperjump
« on: August 28, 2016, 10:23:25 AM »
NEW UPDATED VERSION CODE BELOW 13/9/2016
I'm tying to have a single command for SAY ' JUMP '. I need to have my Afterburner below keep tabs of those states, that is,

Start my route into hyperspace 'JUMP' to the next system, and continue 'JUMP' to each to system on route and finally when approaching a station ( blue safe to disengage ), saying 'JUMP' to enter normal space.

Supercruise command , has only two states , so works, but the JUMP hyperjump is the problem.

My Vap profile , is nearly finished  but this one JUMP command does all , has eluded me for ages
 I hoping with the new function in VA , it may now be possible or am I dreaming.

Afterburner command , it works well.
((power to flight)) all power too engines rest too systems ,it only fires once as the afterburner ( key pressing ) keeps boosting.

Code: [Select]
Begin Small Integer Compare : [docking] Equals 0
    Begin Small Integer Compare : [supercruise] Equals 0
        Begin Small Integer Compare : [jump-drive] Equals 0
            Begin Small Integer Compare : [cargo-scoop] Does Not Equal 0
                Execute command, 'Retract scoop;Retract cargo scoop (and wait until it completes)
                Set small int (condition) [cargo-scoop] value to 0
                Begin Small Integer Compare : [landing-gear] Does Not Equal 0
                    Execute command, 'Retract landing gear (and wait until it completes)
                    Set small int (condition) [landing-gear] value to 0
                End Condition
            End Condition
            Begin Small Integer Compare : [flight] Equals 0
                Execute command, '((Power to Flight))' (and wait until it completes)
                Say, 'PIPS'
                Set small int (condition) [flight] value to 1
            End Condition
            Execute command, '((100%))' (and wait until it completes)
            Execute command, '((Afterburners))' (and wait until it completes)
            Execute command, '((RS- Afterburners))' (and wait until it completes)
        End Condition
    End Condition
End Condition - Exit when condition met
Begin Small Integer Compare : [docking] Equals 1
End Condition - Exit when condition met

UPDATED 13 of SEPT ..

Ok this is what I have now , took ages for the penny to drop, did try using EDDI before,  but thanks to
TetleyK and his Elite EDDI-VA Jump Counter profile,  it gave me an idea ! of how to manipulate VA via EDDI and not the other way around, as in my previous attempts , below 

((EDDI: event handler for change of environment))

Code: [Select]
Begin Text Compare : [Environment] Equals 'Normal space'
    Set Text [EDDI environment script] to '$= is [entering;dropping to] normal space.'
    Set small int (condition) [jump-drive] value to 0
    Set small int (condition) [supercruise] value to 0
    Set small int (condition) [flight] value to 0
    Set small int (condition) [power-fsd] value to 0
Else If Text Compare : [Environment] Equals 'Supercruise'
    Set Text [EDDI environment script] to '$= is [entering;jumping to] supercruise.'
    Execute command, '((Power to fsd))' (and wait until it completes)
    Set small int (condition) [power-fsd] value to 1
    Set small int (condition) [flight] value to 1
    Set small int (condition) [supercruise] value to 1
    Set small int (condition) [jump-drive] value to 0
End Condition
Execute external plugin, 'EDDI 1.4.0'
Set Text [EDDI environment script] to [Not Set]

((EDDI: event handler for change of system))
Code: [Select]
Set Text [EDDI system script] to 'Destination confirmed.  $= '
Set Text [EDDI system script] to '[Destination confirmed;Jump in progress;Telemetry obtained].  $= is [heading; on route;travelling;in transit] to [the {TXT:System name (sp...
Set small int (condition) [supercruise] value to 1
Set small int (condition) [jump-drive] value to 1
Set small int (condition) [power-fsd] value to 1
Begin Text Compare : [Home system] Has Been Set
    Begin Text Compare : [System name] Equals [Home system]
        Set Text [EDDI system script] to '{TXT:EDDI system script} Welcome home[, {TXT:System rank};].'
        Execute external plugin, 'EDDI 1.4.0' and wait for return
        Set Text [EDDI system script] to [Not Set]
    End Condition - Exit when condition met
End Condition
Begin Decimal Compare : [System population] Is Greater Than 0
    Begin Text Compare : [Last system allegiance] Has Been Set
        Begin Text Compare : [System allegiance] Does Not Equal [Last system allegiance]
            Set Text [EDDI system script] to '{TXT:EDDI system script} You [are now in;have entered] {TXT:System allegiance} space.'
            Begin Text Compare : [System rank] Does Not Equal 'Commander'
                Set Text [EDDI system script] to '{TXT:EDDI system script} Welcome back {TXT:System rank}.'
            End Condition
        End Condition
    End Condition
End Condition
Begin Integer Compare : [System visits] Equals 1
    Set Text [EDDI system script] to '{TXT:EDDI system script} This is your first visit to this system.'
    Set small int (condition) [jump-drive] value to 0
    Set small int (condition) [supercruise] value to 1
    Set small int (condition) [power-fsd] value to 1
Else If Integer Compare : [System visits] Equals 2
    Set Text [EDDI system script] to '{TXT:EDDI system script} This is your second visit to this system.'
    Set small int (condition) [jump-drive] value to 0
    Set small int (condition) [supercruise] value to 1
    Set small int (condition) [power-fsd] value to 1
Else If Integer Compare : [System visits] Equals 3
    Set Text [EDDI system script] to '{TXT:EDDI system script} This is your third visit to this system.'
    Set small int (condition) [jump-drive] value to 0
    Set small int (condition) [supercruise] value to 1
    Set small int (condition) [power-fsd] value to 1
Else If Integer Compare : [System visits] Equals 4
    Set Text [EDDI system script] to '{TXT:EDDI system script} This is your fourth visit to this system.'
    Set small int (condition) [jump-drive] value to 0
    Set small int (condition) [supercruise] value to 1
    Set small int (condition) [power-fsd] value to 1
Else
    Set Text [EDDI system script] to '{TXT:EDDI system script} You have visited this system {INT:System visits} times.'
    Set small int (condition) [jump-drive] value to 0
    Set small int (condition) [supercruise] value to 1
    Set small int (condition) [power-fsd] value to 1
End Condition
Execute external plugin, 'EDDI 1.4.0' and wait for return
Set Text [EDDI system script] to [Not Set]
Begin Decimal Compare : [System population] Is Greater Than 0
    Pick a system report; quicker is more likely
    Set integer [EDDI system blurb roll] value as random from 1 to 20
    Set integer [EDDI system blurb roll] to [EDDI system blurb roll] plus [{INT:System visits}]
    Begin Integer Compare : [EDDI system blurb roll] Is Less Than Or Equals 20
        Execute command, '((EDDI: star system report))' (and wait until it completes)
    Else If Integer Compare : [EDDI system blurb roll] Is Less Than Or Equals 40
        Execute command, '((EDDI: star system summary))' (and wait until it completes)
    Else
        Execute command, '((EDDI: star system overview))' (and wait until it completes)
    End Condition
    Set integer [EDDI system blurb roll] value to [Not Set]
    Execute command, '((EDDI: security presence report))' (and wait until it completes)
End Condition
Begin Text Compare : [EDDI plugin EDSM status] Equals 'Enabled'
    Begin Decimal Compare : [System X] Has Not Been Set
        Set Text [EDDI system script] to 'The co-ordinates for this system are unknown.'
        Execute external plugin, 'EDDI 1.4.0' and wait for return
        Set Text [EDDI system script] to [Not Set]
    End Condition
End Condition
Begin Text Compare : [System comment] Has Been Set
    Set Text [EDDI system script] to 'You made a [note;comment;remark] [on;for;about] this system.  It said {TXT:System comment}'
    Execute external plugin, 'EDDI 1.4.0' and wait for return
    Set Text [EDDI system script] to [Not Set]
End Condition

Jump Drive;Jump
Code: [Select]
Begin Small Integer Compare : [jump-drive] Equals 0
    Set small int (condition) [jump-drive] value to 0
    Set small int (condition) [supercruise] value to 0
    Execute command, '((Retract All))' (and wait until it completes)
    Pause 0.3 seconds
    Begin Small Integer Compare : [power-fsd] Equals 0
        Execute command, '((Power to fsd))' (and wait until it completes)
        Set small int (condition) [power-fsd] value to 1
        Set small int (condition) [flight] value to 1
    End Condition
    Execute command, '((100%))' (and wait until it completes)
    Pause 0.3 seconds
    Set small int (condition) [jump-drive] value to 1
    Set small int (condition) [supercruise] value to 1
    Set small int (condition) [power-fsd] value to 1
    Execute command, '((Jump Drive))' (and wait until it completes)
    Play random sound (6 items)
End Condition - Exit when condition met
Begin Small Integer Compare : [jump-drive] Equals 1
    Begin Small Integer Compare : [power-fsd] Equals 0
        Execute command, '((Power to fsd))' (and wait until it completes)
        Set small int (condition) [power-fsd] value to 1
        Set small int (condition) [flight] value to 1
    End Condition
    Execute command, '((100%))' (and wait until it completes)
    Pause 0.3 seconds
    Execute command, '((Jump Drive))' (and wait until it completes)
    Play random sound (6 items)
End Condition

This is all working , well so far ..lol .. the 'ONE' Jump Command

* Power to FSD    [power-fsd]   is all Pips to Systems rest Engines
* Power to flight   [flight]          is all all Pips to Engines rest Systems
« Last Edit: September 13, 2016, 08:36:14 AM by sutex »

Technomancer

  • Jr. Member
  • **
  • Posts: 98
  • I have a bad feeling about this...
Re: Jump state -Hyperjump
« Reply #1 on: August 28, 2016, 11:55:16 AM »
Man, I literally read this like 5 times, but I can't wrap my head around what it is your trying to do or what the problem is. I'm not talking about your code, I'm talking about your post.

Are you trying to keep track of how many times you press the "1" key or say "JUMP" on your way to your destination?  I'm thinking not, since I can see by your code you would know how to do that, so....

I'm probably reading it out of context. Sorry.

sutex

  • Jr. Member
  • **
  • Posts: 91
Re: Jump state -Hyperjump
« Reply #2 on: August 28, 2016, 10:47:05 PM »
UPDATED .. Jump Command

sutex

  • Jr. Member
  • **
  • Posts: 91
Re: Jump state -Hyperjump
« Reply #3 on: August 28, 2016, 11:06:18 PM »
Man, I literally read this like 5 times, but I can't wrap my head around what it is your trying to do or what the problem is. I'm not talking about your code, I'm talking about your post.

Are you trying to keep track of how many times you press the "1" key or say "JUMP" on your way to your destination?  I'm thinking not, since I can see by your code you would know how to do that, so....

I'm probably reading it out of context. Sorry.

How you came to think I was talking about '1' key when saying JUMP numerous times, is beyond me too , but I have modified the post, hope that helps
« Last Edit: August 28, 2016, 11:10:26 PM by sutex »

Technomancer

  • Jr. Member
  • **
  • Posts: 98
  • I have a bad feeling about this...
Re: Jump state -Hyperjump
« Reply #4 on: August 28, 2016, 11:28:34 PM »
Well, now you modified your post  :P, but I said something like "I want to use the One command JUMP..."  I thought "One" was the number key.

But, yeah, I'm not sure how you can get around that.  On a multiple JUMP route, you'll go from hyperspace to supercruise...then you need to go to hyperspace again and back down to supercruise, etc.

So, unless you can tell VA how many jumps you're making, I don't see a way for it to know you're on your last "JUMP" and the next "JUMP" command needs to be an exit from supercruise and not another jump to hyperspace.

I know you know all that, I'm just thinking out loud.

sutex

  • Jr. Member
  • **
  • Posts: 91
Re: Jump state -Hyperjump
« Reply #5 on: August 29, 2016, 12:42:57 AM »
There may be away , using EDDI ,  looking into it

 http://voiceattack.com/SMF/index.php?topic=240.0

After much testing, doing run , I'm now using this JUMP works well enough.
Have an interdiction command that sets [flight] & [fsd] conditions to zero, too

Code: [Select]
Set small int (condition) [supercruise] value to 0
Set small int (condition) [power-fsd] value to 0
Begin Small Integer Compare : [jump-drive] Equals 0
    Set small int (condition) [jump-drive] value to 0
    Execute command, '((Retract All))' (and wait until it completes)
    Pause 0.3 seconds
    Begin Small Integer Compare : [power-fsd] Equals 0
        Execute command, '((Power to fsd))' (and wait until it completes)
        Set small int (condition) [power-fsd] value to 1
        Set small int (condition) [flight] value to 0
    End Condition
    Execute command, '((100%))' (and wait until it completes)
    Set small int (condition) [flight] value to 0
    Execute command, '((Jump Drive))' (and wait until it completes)
    Set small int (condition) [flight] value to 1
    Set small int (condition) [jump-drive] value to 1
    Play random sound (6 items)
End Condition - Exit when condition met
Begin Small Integer Compare : [jump-drive] Equals 1
    Set small int (condition) [flight] value to 1
    Execute command, '((Jump Drive))' (and wait until it completes)
    Pause 5 seconds
    Set small int (condition) [flight] value to 0
    Play random sound (6 items)
    Set small int (condition) [jump-drive] value to 0
End Condition - Exit when condition met
Just for reference ,SuperCruise 
Code: [Select]
Begin Small Integer Compare : [supercruise] Equals 0
    Execute command, '((Power to fsd))' (and wait until it completes)
    Pause 0.3 seconds
    Execute command, '((100%))' (and wait until it completes)
    Execute command, '((Supercruise))' (and wait until it completes)
    Set small int (condition) [supercruise] value to 1
    Set small int (condition) [jump-drive] value to 1
    Set small int (condition) [flight] value to 1
    Play random sound (4 items)
    Pause 8 seconds
    Execute command, '((R-ESC))' (and wait until it completes)
End Condition - Exit when condition met
Begin Small Integer Compare : [supercruise] Equals 1
    Execute command, 'Disengage supercruise;Cancel supercruise;Disable supercruise;Disengage F T L drive;Disengage F T L;Disable F T L drive' (and wait until it completes)
    Pause 0.3 seconds
End Condition - Exit when condition met
« Last Edit: August 29, 2016, 06:28:19 PM by sutex »

Technomancer

  • Jr. Member
  • **
  • Posts: 98
  • I have a bad feeling about this...
Re: Jump state -Hyperjump
« Reply #6 on: August 29, 2016, 02:00:27 AM »
Yeah, I'm using EDDI. 

It does detect state changes, but when you drop from hyperspace to supercruise, it doesn't know if you're next "JUMP" is hyperspace to your next system on the route or if it's supposed to be the last drop from supercruise to your final destination.

I've been playing with it also, from a slightly different angle,  but if you find something, please share. :)

sutex

  • Jr. Member
  • **
  • Posts: 91
Re: Jump state -Hyperjump
« Reply #7 on: September 13, 2016, 08:26:46 AM »
Updated , read from top ...any suggestion to improve ...post away

bronney

  • Newbie
  • *
  • Posts: 12
Re: Jump state -Hyperjump
« Reply #8 on: September 29, 2017, 04:45:13 AM »
I am currently frying my noodles on what if you said jump, but want to cancel while the bar is charging.  Secondly, what if you said jump without a system selected.

sutex

  • Jr. Member
  • **
  • Posts: 91
Re: Jump state -Hyperjump
« Reply #9 on: September 29, 2017, 03:32:57 PM »
I am currently frying my noodles on what if you said jump, but want to cancel while the bar is charging.  Secondly, what if you said jump without a system selected.


I use EDDI with this 'Jump' code keeps track of states better

I have Cancel Jump, which is the main 'Jump' and Cancel Cruise.

If I say 'JUMP',  with no Planet selected , I will enter Supercruise

The base code above has not changed that much

I'm checking states Off On, with EDDI  ie entering normal space,
If anyone can write it out better given the new API Fronteir Data , go for it , A one Jump Command is good !