Advertisement
wirawafiy1

Tutorial for the newbies

Jun 5th, 2023 (edited)
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. set terminal to false.
  2.  
  3. set tutorial_active to false.
  4. set tutorial_commands to "/me list - Lists available programs\n" +
  5. "/me run <program_name> - Runs a specific program\n" +
  6. "/me tutorial - Displays the Twitch Plays KSP Guide\n" +
  7. "/me exit - Exits the tutorial"
  8.  
  9. set tutorial_text to "Welcome to Twitch Plays KSP Tutorial!\n" +
  10. "You can control the rocket by entering commands in Twitch Chat.\n" +
  11. "Use the following commands:\n" +
  12. tutorial_commands
  13.  
  14. lock throttle to 0.
  15.  
  16. run main.
  17.  
  18. function main {
  19. wait until terminal {
  20. set user_input to terminal_input().
  21.  
  22. if user_input = "/me tutorial" {
  23. set tutorial_active to true
  24. print tutorial_text
  25. }
  26. else if user_input = "/me exit" {
  27. set terminal to false
  28. set tutorial_active to false
  29. }
  30. else {
  31. execute_command(user_input)
  32. }
  33. }
  34. }
  35.  
  36. function terminal_input {
  37. print "Enter your command or type 'exit' to quit: "
  38. set input_line to readline().
  39. return input_line.
  40. }
  41.  
  42. function execute_command {
  43. parameter command.
  44. print "Executing command: " + command
  45. set user_input to "/me " + command
  46. execute user_input.
  47. }
  48.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement