View difference between Paste ID: TieR2P5r and EBLTAQHc
SHOW: | | - or go back to the newest paste.
1
local function menu(...)
2
        local sel = 1
3
        local list = {...}
4
        local offX,offY = term.getCursorPos()
5
        local curX,curY = term.getCursorPos()
6
        while true do
7
                if sel > #list then sel = 1 end
8
                if sel < 1 then sel = #list end
9
                for i = 1,#list do
10
                        term.setCursorPos(offX,offY+i-1)
11
                        if sel == i then
12
                                print("["..list[i].."]") -- very customisible example print(">"..list[i])
13
                        else
14
                                print(" "..list[i].." ") -- very customisible
15
                        end
16
                end
17
                while true do
18
                        local e,e1,e2,e3,e4,e5 = os.pullEvent()
19
                        if e == "key" then
20
                                if e1 == 200 then -- up key
21
                                        sel = sel-1
22
                                                break
23
                                end
24
                                if e1 == 208 then -- down key
25
                                        sel = sel+1
26
                                                break
27
                                end
28
                                if e1 == 28 then
29
                                        term.setCursorPos(curX,curY)
30
                                        return list[sel],sel
31
                                end
32
                        end
33
                end
34
        end
35
end
36
37
function Option1()
38
  shell.run("clear")
39-
  shell.run("Stone")
39+
  print"(Stone, also known as Smooth Stone, is a block found in")
40
  print("abundance in the Overworld. It uses the same texture on all")
41
  print("six sides of the block. When mined, stone produces cobblestone.")
42
  print("")
43
  print("Stone is an often-used building material in the construction")
44-
  shell.run("Grass")
44+
  print("of buildings, paths and many other things.")
45
  print("")
46
  print("After air, stone is the second most common block found in a")
47
  print("normal map.")
48
  print("")
49-
  print("Dirt is a Vanilla block found abundantly in the Overworld.")
49+
  print("EMC: 1")
50-
  print("It uses the same texture on all six sides of the block.")
50+
  print("Blast Resistance: 30")
51-
  print("Dirt is very common, making up the majority of the top layers")
51+
  print("ID: 1")
52-
  print("of blocks, between Grass, Snow, and Stone. It is also found ")  
52+
53-
  print("underground in clumps in all altitudes and in the bottom of")
53+
54-
  print("lakes and oceans. It is a very weak block and is easily")
54+
55-
  print("destroyed in explosions from TNT or Creepers")
55+
56
  print("A Grass Block is a block that was introduced very early in the")
57
  print("game. It uses 4 textures: a gray one for the top which is then")
58
  print("tinted to the correct color according to what biome the block is")
59
  print("in, one borrowed from the dirt block for the bottom, an edited")
60-
  shell.run("Cobblestone")
60+
  print("dirt texture with grass on the top edge on all of the sides, and")
61
  print("a gray texture matching the shape of the grass on the side of")
62
  print("the block, which is tinted to the correct biome color. When")
63
  print("covered by snow the side texture is white. On natural maps,")
64
  print("grass appears on topmost blocks of dirt with no fluids or opaque")
65
  print("solid blocks above them.")
66
  print("")
67
  print("In mining, grass blocks behave just like dirt - they drop dirt")
68
  print("resources and are best dug with a shovel; however, they make a")
69
  print("different sound when harvested and take slightly longer to dig up.")
70-
        "Stone",
70+
  print("This can be used to tell when the player is about to break the")
71-
        "Grass",
71+
  print("surface when tunneling upwards.")
72-
        "Dirt",
72+
  print("")
73-
        "Cobblestone",
73+
  print("EMC: 1")
74
  print("Blast Resistance: 3")
75-
        if selection == "Stone" then
75+
  print("ID: 2")
76
end
77-
        elseif selection == "Grass" then
77+
78
function Option3()
79-
        elseif selection == "Dirt" then
79+
80
  print("Dirt is a block found abundantly in the Overworld. It uses the same")
81-
        elseif selection == "Cobblestone" then
81+
  print("texture on all six sides of the block. This is a block often used")
82
  print("when making a temporary shelter quickly since it is commonly found.")
83
  print("Dirt makes up the majority of the top layers of blocks, between grass,")
84
  print("snow and stone. It is also found underground in clumps in all")
85
  print("altitudes and in the bottom of lakes and oceans. It is a very weak")
86
  print("block and is easily destroyed in explosions from TNT or Creepers,")
87
  print("making dirt shelters a fallback option at best.")
88
  print("")
89
  print("When a dirt block is adjacent to a grass block and is exposed to a")
90
  print("light level of at least 4 (e.g. from torches or sunlight), it will")
91
  print("eventually be converted into a grass block; when this happens is")
92
  print("random and unpredictable (see grass for growth details). Dirt can also")
93
  print("have mycelium spread on to the block in much the same way, but")
94
  print("requiring a light level of at least 9.")
95
  print("")
96
  print("Dirt will always drop a resource block, regardless of how it was mined.")
97
  print("It may be mined by hand fairly quickly, but using a shovel will")
98
  print("significantly speed up the process.")
99
  print("")
100
  print("Using a hoe on a placed block of dirt will turn it into a farmland block,")
101
  print("enabling seeds to be planted on it. Farmland will revert to dirt unless")
102
  print("something is planted on it or it is irrigated by nearby water.")
103
  print("")
104
  print("EMC: 1")
105
  print("Blast Resistance: 2.5")
106
  print("ID: 3")
107
end
108
109
function Option4()
110
  shell.run("clear")
111
  print("Cobblestone is a common block used for creating various items, that")
112
  print("resembles an uneven, roughly paved surface. Cobblestone only occurs")
113
  print("naturally in dungeons, NPC Villages, strongholds, or when water and")
114
  print("flowing lava come into contact. It is commonly used to create walls for")
115
  print("constructions with a medieval appearance such as castles, towers and roads.")
116
  print("Cobblestone is obtained by mining stone. Cobblestone is slightly harder to")
117
  print("mine than normal stone, and there is an alternative version of the block")
118
  print("known as Moss Stone. Silverfish have the ability to enter and hide in")
119
  print("cobblestone.")
120
  print("EMC: 1")
121
  print("Blast Resistance: 30")
122
  print("ID: 4")
123
end
124
125
function Option5()
126
  shell.run("clear")
127
  error()
128
end
129
130
while true do
131
        local selection = menu(
132
        "Stone 1",
133
        "GrassBlock 2",
134
        "Dirt 3",
135
        "Cobblestone 4",
136
        "Exit")
137
        if selection == "Stone 1" then
138
         Option1()
139
        elseif selection == "GrassBlock 2" then
140
         Option2()
141
        elseif selection == "Dirt 3" then
142
         Option3()
143
        elseif selection == "Cobblestone 4" then
144
         Option4()
145
        elseif selection == "Exit" then
146
         Option5()
147
        end
148
end