Advertisement
CaptainSpaceCat

Remote Builder

Jun 6th, 2015
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.41 KB | None | 0 0
  1. if not fs.exists("clickables") then
  2.   shell.run("pastebin get Je7BEsW3 clickables")
  3. end
  4. if not pcall(test = clickables.Toggle:new("Test", 1, 1, 1, 1, 1, 1, 1, 1)) then
  5.   shell.run("delete clickables")
  6.   shell.run("pastebin get Je7BEsW3 clickables")
  7. end
  8. local w, h = term.getSize()
  9.  
  10. SchematicAdd = clickables.Toggle:new("Create a Schematic", 2, h - 1, 19, h - 1, 1, 16, 1, 13, false)
  11. SchematicUse = clickables.Toggle:new("Build a Schematic", w - 18, h - 1, w, h - 1, 1, 16, 1, 13, false)
  12. Begin = clickables.Button:new("Begin", w/2 - 2, h - 2, w/2 + 2, h - 2, 1, 16, 5, 16)
  13.  
  14. local mode = nil
  15. while true do
  16.   SchematicAdd:display()
  17.   SchematicUse:display()
  18.   Begin:display()
  19.   clickables.getEvents()
  20.   if SchematicAdd:check() then
  21.     mode = "add"
  22.     SchematicUse.state = false
  23.   elseif SchematicUse:check() then
  24.     mode = "use"
  25.     SchematicAdd.state = false
  26.   end
  27.   if mode == "add" and Begin:check() then           ------======ADD======------
  28.     term.setBackgroundColor(colors.black)
  29.     term.clear()
  30.    
  31.   elseif mode == "use" and Begin:check() then       ------======USE======------
  32.  
  33.   else
  34.     term.setCursorPos(w/2 - 2, h - 2)
  35.     term.setTextColor(colors.red)
  36.     term.write("Begin")
  37.     sleep(.2)
  38.     Begin:display()
  39.     sleep(.2)
  40.     term.setCursorPos(w/2 - 2, h - 2)
  41.     term.setTextColor(colors.red)
  42.     term.write("Begin")
  43.     sleep(.2)
  44.     Begin:display()
  45.     sleep(.2)
  46.   end
  47. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement