Chre903

ComputerCraft Asking programm

Jun 5th, 2013
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. function clear()
  2. term.clear()
  3. term.setCursorPos(1,1)
  4. end
  5.  
  6. function getAction()
  7. write("Please enter: ")
  8. ask = read()
  9. end
  10.  
  11. function done()
  12. local ask = 0
  13. end
  14.  
  15. function key()
  16. bRead = true
  17. print(" ")
  18. print(" ")
  19. print("Press any Key to Continue")
  20. while(bRead) do
  21. local sEvent, param = os.pullEvent("key")
  22. if(sEvent == "key") then
  23. clear()
  24. done()
  25. talk()
  26. getAction()
  27. break
  28. end
  29. end
  30. end
  31.  
  32. function talk()
  33. print("1 Where are we now?")
  34. print("2 What i am supposed to do?")
  35. print("3 How am i supposed to do something?")
  36. print("4 Can't i go back?")
  37. print("5 What do you mean with Bonus?")
  38. print(" ")
  39. end
  40.  
  41. clear()
  42. done()
  43.  
  44. print("To Ask Villager #4 a Question, type in the Number of the Question.")
  45. print(" ")
  46. talk()
  47.  
  48. getAction()
  49.  
  50. while true do
  51. if ask == "1" then
  52. clear()
  53. print("We are on the Sphere called Nasci. Once it was supposed to hold Flora and Fauna, but due to the missing maintaining of the Humanity, not everything was able to survive.")
  54. print("But still, i am happy that some Animals and Plants survived...")
  55. key()
  56. elseif ask == "2" then
  57. clear()
  58. print("Shouldn't you know that, Captain?")
  59. print("Whatever. We need Resources to rebuild Humanity and to repair the Jumpgate.")
  60. print("You can see what we need on the Monitor.")
  61. key()
  62. elseif ask == "3" then
  63. clear()
  64. print("Well... We brought some Resources with us, but only with that, it could get hard to gather everything we need.")
  65. print("I think you should search for some more stuff in this Sphere. I bet here is more than we can see.")
  66. key()
  67. elseif ask == "4" then
  68. clear()
  69. print("Out arriving here, destroyed the very old and already damaged Parts of the Jumpgate. We can repair it, but we need a bit time and Resources.")
  70. key()
  71. elseif ask == "5" then
  72. clear()
  73. print("Like Secondary targets. When you gather more then we need, we can Achieve more, or when you find something special we can use, could it help us in a different way.")
  74. print("But we don't have time to waste. When you do thing that is not good for our targets, it can damage us too.")
  75. key()
  76. else
  77. clear()
  78. print("What did you say?")
  79. key()
  80. end
  81. end
Advertisement
Add Comment
Please, Sign In to add comment