SHOW:
|
|
- or go back to the newest paste.
1 | - | local myID = os.getComputerID() |
1 | + | function welcomescreen() |
2 | - | while true do -- 1 |
2 | + | term.clear() |
3 | term.setCursorPos(1,1) | |
4 | print("-----------------------------") -- pokud je volny slot, vypis poptavku | |
5 | - | if fs.exists("currentoffer") then -- pokud jiz existuje ulozena objednavka, nacte se ze souboru currentoffer 2 |
5 | + | print("Objednavka: ", pocet, "x ", jidlo) |
6 | print("Vyplata: ", cena," kreditu.") | |
7 | ||
8 | print("Pro splneni objednavky zadejte O, pro vareni jidla zadejte J") | |
9 | end | |
10 | ||
11 | function fcscreen() | |
12 | loop1 = true | |
13 | while loop1 == true do -- loop na cykleni vareni/zakazek 1.1.2.2.1.0.0 | |
14 | welcomescreen() | |
15 | ||
16 | local prikaz = read() | |
17 | - | print("---------------------------") |
17 | + | if prikaz == "J" then -- vareni jidla 1.1.2.2.1.1.0 |
18 | - | print("Objednavka: ", pocet, jidlo) |
18 | + | print("Kolik jste uvarili jidla?") |
19 | - | print("Vyplata: ", cena, " kreditu.") |
19 | + | local uvareno = tonumber(read()) |
20 | - | passwordD = "david" |
20 | + | |
21 | - | passwordF = "filip" |
21 | + | print("Pouzili jste nadobi? (y/n)") |
22 | local nadobi = read() | |
23 | - | local heslonerozpoznano = true |
23 | + | if nadobi == "y" then -- pouziti nadobi 1.1.2.2.1.1.1 |
24 | - | while heslonerozpoznano do -- overeni heslem 3 |
24 | + | mod1 = 5 |
25 | - | write("Heslo: ") |
25 | + | else mod1 = 0 |
26 | - | local input = read("*") |
26 | + | end -- 1.1.2.2.1.1.1E |
27 | - | if input == passwordD then -- overeni hesla pro Davida 4 |
27 | + | |
28 | - | heslonerozpoznano = false |
28 | + | print("Pouzili jste pri vareni pristroj? (y/n)") |
29 | - | print ("Objednavka prijata. Na ucet David bylo pripsano " .. cena .. " kreditu.") |
29 | + | local pristroj = read() |
30 | - | rednet.open("top") |
30 | + | if pristroj == "y" then -- pouziti pristroje 1.1.2.2.1.1.2 |
31 | - | rednet.broadcast("poptavka", "ucel") |
31 | + | mod2 = 5 |
32 | - | rednet.broadcast("David","kdo") |
32 | + | else mod2 = 0 |
33 | - | rednet.broadcast(cena,"kolik") |
33 | + | end -- 1.1.2.2.1.1.2E |
34 | - | slot = 0 |
34 | + | |
35 | - | hotovot = {} |
35 | + | print("Byl potreba pri vareni craftici mezikrok? (y/n)") |
36 | - | hotovot[4] = myID |
36 | + | local mezikrok = read() |
37 | - | hotovot[5] = "F" |
37 | + | if mezikrok == "y" then -- pouziti mezikroku 1.1.2.2.1.1.3 |
38 | - | local msg = textutils.serialize(hotovot) |
38 | + | mod3 = 5 |
39 | - | rednet.broadcast(msg, "offer") |
39 | + | else mod3 = 0 |
40 | - | fs.delete("currentoffer") |
40 | + | end -- 1.1.2.2.1.1.3E |
41 | - | sleep(3) |
41 | + | |
42 | mzda = uvareno * ( 5 + mod1 + mod2 + mod3) | |
43 | - | elseif input == passwordF then -- overeni hesla pro Filipa |
43 | + | |
44 | - | heslonerozpoznano = false |
44 | + | passwordD = "david" |
45 | - | print ("Objednavka prijata. Na ucet Filip bylo pripsano " .. cena .. " kreditu.") |
45 | + | passwordF = "filip" |
46 | - | rednet.open("top") |
46 | + | |
47 | - | rednet.broadcast("poptavka", "ucel") |
47 | + | local heslonerozpoznano = true |
48 | - | rednet.broadcast("Filip","kdo") |
48 | + | while heslonerozpoznano do -- 1.1.2.2.1.1.4.0 |
49 | - | rednet.broadcast(cena,"kolik") |
49 | + | print("Pokud chcete stornovat prikaz, misto hesla zadejte STORNO") |
50 | - | slot = 0 |
50 | + | write("Heslo: ") |
51 | - | hotovot = {} |
51 | + | local input = read("*") |
52 | - | hotovot[4] = myID |
52 | + | if input == passwordD then -- 1.1.2.2.1.1.4.1 |
53 | - | hotovot[5] = "F" |
53 | + | heslonerozpoznano = false |
54 | - | local msg = textutils.serialize(hotovot) |
54 | + | print ("Mzda vyplacena. Na ucet David bylo pripsano " .. mzda .. " kreditu.") |
55 | - | rednet.broadcast(msg, "offer") |
55 | + | rednet.open("top") |
56 | - | fs.delete("currentoffer") |
56 | + | rednet.broadcast("poptavka", "ucel") |
57 | - | sleep(3) |
57 | + | rednet.broadcast("David","kdo") |
58 | rednet.broadcast(mzda,"kolik") | |
59 | - | else print("Heslo nerozpoznano") -- pokud se neshoduje heslo |
59 | + | sleep(2,5) |
60 | - | sleep(1) |
60 | + | |
61 | - | end -- konec overeni inputu 4E |
61 | + | elseif input == passwordF then |
62 | - | end -- ukonceni while loopu pro overeni heslem 3E |
62 | + | heslonerozpoznano = false |
63 | print ("Mzda vyplacena. Na ucet Filip bylo pripsano " .. mzda .. " kreditu.") | |
64 | - | else -- generace nove poptavky pokud neexistuje poptavka 2C |
64 | + | rednet.open("top") |
65 | rednet.broadcast("poptavka", "ucel") | |
66 | rednet.broadcast("Filip","kdo") | |
67 | - | while znovu == 1 do -- generuj, dokud se neuvolni slot 4,5 |
67 | + | rednet.broadcast(mzda,"kolik") |
68 | - | while slot == 0 do --generuj, dokud se to nepovede 5 |
68 | + | sleep(2,5) |
69 | ||
70 | elseif input == "STORNO" then | |
71 | - | n = math.random(1,190) |
71 | + | heslonerozpoznano = false |
72 | print("Prikaz stornovan") | |
73 | sleep(1) | |
74 | - | if pocet == 65 then -- 6 |
74 | + | |
75 | else print("Heslo nerozpoznano") | |
76 | - | end -- 6E |
76 | + | |
77 | end -- konec overeni hesla 1.1.2.2.1.1.4.1E | |
78 | end -- 1.1.2.2.1.1.4.0E | |
79 | - | if n == 1 then -- 7 |
79 | + | |
80 | - | slot = 0 |
80 | + | elseif prikaz == "O" then -- objednavka jidla 1.1.2.2.1.1.0 Cont |
81 | ||
82 | - | elseif n == 2 then |
82 | + | passwordD = "david" |
83 | - | jidlo = "x PMP spenat" |
83 | + | |
84 | - | cenajidla = 10 |
84 | + | |
85 | local heslonerozpoznano = true | |
86 | - | elseif n == 3 then |
86 | + | while heslonerozpoznano do -- 1.1.2.2.1.1.5.0 |
87 | - | jidlo = "x PMP okurka" |
87 | + | print(myID) |
88 | - | cenajidla = 10 |
88 | + | |
89 | - | |
89 | + | |
90 | - | elseif n == 4 then |
90 | + | if input == passwordD then -- 1.1.2.2.1.1.5.1 |
91 | - | jidlo = "x PMP zluta paprika" |
91 | + | |
92 | - | cenajidla = 10 |
92 | + | |
93 | - | |
93 | + | |
94 | - | elseif n == 5 then |
94 | + | |
95 | - | jidlo = "x PMP salat" |
95 | + | |
96 | - | cenajidla = 10 |
96 | + | |
97 | slot = 0 | |
98 | - | elseif n == 6 then |
98 | + | |
99 | - | jidlo = "x PMP kukurice" |
99 | + | |
100 | - | cenajidla = 5 |
100 | + | |
101 | local msg = textutils.serialize(hotovot) | |
102 | - | elseif n == 7 then |
102 | + | |
103 | - | jidlo = "x obili" |
103 | + | |
104 | - | cenajidla = 5 |
104 | + | loop1 = false |
105 | sleep(3) | |
106 | - | elseif n == 8 then |
106 | + | |
107 | - | jidlo = "x cervena repa" |
107 | + | |
108 | - | cenajidla = 5 |
108 | + | |
109 | print ("Objednavka prijata. Na ucet Filip bylo pripsano " .. cena .. " kreditu.") | |
110 | - | elseif n == 9 then |
110 | + | |
111 | - | jidlo = "x meloun" |
111 | + | |
112 | - | cenajidla = 5 |
112 | + | |
113 | rednet.broadcast(cena,"kolik") | |
114 | - | elseif n == 10 then |
114 | + | |
115 | - | jidlo = "x PMP divoka ryze" |
115 | + | |
116 | - | cenajidla = 15 |
116 | + | |
117 | hotovot[5] = "F" | |
118 | - | elseif n == 11 then |
118 | + | |
119 | - | jidlo = "x jehneci" |
119 | + | |
120 | - | cenajidla = 20 |
120 | + | |
121 | - | |
121 | + | loop1 = false |
122 | - | elseif n == 12 then |
122 | + | |
123 | - | jidlo = "x hovezi" |
123 | + | |
124 | - | cenajidla = 15 |
124 | + | |
125 | - | |
125 | + | |
126 | - | elseif n >= 13 and n<= 18 then |
126 | + | end -- konec overeni hesla 1.1.2.2.1.1.5.1E |
127 | end -- konec loopu pro heslo 1.1.2.2.1.1.5.0E | |
128 | - | local ryba = math.random(1, 17) |
128 | + | end -- konec loopu pro vyber J/O 1.1.2.2.1.1.0E |
129 | - | if ryba == 1 then jidlo = "x ryba" -- 8 |
129 | + | end -- konec while loopu pro cykleni mezi J/O 1.1.2.2.1.0.0E |
130 | - | elseif ryba == 2 then jidlo = "x HC raw bass" |
130 | + | end |
131 | - | elseif ryba == 3 then jidlo = "x HC raw carp" |
131 | + | |
132 | - | elseif ryba == 4 then jidlo = "x HC raw catfish" |
132 | + | --- ZACATEK PROGRAMU --- |
133 | - | elseif ryba == 5 then jidlo = "x HC raw grouper" |
133 | + | |
134 | - | elseif ryba == 6 then jidlo = "x HC raw herring" |
134 | + | myID = os.getComputerID() |
135 | - | elseif ryba == 7 then jidlo = "x HC raw tilapia" |
135 | + | while true do -- 1.0.0.0.0.0.0 |
136 | - | elseif ryba == 8 then jidlo = "x HC raw tuna" |
136 | + | |
137 | - | elseif ryba == 9 then jidlo = "x HC raw walleye" |
137 | + | |
138 | - | elseif ryba == 10 then jidlo = "x HC raw green heart fish" |
138 | + | if fs.exists("currentoffer") then -- pokud jiz existuje ulozena objednavka, nacte se ze souboru currentoffer 1.1.0.0.0.0.0 |
139 | - | elseif ryba == 11 then jidlo = "x HC raw charr" |
139 | + | |
140 | - | elseif ryba == 12 then jidlo = "x HC raw mudfish" |
140 | + | |
141 | - | elseif ryba == 13 then jidlo = "x HC raw trout" |
141 | + | |
142 | - | elseif ryba == 14 then jidlo = "x HC raw anchovy" |
142 | + | |
143 | - | elseif ryba == 15 then jidlo = "x HC raw perch" |
143 | + | |
144 | - | elseif ryba == 16 then jidlo = "x HC raw snapper" |
144 | + | |
145 | - | elseif ryba == 17 then jidlo = "x HC raw eel" |
145 | + | |
146 | - | end -- 8E |
146 | + | |
147 | jidlo = offertable[2] | |
148 | - | elseif n == 19 then |
148 | + | |
149 | - | jidlo = "x HC raw crab" |
149 | + | |
150 | - | cenajidla = 25 |
150 | + | fcscreen() |
151 | ||
152 | - | elseif n == 20 then |
152 | + | else -- generace nove poptavky pokud neexistuje poptavka 1.1.0.0.0.0Cont |
153 | - | jidlo = "x HC raw crayfish" |
153 | + | |
154 | - | cenajidla = 25 |
154 | + | |
155 | - | |
155 | + | while znovu == 1 do -- generuj, dokud se neuvolni slot 1.1.2.0.0.0 |
156 | - | elseif n == 21 then |
156 | + | while slot == 0 do --generuj, dokud se to nepovede 1.1.2.1.0.0 |
157 | - | jidlo = "x HC raw frog" |
157 | + | |
158 | - | cenajidla = 25 |
158 | + | |
159 | n = math.random(1,200) | |
160 | - | elseif n == 22 then |
160 | + | |
161 | - | jidlo = "x HC raw octopus" |
161 | + | |
162 | - | cenajidla = 25 |
162 | + | if pocet == 65 then -- 1.1.2.1.1.0 |
163 | pocet = 128 | |
164 | - | elseif n == 23 then |
164 | + | end -- 1.1.2.1.1E |
165 | - | jidlo = "x HC raw scallop" |
165 | + | |
166 | - | cenajidla = 25 |
166 | + | if n >= 1 and n <= 19 then -- VEGGIES |
167 | - | |
167 | + | local veggies = math.random(1,33) |
168 | - | elseif n == 24 then |
168 | + | |
169 | - | jidlo = "x HC raw shrimp" |
169 | + | if veggies >= 1 and veggies <= 9 then -- veggies1 |
170 | - | cenajidla = 25 |
170 | + | cenajidla = 10 |
171 | local veggies1 = math.random(1,9) | |
172 | - | elseif n == 25 then |
172 | + | if veggies1 == 1 then jidlo = "PMP spinach" |
173 | - | jidlo = "x HC raw snail" |
173 | + | elseif veggies1 == 2 then jidlo = "PMP cucumber" |
174 | - | cenajidla = 25 |
174 | + | elseif veggies1 == 3 then jidlo = "PMP bell pepper" |
175 | - | |
175 | + | elseif veggies1 == 4 then jidlo = "PMP lettuce" |
176 | - | elseif n == 26 then |
176 | + | elseif veggies1 == 5 then jidlo = "PMP beet" |
177 | - | jidlo = "x HC raw turtle" |
177 | + | elseif veggies1 == 6 then jidlo = "PMP tomato" |
178 | - | cenajidla = 25 |
178 | + | elseif veggies1 == 7 then jidlo = "PMP onion" |
179 | elseif veggies1 == 8 then jidlo = "carrot" | |
180 | - | elseif n == 27 then |
180 | + | elseif veggies1 == 9 then jidlo = "PMP celery" |
181 | - | jidlo = "x HC raw turkey" |
181 | + | end |
182 | - | cenajidla = 50 |
182 | + | |
183 | elseif veggies >= 10 and veggies <= 13 then -- veggies2 | |
184 | - | elseif n == 28 then |
184 | + | |
185 | - | jidlo = "x HC raw venison" |
185 | + | local veggies2 = math.random(1,4) |
186 | - | cenajidla = 50 |
186 | + | if veggies2 == 1 then jidlo = "HC avocado" |
187 | elseif veggies2 == 2 then jidlo = "cactus" | |
188 | - | elseif n == 29 then |
188 | + | elseif veggies2 == 3 then jidlo = "olive" |
189 | - | jidlo = "x HC raw rabbit" |
189 | + | elseif veggies2 == 4 then jidlo = "HC bamboo shoot" |
190 | - | cenajidla = 50 |
190 | + | end |
191 | - | |
191 | + | |
192 | - | elseif n == 30 then |
192 | + | elseif veggies >= 14 and veggies <= 33 then -- veggies3 |
193 | - | jidlo = "x HC raw calamari" |
193 | + | |
194 | - | cenajidla = 25 |
194 | + | local veggies3 = math.random(1,20) |
195 | - | |
195 | + | if veggies3 == 1 then jidlo = "HC pea" |
196 | - | elseif n == 31 then |
196 | + | elseif veggies3 == 2 then jidlo = "cactus" |
197 | - | jidlo = "x losos" |
197 | + | elseif veggies3 == 3 then jidlo = "HC olive" |
198 | - | cenajidla = 30 |
198 | + | elseif veggies3 == 4 then jidlo = "HC soybean" |
199 | - | |
199 | + | elseif veggies3 == 5 then jidlo = "HC asparagus" |
200 | - | elseif n == 32 then |
200 | + | elseif veggies3 == 6 then jidlo = "HC broccoli" |
201 | - | jidlo = "x PMP rajce" |
201 | + | elseif veggies3 == 7 then jidlo = "HC zucchini" |
202 | - | cenajidla = 10 |
202 | + | elseif veggies3 == 8 then jidlo = "HC celery" |
203 | - | |
203 | + | elseif veggies3 == 9 then jidlo = "HC onion" |
204 | - | elseif n == 33 then |
204 | + | elseif veggies3 == 10 then jidlo = "HC sea weed" |
205 | - | jidlo = "x PMP cibule" |
205 | + | elseif veggies3 == 11 then jidlo = "HC mushrooms" |
206 | - | cenajidla = 10 |
206 | + | elseif veggies3 == 12 then jidlo = "HC eggplant" |
207 | elseif veggies3 == 13 then jidlo = "HC leek" | |
208 | - | elseif n == 34 then |
208 | + | elseif veggies3 == 14 then jidlo = "HC bean" |
209 | - | jidlo = "x mrkev" |
209 | + | elseif veggies3 == 15 then jidlo = "HC tomato" |
210 | - | cenajidla = 10 |
210 | + | elseif veggies3 == 16 then jidlo = "HC lettuce" |
211 | elseif veggies3 == 17 then jidlo = "HC beet" | |
212 | - | elseif n == 35 then |
212 | + | elseif veggies3 == 18 then jidlo = "HC bellpepper" |
213 | - | jidlo = "x PMP peanuts" |
213 | + | elseif veggies3 == 19 then jidlo = "HC cucumber" |
214 | - | cenajidla = 30 |
214 | + | elseif veggies3 == 20 then jidlo = "HC spinach" |
215 | end | |
216 | - | elseif n == 36 then |
216 | + | end |
217 | - | jidlo = "x kaktus" |
217 | + | |
218 | - | cenajidla = 15 |
218 | + | |
219 | elseif n >= 20 and n <= 36 then -- FRUITS | |
220 | - | elseif n == 37 then |
220 | + | local fruits = math.random(1,27) |
221 | - | jidlo = "x kure" |
221 | + | if fruits >= 1 and fruits <= 16 then |
222 | - | cenajidla = 10 |
222 | + | |
223 | local fruits1 = math.random(1,16) -- fruits1 | |
224 | - | elseif n == 38 then |
224 | + | if fruits1 == 1 then jidlo = "watermelon" |
225 | - | jidlo = "x veprove" |
225 | + | elseif fruits1 == 2 then jidlo = "PMP blueberry" |
226 | - | cenajidla = 20 |
226 | + | elseif fruits1 == 3 then jidlo = "PMP strawberry" |
227 | elseif fruits1 == 4 then jidlo = "PMP blackberry" | |
228 | - | elseif n == 39 then |
228 | + | elseif fruits1 == 5 then jidlo = "PMP whiteberry" |
229 | - | jidlo = "x cukr" |
229 | + | elseif fruits1 == 6 then jidlo = "PMP gooseberry" |
230 | - | cenajidla = 10 |
230 | + | elseif fruits1 == 7 then jidlo = "PMP beautyberry" |
231 | elseif fruits1 == 8 then jidlo = "PMP orangeberry" | |
232 | - | elseif n == 40 then |
232 | + | elseif fruits1 == 9 then jidlo = "HC plum" |
233 | - | jidlo = "x PMP blueberry" |
233 | + | elseif fruits1 == 10 then jidlo = "HC rhubarb" |
234 | - | cenajidla = 5 |
234 | + | elseif fruits1 == 11 then jidlo = "HC grape" |
235 | elseif fruits1 == 12 then jidlo = "HC cherry" | |
236 | - | elseif n == 41 then |
236 | + | elseif fruits1 == 13 then jidlo = "HC peach" |
237 | - | jidlo = "x PMP strawberry" |
237 | + | elseif fruits1 == 14 then jidlo = "HC apricot" |
238 | - | cenajidla = 5 |
238 | + | elseif fruits1 == 15 then jidlo = "HC blueberry" |
239 | elseif fruits1 == 16 then jidlo = "HC blackberry" | |
240 | - | elseif n == 42 then |
240 | + | end |
241 | - | jidlo = "x PMP blackberry" |
241 | + | |
242 | - | cenajidla = 5 |
242 | + | elseif fruits >= 17 and fruits <= 27 then -- fruits2 |
243 | cenajidla = 15 | |
244 | - | elseif n == 43 then |
244 | + | local fruits2 = math.random(1,11) |
245 | - | jidlo = "x PMP whiteberry" |
245 | + | if fruits2 == 1 then jidlo = "HC lemon" |
246 | - | cenajidla = 5 |
246 | + | elseif fruits2 == 2 then jidlo = "HC coconut" |
247 | elseif fruits2 == 3 then jidlo = "HC orange" | |
248 | - | elseif n == 44 then |
248 | + | elseif fruits2 == 4 then jidlo = "HC banana" |
249 | - | jidlo = "x PMP gooseberry" |
249 | + | elseif fruits2 == 5 then jidlo = "HC grapefruit" |
250 | - | cenajidla = 5 |
250 | + | elseif fruits2 == 6 then jidlo = "HC fig" |
251 | - | |
251 | + | elseif fruits2 == 7 then jidlo = "HC pomegranate" |
252 | - | elseif n == 45 then |
252 | + | elseif fruits2 == 8 then jidlo = "HC lime" |
253 | - | jidlo = "x PMP beautyberry" |
253 | + | elseif fruits2 == 9 then jidlo = "HC date" |
254 | - | cenajidla = 5 |
254 | + | elseif fruits2 == 10 then jidlo = "HC cantaloupe" |
255 | - | |
255 | + | elseif fruits2 == 11 then jidlo = "HC mango" |
256 | - | elseif n == 46 then |
256 | + | end |
257 | - | jidlo = "x PMP orangeberry" |
257 | + | end |
258 | - | cenajidla = 5 |
258 | + | |
259 | ||
260 | - | elseif n == 47 then |
260 | + | elseif n >= 37 and n <= 52 then -- CARBS |
261 | - | jidlo = "x brambory" |
261 | + | local carbs = math.random(1,9) |
262 | - | cenajidla = 5 |
262 | + | if carbs >= 1 and carbs <= 5 then -- carbs1 |
263 | cenajidla = 5 | |
264 | - | elseif n == 48 then |
264 | + | local carbs1 = math.random(1,5) |
265 | - | jidlo = "x HC avocado" |
265 | + | if carbs1 == 1 then jidlo = "PMP corn" |
266 | - | cenajidla = 15 |
266 | + | elseif carbs1 == 2 then jidlo = "wheat" |
267 | elseif carbs1 == 3 then jidlo = "potato" | |
268 | - | elseif n == 49 then |
268 | + | elseif carbs1 == 4 then jidlo = "HC barley" |
269 | - | jidlo = "x HC olive" |
269 | + | elseif carbs1 == 5 then jidlo = "HC rye" |
270 | - | cenajidla = 15 |
270 | + | end |
271 | ||
272 | - | elseif n == 50 then |
272 | + | elseif carbs >= 6 and n <= 9 then -- carbs2 |
273 | - | jidlo = "x HC pea" |
273 | + | local carbs2 = math.random(1,4) |
274 | - | cenajidla = 5 |
274 | + | if carbs2 == 1 then jidlo = "PMP wild rice" |
275 | cenajidla = 30 | |
276 | - | elseif n == 51 then |
276 | + | elseif carbs2 == 2 then jidlo = "HC rice" |
277 | - | jidlo = "x HC chilli" |
277 | + | cenajidla = 15 |
278 | - | cenajidla = 15 |
278 | + | elseif carbs2 == 3 then jidlo = "PMP asian rice" |
279 | cenajidla = 30 | |
280 | - | elseif n == 52 then |
280 | + | elseif carbs2 == 4 then jidlo = "PMP corn" |
281 | - | jidlo = "x HC plum" |
281 | + | cenajidla = 10 |
282 | - | cenajidla = 5 |
282 | + | end |
283 | end | |
284 | - | elseif n == 53 then |
284 | + | |
285 | - | jidlo = "x HC lemon" |
285 | + | elseif n >= 53 and n <= 66 then -- PROTEIN |
286 | - | cenajidla = 15 |
286 | + | local protein = math.random(1,8) |
287 | if protein == 1 then jidlo = "raw mutton" | |
288 | - | elseif n == 54 then |
288 | + | cenajidla = 20 |
289 | - | jidlo = "x HC tea leaf" |
289 | + | elseif protein == 2 then jidlo = "raw beef" |
290 | - | cenajidla = 15 |
290 | + | cenajidla = 15 |
291 | elseif protein == 3 then jidlo = "HC raw turkey" | |
292 | - | elseif n == 55 then |
292 | + | cenajidla = 50 |
293 | - | jidlo = "x HC soybean" |
293 | + | elseif protein == 4 then jidlo = "HC raw venison" |
294 | - | cenajidla = 5 |
294 | + | cenajidla = 50 |
295 | elseif protein == 5 then jidlo = "HC raw rabbit" | |
296 | - | elseif n == 56 then |
296 | + | cenajidla = 50 |
297 | - | jidlo = "x HC asparagus" |
297 | + | elseif protein == 6 then jidlo = "raw chicken" |
298 | - | cenajidla = 5 |
298 | + | cenajidla = 10 |
299 | elseif protein == 7 then jidlo = "raw pork" | |
300 | - | elseif n == 57 then |
300 | + | cenajidla = 20 |
301 | - | jidlo = "x HC garlic" |
301 | + | elseif protein == 8 then jidlo = "eggs" |
302 | - | cenajidla = 5 |
302 | + | cenajidla = 5 |
303 | end | |
304 | - | elseif n == 58 then |
304 | + | |
305 | - | jidlo = "x HC rhubarb" |
305 | + | elseif n >= 67 and n <= 76 then -- SPICES |
306 | - | cenajidla = 5 |
306 | + | local spices = math.random(1,13) |
307 | if spices == 1 then jidlo = "sugar" | |
308 | - | elseif n == 59 then |
308 | + | cenajidla = 5 |
309 | - | jidlo = "x HC grape" |
309 | + | elseif spices == 2 then jidlo = "HC chilli" |
310 | - | cenajidla = 5 |
310 | + | cenajidla = 15 |
311 | elseif spices == 3 then jidlo = "HC garlic" | |
312 | - | elseif n == 60 then |
312 | + | cenajidla = 5 |
313 | - | jidlo = "x HC mustard" |
313 | + | elseif spices == 4 then jidlo = "HC mustard" |
314 | - | cenajidla = 5 |
314 | + | cenajidla = 5 |
315 | elseif spices == 5 then jidlo = "HC maple syrup" | |
316 | - | elseif n == 61 then |
316 | + | cenajidla = 10 |
317 | - | jidlo = "x HC coconut" |
317 | + | elseif spices == 6 then jidlo = "HC cinnamon" |
318 | - | cenajidla = 15 |
318 | + | cenajidla = 30 |
319 | elseif spices == 7 then jidlo = "HC vanilla bean" | |
320 | - | elseif n == 62 then |
320 | + | cenajidla = 15 |
321 | - | jidlo = "x HC maple syrup" |
321 | + | elseif spices == 8 then jidlo = "HC black pepper" |
322 | - | cenajidla = 10 |
322 | + | cenajidla = 15 |
323 | elseif spices == 9 then jidlo = "HC ginger" | |
324 | - | elseif n == 63 then |
324 | + | cenajidla = 15 |
325 | - | jidlo = "x HC orange" |
325 | + | elseif spices == 10 then jidlo = "HC honey" |
326 | - | cenajidla = 15 |
326 | + | cenajidla = 10 |
327 | elseif spices == 11 then jidlo = "HC sesame" | |
328 | - | elseif n == 64 then |
328 | + | cenajidla = 15 |
329 | - | jidlo = "x HC chestnut" |
329 | + | elseif spices == 12 then jidlo = "HC curry leaves" |
330 | - | cenajidla = 5 |
330 | + | cenajidla = 15 |
331 | elseif spices == 13 then jidlo = "salt" | |
332 | - | elseif n == 65 then |
332 | + | cenajidla = 30 |
333 | - | jidlo = "x HC cherry" |
333 | + | end |
334 | ||
335 | elseif n >= 77 and n<= 90 then -- FISH | |
336 | - | elseif n == 66 then |
336 | + | local fish = math.random(1,28) |
337 | - | jidlo = "x HC banana" |
337 | + | if fish >= 1 and fish <= 17 then -- fish1 |
338 | cenajidla = 25 | |
339 | local fish1 = math.random(1, 17) | |
340 | - | elseif n == 67 then |
340 | + | if fish1 == 1 then jidlo = "ryba" -- 1.1.2.1.2.1 |
341 | - | jidlo = "x HC cashew" |
341 | + | elseif fish1 == 2 then jidlo = "HC raw bass" |
342 | elseif fish1 == 3 then jidlo = "HC raw carp" | |
343 | elseif fish1 == 4 then jidlo = "HC raw catfish" | |
344 | - | elseif n == 68 then |
344 | + | elseif fish1 == 5 then jidlo = "HC raw grouper" |
345 | - | jidlo = "x HC grapefruit" |
345 | + | elseif fish1 == 6 then jidlo = "HC raw herring" |
346 | elseif fish1 == 7 then jidlo = "HC raw tilapia" | |
347 | elseif fish1 == 8 then jidlo = "HC raw tuna" | |
348 | - | elseif n == 69 then |
348 | + | elseif fish1 == 9 then jidlo = "HC raw walleye" |
349 | - | jidlo = "x HC cinnamon" |
349 | + | elseif fish1 == 10 then jidlo = "HC raw green heart fish" |
350 | - | cenajidla = 30 |
350 | + | elseif fish1 == 11 then jidlo = "HC raw charr" |
351 | - | |
351 | + | elseif fish1 == 12 then jidlo = "HC raw mudfish" |
352 | - | elseif n == 70 then |
352 | + | elseif fish1 == 13 then jidlo = "HC raw trout" |
353 | - | jidlo = "x HC vanilla bean" |
353 | + | elseif fish1 == 14 then jidlo = "HC raw anchovy" |
354 | elseif fish1 == 15 then jidlo = "HC raw perch" | |
355 | elseif fish1 == 16 then jidlo = "HC raw snapper" | |
356 | - | elseif n == 71 then |
356 | + | elseif fish1 == 17 then jidlo = "HC raw eel" |
357 | - | jidlo = "x HC fig" |
357 | + | end -- 1.1.2.1.2.1E |
358 | ||
359 | elseif fish >= 18 and fish <= 28 then -- fish2 | |
360 | - | elseif n == 72 then |
360 | + | |
361 | - | jidlo = "x HC almond" |
361 | + | local fish2 = math.random(18,28) |
362 | if fish2 == 1 then jidlo = "HC raw crab" | |
363 | elseif fish2 == 2 then jidlo = "HC raw crayfish" | |
364 | - | elseif n == 73 then |
364 | + | elseif fish2 == 4 then jidlo = "HC raw frog" |
365 | - | jidlo = "x HC pomegranate" |
365 | + | elseif fish2 == 5 then jidlo = "HC raw octopus" |
366 | elseif fish2 == 6 then jidlo = "HC raw scallop" | |
367 | elseif fish2 == 7 then jidlo = "HC raw shrimp" | |
368 | - | elseif n == 74 then |
368 | + | elseif fish2 == 8 then jidlo = "HC raw snail" |
369 | - | jidlo = "x HC pepper" |
369 | + | elseif fish2 == 9 then jidlo = "HC raw turtle" |
370 | elseif fish2 == 10 then jidlo = "HC raw calamari" | |
371 | elseif fish2 == 11 then jidlo = "salmon" | |
372 | - | elseif n == 75 then |
372 | + | end |
373 | - | jidlo = "x HC broccoli" |
373 | + | end |
374 | ||
375 | elseif n >= 91 and n <= 100 then -- DRY PRODUCTS | |
376 | - | elseif n == 76 then |
376 | + | local dries = math.random(1,11) |
377 | - | jidlo = "x HC coffee" |
377 | + | if dries == 1 then jidlo = "PMP peanuts" |
378 | cenajidla = 30 | |
379 | elseif dries == 2 then jidlo = "HC tea leaf" | |
380 | - | elseif n == 77 then |
380 | + | cenajidla = 15 |
381 | - | jidlo = "x HC lime" |
381 | + | elseif dries == 3 then jidlo = "HC chestnut" |
382 | cenajidla = 5 | |
383 | elseif dries == 4 then jidlo = "HC cashew" | |
384 | - | elseif n == 78 then |
384 | + | cenajidla = 15 |
385 | - | jidlo = "x HC date" |
385 | + | elseif dries == 5 then jidlo = "HC almond" |
386 | cenajidla = 15 | |
387 | elseif dries == 6 then jidlo = "HC coffee" | |
388 | - | elseif n == 79 then |
388 | + | cenajidla = 15 |
389 | - | jidlo = "x HC ginger" |
389 | + | elseif dries == 7 then jidlo = "HC pistachio" |
390 | cenajidla = 15 | |
391 | elseif dries == 8 then jidlo = "HC peanut" | |
392 | - | elseif n == 80 then |
392 | + | cenajidla = 15 |
393 | - | jidlo = "x HC zucchini" |
393 | + | elseif dries == 9 then jidlo = "HC walnut" |
394 | cenajidla = 5 | |
395 | elseif dries == 10 then jidlo = "cocoa" | |
396 | - | elseif n == 81 then |
396 | + | cenajidla = 30 |
397 | - | jidlo = "x HC honey" |
397 | + | elseif dries == 11 then jidlo = "HC pecan" |
398 | cenajidla = 15 | |
399 | - | |
399 | + | end |
400 | - | elseif n == 82 then |
400 | + | |
401 | - | jidlo = "x PC wine grapes" |
401 | + | elseif n >= 101 and n <= 200 then |
402 | slot = 0 | |
403 | ||
404 | - | elseif n == 83 then |
404 | + | |
405 | - | jidlo = "x eggs" |
405 | + | end -- konec rng jidla 1.1.2.1.2.0E |
406 | end -- konec while loop pro generaci poptavky 1.1.2.1.0.0E | |
407 | ||
408 | - | elseif n == 84 then |
408 | + | |
409 | - | jidlo = "x HC peach" |
409 | + | |
410 | - | cenajidlo = 5 |
410 | + | |
411 | - | |
411 | + | |
412 | - | elseif n == 85 then |
412 | + | |
413 | - | jidlo = "x HC pistachio" |
413 | + | |
414 | t[4] = myID | |
415 | t[5] = "F" | |
416 | - | elseif n == 86 then |
416 | + | t[6] = "Dave's Corner" |
417 | - | jidlo = "x HC peanut" |
417 | + | |
418 | - | cenajidla = 15 |
418 | + | |
419 | rednet.open("top") | |
420 | - | elseif n == 87 then |
420 | + | |
421 | - | jidlo = "x HC celery" |
421 | + | |
422 | if msg == "full" then -- overi dostupnost slotu - pokud neni volny, opakuj gen 1.1.2.2.0.0 | |
423 | sleep(3) | |
424 | - | elseif n == 88 then |
424 | + | |
425 | - | jidlo = "x HC onion" |
425 | + | |
426 | else | |
427 | znovu = 0 | |
428 | - | elseif n == 89 then |
428 | + | |
429 | - | jidlo = "x HC apricot" |
429 | + | local savetable = {} |
430 | cena = cenajidla * pocet | |
431 | savetable[1] = pocet | |
432 | - | elseif n == 90 then |
432 | + | |
433 | - | jidlo = "x HC sesame" |
433 | + | |
434 | ||
435 | local fileWT = fs.open("currentoffer", "w") | |
436 | - | elseif n == 91 then |
436 | + | |
437 | - | jidlo = "x HC curry leaves" |
437 | + | |
438 | ||
439 | fcscreen() | |
440 | - | elseif n == 92 then |
440 | + | end -- konec overeni dostupnosti slotu 1.1.2.2.0.0E |
441 | - | jidlo = "x PC coffee" |
441 | + | end -- konec znovu loopu 1.1.1.0.0.0.0E |
442 | znovu = 1 | |
443 | end -- konec while loopu pro gen poptavky 1.1.0.0.0.0.0E | |
444 | - | elseif n == 93 then |
444 | + | end -- konec if statement pro overeni existence currentoffer 1.0.0.0.0.0.0E |