pepeknamornik

elektromer_manager

Sep 4th, 2020 (edited)
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.98 KB | None | 0 0
  1. local verze = "20.0319.3"
  2. local anim = 0.1
  3. local RamCesta = ("/C/system/RAM/SMB")
  4. local w, h = term.getSize()
  5. ----------------------------------------------------
  6. local f=fs.open("/C/system/RAM/user","r")
  7. user=f.readLine()
  8. pass=f.readLine()
  9. Fname=f.readLine()
  10. Lname=f.readLine()
  11. f.close()
  12. ----------------------------------------------------
  13. local f=fs.open("/C/system/Users/"..user.."/colors","r")
  14. local cnt=f.readAll()
  15. f.close()
  16. local nastaveni=textutils.unserialize(cnt)
  17. ----------------------------------------------------  
  18. local f=fs.open("/C/system/Users/"..user.."/textcol","r")
  19. local tnt=f.readAll()
  20. f.close()
  21. local text=textutils.unserialize(tnt)
  22. ----------------------------------------------------
  23. function ukonceni ()
  24.     fs.delete (RamCesta)
  25.     os.exit()
  26. end
  27.  
  28. function cbarva()
  29. lista.setTextColor(colors.black)
  30. lista.setBackgroundColor(colors.gray)
  31. end
  32.  
  33. function defaultvalue()
  34. end
  35.  
  36. function start()
  37. defaultvalue()
  38. local myWindow = window.create(term.current(),w/2-11,h/2-5,25,9)
  39. myWindow.setBackgroundColor(colors.yellow)
  40. myWindow.setTextColor(colors.black)
  41. myWindow.clear()
  42. myWindow.setCursorPos (8, 5)
  43. myWindow.write"SaMBa Manager"
  44. myWindow.setCursorPos (8, 6)
  45. myWindow.write"   (Alpha)   "
  46. myWindow.setCursorPos (1, 1)
  47. myWindow.write"Pepek@Soft"
  48. myWindow.setCursorPos (22, 9)
  49. myWindow.write"2020"
  50. sleep(1)
  51. menu()
  52. end
  53.  
  54. function plocha()
  55. w, h = term.getSize()
  56. paintutils.drawLine(1, 1, 51, 1, nastaveni.barva)
  57. paintutils.drawPixel (51,1, colors.red)
  58. term.setCursorPos (51,1)
  59. term.setTextColor(text.barva)
  60. write "*"
  61. barW = window.create(term.current(),1,2,w,1)
  62. barW.setBackgroundColor(colors.gray)
  63. barW.clear()
  64. barW.setTextColor(colors.white)
  65. barW.setCursorPos(2,1)
  66. barW.write"Samba Manager >"
  67. pozadi = window.create(term.current(),13,3,w,h-2)
  68. pozadi.setBackgroundColor(colors.white)
  69. pozadi.setTextColor(colors.black)
  70. pozadi.clear()
  71. lista = window.create(term.current(),1,3,12,h-2)
  72. lista.setBackgroundColor(nastaveni.barva)
  73. lista.setTextColor(text.barva)
  74. lista.clear()
  75. lista.setCursorPos(2,3)
  76. lista.write"Dashboard"
  77. lista.setCursorPos(2,h-2)
  78. lista.setTextColor(colors.white)
  79. lista.write("Pepek@Soft")
  80. term.setBackgroundColor(colors.lightGray)
  81. end
  82. -----------------------------------------------------------------------------
  83. local page = "main"
  84.  
  85. function main()
  86. barW.setCursorPos(19,1)
  87. barW.write"Dashboard"
  88. pozadi.setCursorPos(2,2)
  89. pozadi.write"it Will be Soon,"
  90. pozadi.setCursorPos(2,3)
  91. pozadi.write"we are working on development"
  92. end
  93.  
  94. function menu()
  95.     plocha()
  96.     if (page == "main") then
  97.         main ()
  98.     end
  99.  
  100.     while true do
  101.         local event, button, x, y = os.pullEvent("mouse_click")
  102.         xy = x..","..y
  103.        
  104.         if event == "mouse_click" and x >= 2 and x <= 12 and y == 5 then
  105.         cbarva()
  106.         lista.setCursorPos(1,3)--
  107.         lista.write" Dashboard  "
  108.         sleep(anim)
  109.         page = "main"
  110.         menu()
  111.         end
  112.        
  113.        
  114.         if x == 51 and y == 1 then
  115.             ukonceni ()
  116.         else
  117.             menu() -------- stejne jako nazev funkce
  118.         end
  119.     end
  120. end
  121.  
  122. start()
Add Comment
Please, Sign In to add comment