View difference between Paste ID: v4WXyJyb and FGudeuVV
SHOW: | | - or go back to the newest paste.
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("Algua", nil, 5, 6, 17, 6, colors.green, colors.orange)
30
t:add("Wasteland", nil, 19, 6, 31, 6, colors.green, colors.orange)
31
t:add("The Haven", nil, 33, 6, 45, 6, colors.green, colors.orange)
32
t:add("L'Borean", nil, 5, 8, 17, 8, colors.green, colors.orange)
33
t:add("End", nil, 19, 8, 31, 8, colors.green, colors.orange)
34
t:add("Prometium", nil, 33, 8, 45, 8, colors.green, colors.orange)
35
t:add("Creeponia", nil, 5, 10, 17, 10, colors.green, colors.orange)
36
t:add("Sun", nil, 19, 10, 31, 10, colors.green, colors.orange)
37
--
38
t:add("Click Planet to Navigate to.", nil, 5, 16, 45, 16, colors.gray, colors.lightBlue) 
39
t:add("Local Pos "..text.."", nil, 5, 18, 45, 18, colors.red, colors.red)
40
41
elseif ldim == "Centaurisystem" then
42
t:add("Galaxy Map V0.1", nil, 5, 2, 45, 2, colors.gray, colors.black)
43
t:add("Currently in: "..localdim.." ", nil, 5, 4, 45, 4, colors.red, colors.black)
44
--
45
t:add("Alpha Site", nil, 5, 6, 17, 6, colors.green, colors.orange)
46
t:add("Candyland", nil, 19, 6, 31, 6, colors.green, colors.orange)
47
t:add("Centauri II", nil, 33, 6, 45, 6, colors.green, colors.orange)
48
t:add("Gardenica", nil, 5, 8, 17, 8, colors.green, colors.orange)
49
t:add("Greckon", nil, 19, 8, 31, 8, colors.green, colors.orange)
50
t:add("Iromine", nil, 33, 8, 45, 8, colors.green, colors.orange)
51
t:add("Lelyetia", nil, 5, 10, 17, 10, colors.green, colors.orange)
52
t:add("Runador", nil, 19, 10, 31, 10, colors.green, colors.orange)
53
t:add("Sun", nil, 33, 10, 45, 10, colors.green, colors.orange)
54
t:add("Click Planet to Navigate to.", nil, 5, 16, 45, 16, colors.gray, colors.lightBlue) 
55
t:add("Local Pos "..text.."", nil, 5, 18, 45, 18, colors.red, colors.red)
56
57
elseif ldim == "Grothsystem" then
58
t:add("Galaxy Map V0.1", nil, 5, 2, 45, 2, colors.gray, colors.black)
59
t:add("Currently in: "..localdim.." ", nil, 5, 4, 45, 4, colors.red, colors.black)
60
61
t:add("Click Planet to Navigate to.", nil, 5, 16, 45, 16, colors.gray, colors.lightBlue) 
62
t:add("Local Pos "..text.."", nil, 5, 18, 45, 18, colors.red, colors.red)
63
64
elseif ldim == "Wasteland" then
65
t:add("Galaxy Map V0.1", nil, 5, 2, 45, 2, colors.gray, colors.black)
66
t:add("Currently in: "..localdim.." ",nil, 5, 4, 45, 4, colors.red, colors.black) 
67
68
t:add("Click Planet to Navigate to.", nil, 5, 16, 45, 16, colors.gray, colors.lightBlue) 
69
t:add("Local Pos "..text.."", nil, 5, 18, 45, 18, colors.red, colors.red)
70
end
71
72
73
--t:add("Shulker", nil, 5, 6, 17, 8, colors.blue, colors.lightBlue)
74
--t:add("Wither", nil, 19, 6, 31, 8, colors.blue, colors.lightBlue)
75
--t:add("Feral Ghoul", nil, 33, 6, 45, 8, colors.blue, colors.lightBlue)
76
--t:add("Evoker", nil, 5, 11, 17, 13, colors.blue, colors.lightBlue)  
77
--t:add("Z Pigman", nil, 19, 11, 31, 13, colors.blue, colors.lightBlue)
78
--t:add("Ghast", nil, 33, 11, 45, 13, colors.blue, colors.lightBlue)
79
--t:add("Skeleton", nil, 5, 16, 17, 18, colors.blue, colors.lightBlue)  
80
--t:add("Z Miner", nil, 19, 16, 31, 18, colors.blue, colors.lightBlue)
81
--t:add("Witch", nil, 33, 16, 45, 18, colors.blue, colors.lightBlue)
82
--t:add("Blizz", nil, 5, 21, 17, 23, colors.blue, colors.lightBlue)  
83
--t:add("Slime", nil, 19, 21, 31, 23, colors.blue, colors.lightBlue)
84
--t:add("Cyberdemon", nil, 33, 21, 45, 23, colors.blue, colors.lightBlue)
85
--t:add("Spider", nil, 5, 26, 17, 28, colors.blue, colors.lightBlue)  
86
--t:add("Enderman", nil, 19, 26, 31, 28, colors.blue, colors.lightBlue)
87
88
89
90
91
92
93
--t:add("You will be teleported upon picking a kit", nil, 3, 17, 47, 18, colors.black, colors.black)
94
--# draw the buttons
95
t:draw()
96
97
while true do
98
  --# handleEvents will convert monitor_touch events to button_click if it was on a button
99
  local event, p1 = t:handleEvents(os.pullEvent())
100
  if event == "button_click" then
101
        if p1 == "Bogdaleos" then
102
          t:flash(p1)
103
          
104
        elseif p1 == "Avalon" then
105
          t:flash(p1)
106
          
107
        elseif p1 == "Centauri" then
108
          t:flash(p1)
109
          
110
        elseif p1 == "Groth" then
111
          t:flash(p1)
112
          
113
       end
114
  end
115
end