Skip to content

Instantly share code, notes, and snippets.

@qoh
Last active May 4, 2016 20:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qoh/19d4e23a58c6a6943bd34ea195b8afa6 to your computer and use it in GitHub Desktop.
Save qoh/19d4e23a58c6a6943bd34ea195b8afa6 to your computer and use it in GitHub Desktop.
function autoJetTick(%pos_desired)
{
cancel($autoJetTick);
if (!isObject(ServerConnection))
return;
%control = ServerConnection.getControlObject();
if (!isObject(%control))
return;
%pos_current = getWord(%control.getPosition(), 2);
%vel_current = getWord(%control.getVelocity(), 2);
%vel_desired = %pos_desired - %pos_current;
$mvTriggerCount4 = %vel_current < %vel_desired;
$autoJetTick = schedule(1, 0, autoJetTick, %pos_desired);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment