Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global runLoop is true.
- function main {
- local desiredSpeed is 5.
- until not runLoop {
- if (abs(ship:velocity:surface:mag - desiredSpeed) > 1.0) {
- set throttle to 0.
- wait 1.
- set throttle to 0.5.
- wait 1.
- if (abs(ship:velocity:surface:mag - desiredSpeed) < 1.0) {
- set throttle to 1.
- } else {
- set throttle to 0.
- print "Wheel slip error! Unable to fix."
- }
- }
- wait 0.1.
- }
- }
- function stopLoop {
- set runLoop to false.
- }
- run main.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement