Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CIE = 0 -- Counter Ingot Engine
- CBE = 0 -- Counter Block Engine
- CLI = 0 -- Counter Liquid Input
- CLO = 0 -- Counter Liquid Output
- mouseWidth = 0 -- Create MouseWidth Variable
- mouseHeight = 0 -- Create MouseHeight Variable
- monitor = peripheral.wrap("monitor_0") -- Wrap monitor_0 monitor to "monitor"
- monitor.clear() -- Clear Monitor
- monitor.setCursorPos(1,1) -- Set Cursor to Pos 1,1
- w,h=monitor.getSize() -- set W to Width of Monitor and H to Height
- print(w) -- Print Width
- print(h) -- Print Height
- monitor.setCursorPos(1,1)
- monitor.write("Ingot Engines:")
- monitor.setCursorPos(1,3)
- monitor.write("Block Engines:")
- monitor.setCursorPos(16,1)
- monitor.write("Filling Buffer Smeltery:")
- monitor.setCursorPos(16,3)
- monitor.write("Empying Buffer Smeltery:")
- monitor.setCursorPos(1, 7)
- monitor.write("Ingot Casting:")
- monitor.setCursorPos(1, 10)
- monitor.write("Block Casting:")
- monitor.setBackgroundColour((colours.lime)) -- Set monitor Background Color For button creation
- monitor.setCursorPos(4,2) -- Set Cursor postion to (2,2)
- monitor.write(" OFF ") -- (Write what ever needs to be 5 characters.)
- monitor.setCursorPos(4,4)
- monitor.write(" OFF ")
- monitor.setCursorPos(24,2)
- monitor.write(" OFF ")
- monitor.setCursorPos(24,4)
- monitor.write(" OFF ")
- monitor.setCursorPos(2,8)
- monitor.write(" 1I ")
- monitor.setCursorPos(13,8)
- monitor.write(" 3I ")
- monitor.setCursorPos(24,8)
- monitor.write(" 9I ")
- monitor.setCursorPos(35,8)
- monitor.write(" 15I ")
- monitor.setCursorPos(2,11)
- monitor.write(" 1B ")
- monitor.setCursorPos(13,11)
- monitor.write(" 3B ")
- monitor.setCursorPos(24,11)
- monitor.write(" 9B ")
- monitor.setCursorPos(35,11)
- monitor.write(" 15B ")
- monitor.setBackgroundColour((colours.black)) -- Set Background color to black
- function checkClickPosition()
- if mouseWidth > 3 and mouseWidth < 9 and mouseHeight == 2 then
- -- button one clicked
- if CIE == 0 then
- shell.run("IE") -- Run program IE
- monitor.setBackgroundColour((colours.red)) -- Set Background color red
- monitor.setCursorPos(4,2) -- set cursor pos to rewrite IE
- monitor.write(" ON ") -- rewrite IE
- CIE = 1
- elseif CIE == 1 then
- shell.run("SIE")
- monitor.setBackgroundColour((colours.lime)) -- Set Background color lime
- monitor.setCursorPos(4,2) -- set cursor pos to rewrite IE
- monitor.write(" OFF ") -- rewrite IE
- CIE = 0
- end
- elseif mouseWidth > 3 and mouseWidth < 9 and mouseHeight == 4 then
- if CBE == 0 then
- shell.run("BE") -- Run program BE
- monitor.setBackgroundColour((colours.red)) -- Set Background color red
- monitor.setCursorPos(4,4) -- set cursor pos to rewrite IE
- monitor.write(" ON ") -- rewrite ON
- CBE = 1
- elseif CBE == 1 then
- shell.run("SBE") -- Run program SBE
- monitor.setBackgroundColour((colours.lime)) -- Set Background color lime
- monitor.setCursorPos(4,4) -- set cursor pos to rewrite BE
- monitor.write(" OFF ") -- rewrite OFF
- CBE = 0
- end
- elseif mouseWidth > 23 and mouseWidth < 29 and mouseHeight == 2 then
- if CLI == 0 then
- shell.run("LI") -- Run program LI
- monitor.setBackgroundColour((colours.red)) -- Set Background color red
- monitor.setCursorPos(24,2) -- set cursor pos to rewrite ON
- monitor.write(" ON ") -- rewrite ON
- CLI = 1
- elseif CLI == 1 then
- shell.run("SLI") -- Run program SLI
- monitor.setBackgroundColour((colours.lime)) -- Set Background color lime
- monitor.setCursorPos(24,2) -- set cursor pos to rewrite OFF
- monitor.write(" OFF ") -- rewrite OFF
- CLI = 0
- end
- elseif mouseWidth > 23 and mouseWidth < 29 and mouseHeight == 4 then
- if CLO == 0 then
- shell.run("LO") -- Run program LO
- monitor.setBackgroundColour((colours.red)) -- Set Background color red
- monitor.setCursorPos(24,4) -- set cursor pos to rewrite ON
- monitor.write(" ON ") -- rewrite ON
- CLO = 1
- elseif CLO == 1 then
- shell.run("SLO") -- Run program SLO
- monitor.setBackgroundColour((colours.lime)) -- Set Background color lime
- monitor.setCursorPos(24,4) -- set cursor pos to rewrite OFF
- monitor.write(" OFF ") -- rewrite OFF
- CLO = 0
- end
- end -- ends the if loop
- end -- ends the function
- repeat --repeat all from above
- event,p1,p2,p3 = os.pullEvent() -- Get Event data. event,p1,p2,p3 from os.pullEvent()
- if event=="monitor_touch" then -- Event Mouse_touch (right click monitor)
- mouseWidth = p2 -- sets mouseWidth -- Set Mouse Width to p2
- mouseHeight = p3 -- and mouseHeight -- Set Mouse Height to p3
- checkClickPosition() -- this runs our function -- Runs the pervious CheckClickPosition Function
- end -- End the IF statement
- until event=="char" and p1==("x") -- Until the event "char" position 1 is X (aka when X is pressed) the programm will loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement