Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --#load the touchpoint API
- os.loadAPI("touchpoint")
- os.sleep(1)
- --# wrap the radar to the computer
- local p = peripheral.find("warpdriveRadar")
- local x,y,z = p.getLocalPosition()
- local rPosOK,dim,rPosX,rPosY,rPosZ,localdim = p.getGlobalPosition()
- local text = x .. " "..y.." "..z
- local ldim = localdim:gsub(" ","")
- --# initialize the planet instance set on the monitor
- local t = touchpoint.new("right")
- --# Add planets
- if ldim == "Hyperspace" then
- t:add("Galaxy Map V0.1", nil, 5, 2, 45, 2, colors.gray, colors.black)
- t:add("Currently in: "..localdim.." ", nil, 5, 4, 45, 4, colors.red, colors.black)
- t:add("Bogdaleos", nil, 5, 6, 17, 6, colors.green, colors.orange)
- t:add("Avalon", nil, 19, 6, 31, 6, colors.green, colors.orange)
- t:add("Centauri", nil, 33, 6, 45, 6, colors.green, colors.orange)
- t:add("Groth", nil, 19, 8, 31, 8, colors.green, colors.orange)
- t:add("Click Planet to Navigate to.", nil, 5, 16, 45, 16, colors.gray, colors.lightBlue)
- t:add("Local Pos "..text.."", nil, 5, 18, 45, 18, colors.red, colors.red)
- elseif ldim == "Avalonsystem" then
- t:add("Galaxy Map V0.1", nil, 5, 2, 45, 2, colors.gray, colors.black)
- t:add("Currently in: "..localdim.." ", nil, 5, 4, 45, 4, colors.red, colors.black)
- t:add("Click Planet to Navigate to.", nil, 5, 16, 45, 16, colors.gray, colors.lightBlue)
- t:add("Local Pos "..text.."", nil, 5, 18, 45, 18, colors.red, colors.red)
- elseif ldim == "Centaurisystem" then
- t:add("Galaxy Map V0.1", nil, 5, 2, 45, 2, colors.gray, colors.black)
- t:add("Currently in: "..localdim.." ", nil, 5, 4, 45, 4, colors.red, colors.black)
- t:add("Click Planet to Navigate to.", nil, 5, 16, 45, 16, colors.gray, colors.lightBlue)
- t:add("Local Pos "..text.."", nil, 5, 18, 45, 18, colors.red, colors.red)
- elseif ldim == "Grothsystem" then
- t:add("Galaxy Map V0.1", nil, 5, 2, 45, 2, colors.gray, colors.black)
- t:add("Currently in: "..localdim.." ", nil, 5, 4, 45, 4, colors.red, colors.black)
- t:add("Click Planet to Navigate to.", nil, 5, 16, 45, 16, colors.gray, colors.lightBlue)
- t:add("Local Pos "..text.."", nil, 5, 18, 45, 18, colors.red, colors.red)
- elseif ldim == "Wasteland" then
- t:add("Galaxy Map V0.1", nil, 5, 2, 45, 2, colors.gray, colors.black)
- t:add("Currently in: "..localdim.." ",nil, 5, 4, 45, 4, colors.red, colors.black)
- t:add("Click Planet to Navigate to.", nil, 5, 16, 45, 16, colors.gray, colors.lightBlue)
- t:add("Local Pos "..text.."", nil, 5, 18, 45, 18, colors.red, colors.red)
- end
- --t:add("Shulker", nil, 5, 6, 17, 8, colors.blue, colors.lightBlue)
- --t:add("Wither", nil, 19, 6, 31, 8, colors.blue, colors.lightBlue)
- --t:add("Feral Ghoul", nil, 33, 6, 45, 8, colors.blue, colors.lightBlue)
- --t:add("Evoker", nil, 5, 11, 17, 13, colors.blue, colors.lightBlue)
- --t:add("Z Pigman", nil, 19, 11, 31, 13, colors.blue, colors.lightBlue)
- --t:add("Ghast", nil, 33, 11, 45, 13, colors.blue, colors.lightBlue)
- --t:add("Skeleton", nil, 5, 16, 17, 18, colors.blue, colors.lightBlue)
- --t:add("Z Miner", nil, 19, 16, 31, 18, colors.blue, colors.lightBlue)
- --t:add("Witch", nil, 33, 16, 45, 18, colors.blue, colors.lightBlue)
- --t:add("Blizz", nil, 5, 21, 17, 23, colors.blue, colors.lightBlue)
- --t:add("Slime", nil, 19, 21, 31, 23, colors.blue, colors.lightBlue)
- --t:add("Cyberdemon", nil, 33, 21, 45, 23, colors.blue, colors.lightBlue)
- --t:add("Spider", nil, 5, 26, 17, 28, colors.blue, colors.lightBlue)
- --t:add("Enderman", nil, 19, 26, 31, 28, colors.blue, colors.lightBlue)
- --t:add("You will be teleported upon picking a kit", nil, 3, 17, 47, 18, colors.black, colors.black)
- --# draw the buttons
- t:draw()
- while true do
- --# handleEvents will convert monitor_touch events to button_click if it was on a button
- local event, p1 = t:handleEvents(os.pullEvent())
- if event == "button_click" then
- if p1 == "Bogdaleos" then
- t:flash(p1)
- elseif p1 == "Avalon" then
- t:flash(p1)
- elseif p1 == "Centauri" then
- t:flash(p1)
- elseif p1 == "Groth" then
- t:flash(p1)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement