Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local verze = "21.0610.R1"
- local anim = 0.1
- local w, h = term.getSize()
- local page = "main"
- local kabel = "bottom"
- local poplach = false
- local i = 0
- local j = 0
- local popbar = 0
- ----------------------------------------------------
- local f=fs.open("/C/system/RAM/user","r")
- user=f.readLine()
- pass=f.readLine()
- Fname=f.readLine()
- Lname=f.readLine()
- f.close()
- function ukonceni ()
- fs.delete (RamCesta)
- error()
- end
- function cbarva()
- lista.setTextColor(colors.black)
- lista.setBackgroundColor(colors.gray)
- end
- function defaultvalue()
- end
- function start()
- defaultvalue()
- local myWindow = window.create(term.current(),w/2-11,h/2-5,25,9)
- myWindow.setBackgroundColor(colors.orange)
- myWindow.setTextColor(colors.black)
- myWindow.clear()
- myWindow.setCursorPos (8, 5)
- myWindow.write"HZS Software"
- myWindow.setCursorPos (1, 9)
- myWindow.write(verze)
- myWindow.setCursorPos (1, 1)
- myWindow.write"Pepek@Soft"
- myWindow.setCursorPos (22, 9)
- myWindow.write"2021"
- sleep(1)
- menu()
- end
- function plocha()
- w, h = term.getSize()
- paintutils.drawLine(1, 1, w, 1, colors.orange)
- paintutils.drawPixel (w,1, colors.red)
- term.setCursorPos (w,1)
- term.setTextColor(colors.black)
- write "*"
- pozadi = window.create(term.current(),1,2,w,h)
- pozadi.setBackgroundColor(colors.white)
- pozadi.setTextColor(colors.black)
- pozadi.clear()
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.lightGray)
- term.setCursorPos(1,h) write"Pepek@Soft"
- end
- -----------------------------------------------------------------------------
- function main()
- pozadi.setTextColor(colors.black)
- pozadi.setCursorPos(2,2)
- pozadi.write"Stav: "
- pozadi.setBackgroundColor(colors.lightGray)
- pozadi.setCursorPos(w-13,4)
- pozadi.write(" Poplach! ")
- end
- function poplachfun()
- if poplach then
- popbar = 128
- pozadi.setBackgroundColor(colors.red)
- i = i+1
- else
- popbar = 0
- pozadi.setBackgroundColor(colors.lightGray)
- end
- pozadi.setCursorPos(w-13,4)
- pozadi.write(" Poplach! ")
- end
- function opakovani()
- poplachfun()
- red()
- cas()
- if (i==10) then i = 0 commands.exec("/tellraw @a [{\"text\":\"TEST! TEST! POZOR! POZARNI POPLACH! SVOLAVANI JEDNOTEK! -227 69 250\",\"color\":\"red\"}]</color></insert>") end
- end
- function red ()
- local barvy = 0
- barvy = popbar
- redstone.setBundledOutput(kabel, barvy)
- end
- function cas()
- term.setTextColor(colors.black)
- term.setBackgroundColor(colors.orange)
- if os.time() > 12 then
- term.setCursorPos(2,1)
- write(textutils.formatTime(os.time(), true))
- else
- term.setCursorPos(3, 1)
- write(textutils.formatTime(os.time(), true))
- end
- end
- function menu()
- plocha()
- if (page == "main") then
- main ()
- end
- while true do
- os.startTimer(1.5)
- opakovani()
- local event, button, x, y = os.pullEvent()
- if event == "mouse_click" and x >= w-13 and x <= w and y == 5 then
- poplach = not poplach
- sleep(anim)
- menu()
- end
- if x == w and y == 1 then
- ukonceni ()
- else
- menu() -------- stejne jako nazev funkce
- end
- end
- end
- start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement