Guest User

1

a guest
Nov 27th, 2017
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.61 KB | None | 0 0
  1. shell.run("config")
  2.  
  3. function bg(col)
  4.   term.setBackgroundColor(col)
  5.   for xPos = 1,xMax do
  6.     for yPos = 1,yMax do
  7.       term.setCursorPos(xPos,yPos)
  8.       term.write(" ")
  9.     end
  10.   end
  11. end
  12.  
  13. function square(x1,y1,x2,y2,col)
  14.   term.setBackgroundColor(col)
  15.   for xPos = x1,x2 do
  16.     for yPos = y1,y2 do
  17.       term.setCursorPos(xPos,yPos)
  18.       term.write(" ")
  19.     end
  20.   end
  21. end
  22.  
  23. function JoJa(xP,yP)
  24.   term.setCursorPos(xP,yP)
  25.   term.setBackgroundColor(colors.gray)
  26.   term.setTextColor(colors.cyan)
  27.   term.write("Jo")
  28.   term.setTextColor(colors.orange)
  29.   term.write("Ja ")
  30.   term.setTextColor(colors.lightGray)
  31.   term.write("Productions")
  32. end
  33.  
  34. function printLogIn(num)
  35.   --layout
  36.   term.setTextColor(Tcol2)
  37.   square(3,5,xMax-2,5,Scol1)
  38.   term.setCursorPos(3,5)
  39.   term.write(" Login  Register")
  40.   square(3,6,xMax-2,yMax-4,Scol2)
  41.   term.setCursorPos(xMax-4,5)
  42.   term.setBackgroundColor(colors.red)
  43.   term.write(" x ")
  44.   --txt
  45.   term.setTextColor(Tcol1)
  46.   term.setBackgroundColor(Scol2)
  47.   if num == 1 then
  48.     term.setCursorPos(3,5)
  49.     term.write(" Login ")
  50.     term.setCursorPos(13,8)
  51.     term.write("Username:")
  52.     term.setCursorPos(13,10)
  53.     term.write("Password:")
  54.     term.setBackgroundColor(Scol1)
  55.     term.setCursorPos(xMax/2-3,yMax-5)
  56.     term.setTextColor(Tcol2)
  57.     term.write(" Login ")
  58.     term.setBackgroundColor(colors.gray)
  59.     for i = 0,17 do
  60.       term.setCursorPos(23+i,8)
  61.       term.write(" ")
  62.       term.setCursorPos(23+i,10)
  63.       term.write(" ")
  64.     end
  65.   elseif num == 2 then
  66.     term.setCursorPos(10,5)
  67.     term.write(" Register ")
  68.     term.setCursorPos(13,8)
  69.     term.write("Username:")
  70.     term.setCursorPos(13,10)
  71.     term.write("Password:")
  72.     term.setCursorPos(5,12)
  73.     term.write("confirm Password:")
  74.     term.setBackgroundColor(colors.gray)
  75.     for i = 0,17 do
  76.       term.setCursorPos(23+i,8)
  77.       term.write(" ")
  78.       term.setCursorPos(23+i,10)
  79.       term.write(" ")
  80.       term.setCursorPos(23+i,12)
  81.       term.write(" ")
  82.     end
  83.     term.setBackgroundColor(Scol1)
  84.     term.setCursorPos(xMax/2-4,yMax-5)
  85.     term.setTextColor(Tcol2)
  86.     term.write(" confirm ")
  87.   end
  88. end
  89.  
  90. bg(Bcol)
  91. square(1,1,xMax,1,colors.gray)
  92. JoJa(xMax/2-7,1)
  93. --printLogIn(2)
  94. --
  95. --term.setCursorPos(1,1)
  96. --
  97. stat = 1
  98. while true do
  99.   printLogIn(stat)
  100.   sleep(.1)
  101.   event,button,x,y = os.pullEvent("mouse_click")
  102.   --print(x.." "..y.." "..button)
  103.   --3,5  9,5    10,5    19,5
  104.   if x >= 3 and x <= 9 and y == 5 then
  105.     stat = 1
  106.   elseif x >= 10 and x <= 19 and y == 5 then
  107.     stat = 2
  108.   elseif x >= 47 and x <= 49 and y == 5 then
  109.     os.reboot()
  110.   end
  111. end
Add Comment
Please, Sign In to add comment