Advertisement
wirawafiy1

Error fix

Jul 22nd, 2023
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. global runLoop is true.
  2.  
  3. function main {
  4. local desiredSpeed is 5.
  5.  
  6. until not runLoop {
  7. if (abs(ship:velocity:surface:mag - desiredSpeed) > 1.0) {
  8. set throttle to 0.
  9. wait 1.
  10. set throttle to 0.5.
  11. wait 1.
  12. if (abs(ship:velocity:surface:mag - desiredSpeed) < 1.0) {
  13. set throttle to 1.
  14. } else {
  15. set throttle to 0.
  16. print "Wheel slip error! Unable to fix."
  17. }
  18. }
  19.  
  20. wait 0.1.
  21. }
  22. }
  23.  
  24. function stopLoop {
  25. set runLoop to false.
  26. }
  27.  
  28. run main.
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement