Advertisement
joshgreatuk

broken function

Jul 26th, 2017
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.16 KB | None | 0 0
  1. function as(eid,t)
  2.     term.clear()
  3.     paintutils.drawFilledBox(1,1,51,19,colors.lightBlue)
  4.     paintutils.drawLine(1,1,51,1,colors.blue)
  5.     term.setBackgroundColor(colors.blue)
  6.     term.setCursorPos(1,1)
  7.     print("LUAOS App Store")
  8.     local choice1 = "Exit"
  9.     local choice2 = "Download"
  10.     local choice3 = "Download"
  11.     local x1, y1 = 47,1
  12.     local x2, y2 = 43,2
  13.     local x3, y3 = 43,3
  14.     term.setCursorPos(x1,y1)
  15.     write(choice1)
  16.     term.setBackgroundColor(colors.lightBlue)
  17.     term.setCursorPos(x2,y2)
  18.     write(choice2)
  19.     term.setCursorPos(x3,y3)
  20.     write(choice2)
  21.     term.setCursorPos(1,2)
  22.     print("Network Manager:Manages Computer Networks")
  23.     term.setCursorPos(1,3)
  24.     print("Server Manager:Manages Server Networks")
  25.     while true do
  26.         local event, button, cx, cy = os.pullEvent()
  27.         if event == "mouse_click" then
  28.             if cx >= x1 and cx < choice1:len() and cy == y1 and button == 1 then
  29.                 ag(eid,t)
  30.                 break
  31.             else if cx >= x2 and cx < choice2:len() and cy == y2 and button == 1 then
  32.                 ad("network_manager",eid,t)
  33.                 break
  34.             else if cx >= x3 and cx < choice3:len() and cy == y3 and button == 1 then
  35.                 ad("server_manager",eid,t)
  36.                 break
  37.             end
  38.             end
  39.             end
  40.         end
  41.     end
  42. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement