Advertisement
MrLetsplay2003

Jump IT Menu (Lua/Computercraft)

May 1st, 2015
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.86 KB | None | 0 0
  1. --Here is the Menu for "Jump IT" you can download "Jump IT" at: pastebin.com/bwgdUqqP
  2. --UPDATE!!!: ADDED INSTALLER: pastebin.com/hPg7L2QY
  3. function PrintMenu()
  4. shell.run("clear")
  5. print("Select one")
  6. print()
  7. print()
  8. print("x-New Game")
  9. print("x-Exit")
  10. print("x-Highscore")
  11. end
  12.  
  13. PrintMenu()
  14.  
  15. while true do
  16. event,lol,x,y,z = os.pullEvent("mouse_click")
  17. if y == 4 and x == 1 then
  18. shell.run("clear")
  19. shell.run("Jump")
  20. break
  21. elseif y==5 and x==1 then
  22. shell.run("clear")
  23. break
  24. elseif y==6 and x==1 then
  25. write("Whose highscore? ")
  26. name=io.read()
  27. file = fs.open("score/"..name,"r")
  28. local fileData = {}
  29. local line = file.readLine()
  30. repeat
  31. table.insert(fileData,line)
  32. line = file.readLine()
  33. until line == nil
  34. file.close()
  35. local Highscore = fileData[1]
  36. print("The player has completed "..Highscore.." Jumps")
  37. sleep(3)
  38. shell.run("clear")
  39. PrintMenu()
  40. end
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement