Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setBackgroundColor(colors.blue)
- term.setTextColor(colors.yellow)
- term.clear()
- term.setCursorPos(20,8)
- print("Kopaci stroj")
- term.setTextColor(colors.white)
- term.setCursorPos(47,18)
- print("4.0")
- term.setCursorPos(21,9)
- term.setBackgroundColor(colors.lime)
- function load()
- write(" ")
- sleep(0.05)
- end
- load()
- load()
- load()
- load()
- load()
- load()
- load()
- load()
- load()
- load()
- sleep(0.1)
- function home()
- term.clear()
- term.setBackgroundColor(colors.blue)
- term.setTextColor(colors.blue)
- term.clear()
- term.setBackgroundColor(colors.lime)
- term.setCursorPos(1,1)
- term.clearLine()
- term.setCursorPos(20,1)
- print("Kopaci stroj")
- term.setTextColor(colors.white)
- term.setCursorPos(51,1)
- print("X")
- term.setBackgroundColor(colors.blue)
- term.setCursorPos(47,18)
- print("4.0")
- term.setCursorPos(1,3)
- end
- g=10
- g0=g
- function log()
- term.setCursorPos(g,14)
- term.setBackgroundColor(colors.yellow)
- write(" ")
- term.setBackgroundColor(colors.blue)
- g=g+1
- if g == 43 then
- g=g0
- term.setCursorPos(1,14)
- print(" | |")
- end
- end
- function log4()
- for i=1,4 do
- log()
- end
- end
- --Funkce
- c=0.6
- d=0.2
- k=0.4
- function off()
- sleep(1.4)
- rs.setBundledOutput("back", 0)
- sleep(c)
- end
- function dolu()
- rs.setBundledOutput("back", colors.orange)
- off()
- end
- function nahoru()
- rs.setBundledOutput("back", colors.magenta)
- off()
- end
- function dopredu()
- rs.setBundledOutput("back", colors.lightBlue)
- off()
- end
- function dozadu()
- rs.setBundledOutput("back", colors.yellow)
- off()
- end
- function doleva()
- rs.setBundledOutput("back", colors.lime)
- off()
- end
- function doprava()
- rs.setBundledOutput("back", colors.pink)
- off()
- end
- function kop()
- rs.setBundledOutput("back", colors.gray)
- sleep(k)
- rs.setBundledOutput("back", 0)
- end
- function dopredu16()
- for i=1,16 do
- dopredu()
- sleep(c)
- end
- end
- function dozadu16()
- for i=1,16 do
- dozadu()
- sleep(c)
- end
- end
- function doleva16()
- for i=1,16 do
- doleva()
- sleep(c)
- end
- end
- function doprava16()
- for i=1,16 do
- doprava()
- sleep(c)
- end
- end
- function kopat()
- sleep(c)
- for i=1,116 do
- kop()
- sleep(d)
- dolu()
- sleep(d)
- end
- kop()
- for i=1,116 do
- sleep(c)
- nahoru()
- end
- sleep(c)
- end
- function c2x2()
- log()
- kopat()
- log4()
- log4()
- doprava16()
- log()
- log()
- kopat()
- log4()
- log4()
- dopredu16()
- log()
- log()
- kopat()
- log4()
- log4()
- doleva16()
- log()
- log()
- kopat()
- log()
- log()
- end
- function c4x4()
- log()
- kopat()
- log()
- doprava16()
- log()
- kopat()
- log()
- doprava16()
- log()
- kopat()
- log()
- doprava16()
- log()
- kopat()
- log()
- dopredu16()
- log()
- kopat()
- log()
- doleva16()
- log()
- kopat()
- log()
- doleva16()
- log()
- kopat()
- log()
- doleva16()
- log()
- kopat()
- log()
- dopredu16()
- log()
- kopat()
- log()
- doprava16()
- log()
- kopat()
- log()
- doprava16()
- log()
- kopat()
- log()
- doprava16()
- log()
- kopat()
- log()
- dopredu16()
- log()
- kopat()
- log()
- doleva16()
- log()
- kopat()
- log()
- doleva16()
- log()
- kopat()
- log()
- doleva16()
- log()
- kopat()
- log()
- log()
- end
- function c4x8()
- c4x4()
- dopredu16()
- c4x4()
- end
- --Menu
- home()
- print(" +----------+----------+----------+")
- print(" | 1 Blok | 8 Bloku | 16 Bloku |")
- print(" | + + | + + | + + |")
- print(" | + + | + + | + + |")
- print(" | + + | + + | + + |")
- print(" +----------+----------+----------+")
- print(" +--------+-----+-----+-----+-----+")
- print(" | Kopat | 2x2 | 4x4 | 4x8 | |")
- print(" | + | + | + | + | |")
- print(" +--------+-----+-----+-----+-----+")
- print(" +--------------------------------+")
- print(" | |")
- print(" +--------------------------------+")
- term.setCursorPos(1,14)
- while true do
- term.setCursorPos(1,14)
- term.setBackgroundColor(colors.blue)
- local event, button, X, Y = os.pullEvent("mouse_click")
- X = X..","..Y
- if X == "51,1" and button == 1 then
- sleep(0.4)
- term.setBackgroundColor(colors.black)
- shell.run("clear")
- break
- elseif X == "13,5" and button == 1 then --Dopredu 1
- term.setCursorPos(13,6)
- term.setBackgroundColor(colors.red)
- write(" ")
- dopredu()
- sleep(0.2)
- term.setCursorPos(13,6)
- term.setBackgroundColor(colors.blue)
- write(" ")
- elseif X == "11,6" and button == 1 then --Doleva 1
- term.setCursorPos(13,6)
- term.setBackgroundColor(colors.red)
- write(" ")
- doleva()
- sleep(0.2)
- term.setCursorPos(13,6)
- term.setBackgroundColor(colors.blue)
- write(" ")
- elseif X == "13,7" and button == 1 then --Dozadu 1
- term.setCursorPos(13,6)
- term.setBackgroundColor(colors.red)
- write(" ")
- dozadu()
- sleep(0.2)
- term.setCursorPos(13,6)
- term.setBackgroundColor(colors.blue)
- write(" ")
- elseif X == "15,6" and button == 1 then --Doprava 1
- term.setCursorPos(13,6)
- term.setBackgroundColor(colors.red)
- write(" ")
- doprava()
- sleep(0.2)
- term.setCursorPos(13,6)
- term.setBackgroundColor(colors.blue)
- write(" ")
- elseif X == "18,5" and button == 1 then --Nahoru 1
- term.setCursorPos(18,6)
- term.setBackgroundColor(colors.red)
- write(" ")
- nahoru()
- sleep(0.2)
- term.setCursorPos(18,6)
- term.setBackgroundColor(colors.blue)
- write(" ")
- elseif X == "18,7" and button == 1 then --Dolu 1
- term.setCursorPos(18,6)
- term.setBackgroundColor(colors.red)
- write(" ")
- dolu()
- sleep(0.2)
- term.setCursorPos(18,6)
- term.setBackgroundColor(colors.blue)
- write(" ")
- elseif X == "24,5" and button == 1 then --Dopredu 8
- term.setCursorPos(24,6)
- term.setBackgroundColor(colors.red)
- write(" ")
- for i=1,8 do
- sleep(0.2)
- dopredu()
- end
- sleep(0.2)
- term.setCursorPos(24,6)
- term.setBackgroundColor(colors.blue)
- write(" ")
- elseif X == "22,6" and button == 1 then --Doleva 8
- term.setCursorPos(24,6)
- term.setBackgroundColor(colors.red)
- write(" ")
- for i=1,8 do
- sleep(0.2)
- doleva()
- end
- sleep(0.2)
- term.setCursorPos(24,6)
- term.setBackgroundColor(colors.blue)
- write(" ")
- elseif X == "24,7" and button == 1 then --Dozadu 8
- term.setCursorPos(24,6)
- term.setBackgroundColor(colors.red)
- write(" ")
- for i=1,8 do
- sleep(0.2)
- dozadu()
- end
- sleep(0.2)
- term.setCursorPos(24,6)
- term.setBackgroundColor(colors.blue)
- write(" ")
- elseif X == "26,6" and button == 1 then --Doprava 8
- term.setCursorPos(24,6)
- term.setBackgroundColor(colors.red)
- write(" ")
- for i=1,8 do
- sleep(0.2)
- doprava()
- end
- sleep(0.2)
- term.setCursorPos(24,6)
- term.setBackgroundColor(colors.blue)
- write(" ")
- elseif X == "29,5" and button == 1 then --Nahoru 8
- term.setCursorPos(29,6)
- term.setBackgroundColor(colors.red)
- write(" ")
- for i=1,8 do
- sleep(0.2)
- nahoru()
- end
- sleep(0.2)
- term.setCursorPos(29,6)
- term.setBackgroundColor(colors.blue)
- write(" ")
- elseif X == "29,7" and button == 1 then --Dolu 8
- term.setCursorPos(29,6)
- term.setBackgroundColor(colors.red)
- write(" ")
- for i=1,8 do
- sleep(0.2)
- dolu()
- sleep(0.2)
- end
- term.setCursorPos(29,6)
- term.setBackgroundColor(colors.blue)
- write(" ")
- elseif X == "35,5" and button == 1 then --Dopredu 16
- term.setCursorPos(35,6)
- term.setBackgroundColor(colors.red)
- write(" ")
- for i=1,16 do
- sleep(0.2)
- dopredu()
- end
- sleep(0.2)
- term.setCursorPos(35,6)
- term.setBackgroundColor(colors.blue)
- write(" ")
- elseif X == "33,6" and button == 1 then --Doleva 16
- term.setCursorPos(35,6)
- term.setBackgroundColor(colors.red)
- write(" ")
- for i=1,16 do
- sleep(0.2)
- doleva()
- end
- sleep(0.2)
- term.setCursorPos(35,6)
- term.setBackgroundColor(colors.blue)
- write(" ")
- elseif X == "35,7" and button == 1 then --Dozadu 16
- term.setCursorPos(35,6)
- term.setBackgroundColor(colors.red)
- write(" ")
- for i=1,16 do
- sleep(0.2)
- dozadu()
- end
- sleep(0.2)
- term.setCursorPos(35,6)
- term.setBackgroundColor(colors.blue)
- write(" ")
- elseif X == "37,6" and button == 1 then --Doprava 16
- term.setCursorPos(35,6)
- term.setBackgroundColor(colors.red)
- write(" ")
- for i=1,16 do
- sleep(0.2)
- doprava()
- end
- sleep(0.2)
- term.setCursorPos(35,6)
- term.setBackgroundColor(colors.blue)
- write(" ")
- elseif X == "40,5" and button == 1 then --Nahoru 16
- term.setCursorPos(40,6)
- term.setBackgroundColor(colors.red)
- write(" ")
- for i=1,16 do
- sleep(0.2)
- nahoru()
- end
- sleep(0.2)
- term.setCursorPos(40,6)
- term.setBackgroundColor(colors.blue)
- write(" ")
- elseif X == "40,7" and button == 1 then --Dolu 16
- term.setCursorPos(40,6)
- term.setBackgroundColor(colors.red)
- write(" ")
- for i=1,16 do
- sleep(0.2)
- dolu()
- end
- sleep(0.2)
- term.setCursorPos(40,6)
- term.setBackgroundColor(colors.blue)
- write(" ")
- elseif X == "14,11" and button == 1 then --Kopat (1 Chunk)
- term.setCursorPos(14,11)
- term.setBackgroundColor(colors.red)
- write(" ")
- kopat()
- sleep(0.2)
- term.setCursorPos(14,11)
- term.setBackgroundColor(colors.blue)
- write("+")
- elseif X == "21,11" and button == 1 then --Kopat 2x2
- term.setCursorPos(21,11)
- term.setBackgroundColor(colors.red)
- write(" ")
- c2x2()
- sleep(0.2)
- term.setCursorPos(21,11)
- term.setBackgroundColor(colors.blue)
- write("+")
- elseif X == "27,11" and button == 1 then --Kopat 4x4
- term.setCursorPos(27,11)
- term.setBackgroundColor(colors.red)
- write(" ")
- c4x4()
- sleep(0.2)
- term.setCursorPos(27,11)
- term.setBackgroundColor(colors.blue)
- write("+")
- elseif X == "33,11" and button == 1 then --Kopat 4x8
- term.setCursorPos(33,11)
- term.setBackgroundColor(colors.red)
- write(" ")
- c4x8()
- sleep(0.2)
- term.setCursorPos(33,11)
- term.setBackgroundColor(colors.blue)
- write("+")
- elseif X == "39,11" and button == 1 then --Nic
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement