Skip to content

Instantly share code, notes, and snippets.

@numberlesstim
Last active August 12, 2024 14:40
Show Gist options
  • Save numberlesstim/c32f2b01e638c61cd4649a905e1dba1b to your computer and use it in GitHub Desktop.
Save numberlesstim/c32f2b01e638c61cd4649a905e1dba1b to your computer and use it in GitHub Desktop.
//gist c32f2b01e638c61cd4649a905e1dba1b
parameter _deltaTime is 60.
local tx is -1.
local tb is "none".
if orbit:hasnextpatch {
set tx to time:seconds + eta:transition + _deltaTime.
set tb to orbit:nextpatch:body:name.
}
set warpmode to "rails".
set warp to 1.
wait until kuniverse:timewarp:issettled.
if tx > 0 OR orbit:hasnextpatch {
set tx to choose tx if tx > 0 else time:seconds + eta:transition + _deltaTime.
set tb to choose tb if tb <> "none" else orbit:nextpatch:body:name.
print "Warping to " + _deltaTime + " seconds inside of " + tb + " soi.".
warpto(timestamp(tx):seconds).
}
else {
print "Could not find any transition. Cannot warp!".
set warp to 0.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment