Advertisement
Guest User

startup

a guest
Apr 3rd, 2020
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.08 KB | None | 0 0
  1. --#load the touchpoint API
  2. os.loadAPI("touchpoint")
  3. os.sleep(1)
  4.  
  5. --# wrap the radar to the computer
  6. local p = peripheral.find("warpdriveRadar")
  7.     local x,y,z = p.getLocalPosition()
  8.     local rPosOK,dim,rPosX,rPosY,rPosZ,localdim = p.getGlobalPosition()
  9.     local text = x .. " "..y.." "..z
  10.     local ldim = localdim:gsub(" ","")
  11. --# initialize the planet instance set on the monitor
  12. local t = touchpoint.new("right")
  13.  
  14. --# Add planets
  15.     if ldim == "Hyperspace" then
  16. t:add("Galaxy Map V0.1", nil, 5, 2, 45, 2, colors.gray, colors.black)
  17. t:add("Currently in: "..localdim.." ", nil, 5, 4, 45, 4, colors.red, colors.black)
  18. t:add("Bogdaleos", nil, 5, 6, 17, 6, colors.green, colors.orange)
  19. t:add("Avalon", nil, 19, 6, 31, 6, colors.green, colors.orange)
  20. t:add("Centauri", nil, 33, 6, 45, 6, colors.green, colors.orange)
  21. t:add("Groth", nil, 19, 8, 31, 8, colors.green, colors.orange)
  22. t:add("Click Planet to Navigate to.", nil, 5, 16, 45, 16, colors.gray, colors.lightBlue)    
  23. t:add("Local Pos "..text.."", nil, 5, 18, 45, 18, colors.red, colors.red)
  24.  
  25. elseif ldim == "Avalonsystem" then
  26. t:add("Galaxy Map V0.1", nil, 5, 2, 45, 2, colors.gray, colors.black)
  27. t:add("Currently in: "..localdim.." ", nil, 5, 4, 45, 4, colors.red, colors.black)
  28.  
  29. t:add("Click Planet to Navigate to.", nil, 5, 16, 45, 16, colors.gray, colors.lightBlue)
  30. t:add("Local Pos "..text.."", nil, 5, 18, 45, 18, colors.red, colors.red)
  31.  
  32. elseif ldim == "Centaurisystem" then
  33. t:add("Galaxy Map V0.1", nil, 5, 2, 45, 2, colors.gray, colors.black)
  34. t:add("Currently in: "..localdim.." ", nil, 5, 4, 45, 4, colors.red, colors.black)
  35.  
  36. t:add("Click Planet to Navigate to.", nil, 5, 16, 45, 16, colors.gray, colors.lightBlue)
  37. t:add("Local Pos "..text.."", nil, 5, 18, 45, 18, colors.red, colors.red)
  38.  
  39. elseif ldim == "Grothsystem" then
  40. t:add("Galaxy Map V0.1", nil, 5, 2, 45, 2, colors.gray, colors.black)
  41. t:add("Currently in: "..localdim.." ", nil, 5, 4, 45, 4, colors.red, colors.black)
  42.  
  43. t:add("Click Planet to Navigate to.", nil, 5, 16, 45, 16, colors.gray, colors.lightBlue)
  44. t:add("Local Pos "..text.."", nil, 5, 18, 45, 18, colors.red, colors.red)
  45.  
  46. elseif ldim == "Wasteland" then
  47. t:add("Galaxy Map V0.1", nil, 5, 2, 45, 2, colors.gray, colors.black)
  48. t:add("Currently in: "..localdim.." ",nil, 5, 4, 45, 4, colors.red, colors.black)
  49.  
  50. t:add("Click Planet to Navigate to.", nil, 5, 16, 45, 16, colors.gray, colors.lightBlue)
  51. t:add("Local Pos "..text.."", nil, 5, 18, 45, 18, colors.red, colors.red)
  52. end
  53.  
  54.  
  55. --t:add("Shulker", nil, 5, 6, 17, 8, colors.blue, colors.lightBlue)
  56. --t:add("Wither", nil, 19, 6, 31, 8, colors.blue, colors.lightBlue)
  57. --t:add("Feral Ghoul", nil, 33, 6, 45, 8, colors.blue, colors.lightBlue)
  58. --t:add("Evoker", nil, 5, 11, 17, 13, colors.blue, colors.lightBlue)  
  59. --t:add("Z Pigman", nil, 19, 11, 31, 13, colors.blue, colors.lightBlue)
  60. --t:add("Ghast", nil, 33, 11, 45, 13, colors.blue, colors.lightBlue)
  61. --t:add("Skeleton", nil, 5, 16, 17, 18, colors.blue, colors.lightBlue)  
  62. --t:add("Z Miner", nil, 19, 16, 31, 18, colors.blue, colors.lightBlue)
  63. --t:add("Witch", nil, 33, 16, 45, 18, colors.blue, colors.lightBlue)
  64. --t:add("Blizz", nil, 5, 21, 17, 23, colors.blue, colors.lightBlue)  
  65. --t:add("Slime", nil, 19, 21, 31, 23, colors.blue, colors.lightBlue)
  66. --t:add("Cyberdemon", nil, 33, 21, 45, 23, colors.blue, colors.lightBlue)
  67. --t:add("Spider", nil, 5, 26, 17, 28, colors.blue, colors.lightBlue)  
  68. --t:add("Enderman", nil, 19, 26, 31, 28, colors.blue, colors.lightBlue)
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75. --t:add("You will be teleported upon picking a kit", nil, 3, 17, 47, 18, colors.black, colors.black)
  76. --# draw the buttons
  77. t:draw()
  78.  
  79. while true do
  80.   --# handleEvents will convert monitor_touch events to button_click if it was on a button
  81.   local event, p1 = t:handleEvents(os.pullEvent())
  82.   if event == "button_click" then
  83.         if p1 == "Bogdaleos" then
  84.           t:flash(p1)
  85.          
  86.         elseif p1 == "Avalon" then
  87.           t:flash(p1)
  88.          
  89.         elseif p1 == "Centauri" then
  90.           t:flash(p1)
  91.          
  92.         elseif p1 == "Groth" then
  93.           t:flash(p1)
  94.          
  95.        end
  96.   end
  97. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement