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
- CIN = 0 -- Counter Ingot Number
- CIC = 0 -- Counter Ingot Crafting (how many ingots are made.)
- CBN = 0 -- Counter Block Number
- CBC = 0 -- Counter Block Crafting (how many Blocks are made.)
- mouseWidth = 0 -- Create MouseWidth Variable
- mouseHeight = 0 -- Create MouseHeight Variable
- monitor = peripheral.wrap("monitor_0") -- Wrap monitor_0 monitor to "monitor"
- monitor.setBackgroundColour((colors.black)) -- Return to standart color BEFORE clearing the screen
- 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(4,8)
- monitor.write("SELECT")
- monitor.setCursorPos(4,11)
- monitor.write("SELECT")
- monitor.setBackgroundColour((colors.gray))
- monitor.setCursorPos(2,8)
- monitor.write("<-")
- monitor.setCursorPos(10,8)
- monitor.write("->")
- monitor.setCursorPos(2,11)
- monitor.write("<-")
- monitor.setCursorPos(10,11)
- monitor.write("->")
- 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
- elseif mouseWidth > 1 and mouseWidth < 3 and mouseHeight == 8 then
- if CIN > 0 then -- if the page counter is over 0
- CIN = CIN - 1 -- then subtract 1 from it
- else
- CIN = 0 -- If the page counter is at 0 make it 0
- end
- if CIN == 0 then -- When the Page counter is on 0
- monitor.setCursorPos(4,8)
- monitor.setBackgroundColour((colours.lime))
- monitor.write(" 1I ")
- CIC = 1
- elseif CIN == 1 then -- When the page counter is on 1
- monitor.setCursorPos(4,8)
- monitor.setBackgroundColour((colours.lime))
- monitor.write(" 3I ")
- CIC = 3
- elseif CIN == 2 then
- monitor.setCursorPos(4,8)
- monitor.setBackgroundColour((colours.lime))
- monitor.write(" 9I ")
- CIC = 9
- elseif CIN == 3 then
- monitor.setCursorPos(4,8)
- monitor.setBackgroundColour((colours.lime))
- monitor.write(" 15I ")
- CIC = 15
- end
- elseif mouseWidth > 9 and mouseWidth < 11 and mouseHeight == 8 then
- if CIN < 3 then -- if the page counter is under 3
- CIN = CIN + 1 -- Then add 1 to it
- else
- CIN = 3 -- if the page counter is over 3 make it 3
- end
- if CIN == 0 then
- monitor.setCursorPos(4,8)
- monitor.setBackgroundColour((colours.lime))
- monitor.write(" 1I ")
- CIC = 1
- elseif CIN == 1 then
- monitor.setCursorPos(4,8)
- monitor.setBackgroundColour((colours.lime))
- monitor.write(" 3I ")
- CIC = 3
- elseif CIN == 2 then
- monitor.setCursorPos(4,8)
- monitor.setBackgroundColour((colours.lime))
- monitor.write(" 9I ")
- CIC = 9
- elseif CIN == 3 then
- monitor.setCursorPos(4,8)
- monitor.setBackgroundColour((colours.lime))
- monitor.write(" 15I ")
- CIC = 15
- end
- elseif mouseWidth > 2 and mouseWidth < 10 and mouseHeight == 8 then
- if CIC == 1 then
- shell.run("1I")
- monitor.setCursorPos(4,8)
- monitor.setBackgroundColour((colors.red))
- monitor.write(" 1I ")
- sleep(2)
- monitor.setCursorPos(4,8)
- monitor.setBackgroundColour((colors.lime))
- monitor.write(" 1I ")
- elseif CIC == 3 then
- shell.run("3I")
- monitor.setCursorPos(4,8)
- monitor.setBackgroundColour((colors.red))
- monitor.write(" 3I ")
- sleep(2)
- monitor.setCursorPos(4,8)
- monitor.setBackgroundColour((colors.lime))
- monitor.write(" 3I ")
- elseif CIC == 9 then
- shell.run("9I")
- monitor.setCursorPos(4,8)
- monitor.setBackgroundColour((colors.red))
- monitor.write(" 9I ")
- sleep(2)
- monitor.setCursorPos(4,8)
- monitor.setBackgroundColour((colors.lime))
- monitor.write(" 9I ")
- elseif CIC == 15 then
- shell.run("15I")
- monitor.setCursorPos(4,8)
- monitor.setBackgroundColour((colors.red))
- monitor.write(" 15I ")
- sleep(2)
- monitor.setCursorPos(4,8)
- monitor.setBackgroundColour((colors.lime))
- monitor.write(" 15I ")
- end
- elseif mouseWidth > 1 and mouseWidth < 3 and mouseHeight == 11 then
- if CBN > 0 then -- if the page counter is over 0
- CBN = CBN - 1 -- then subtract 1 from it
- else
- CBN = 0 -- If the page counter is at 0 make it 0
- end
- if CBN == 0 then -- When the Page counter is on 0
- monitor.setCursorPos(4,11)
- monitor.setBackgroundColour((colours.lime))
- monitor.write(" 1B ")
- CBC = 1
- elseif CBN == 1 then -- When the page counter is on 1
- monitor.setCursorPos(4,11)
- monitor.setBackgroundColour((colours.lime))
- monitor.write(" 3B ")
- CBC = 3
- elseif CBN == 2 then
- monitor.setCursorPos(4,11)
- monitor.setBackgroundColour((colours.lime))
- monitor.write(" 9B ")
- CBC = 9
- elseif CIN == 3 then
- monitor.setCursorPos(4,11)
- monitor.setBackgroundColour((colours.lime))
- monitor.write(" 15B ")
- CBC = 15
- end
- elseif mouseWidth > 9 and mouseWidth < 11 and mouseHeight == 11 then
- if CBN < 3 then -- if the page counter is under 3
- CBN = CBN + 1 -- Then add 1 to it
- else
- CBN = 3 -- if the page counter is over 3 make it 3
- end
- if CBN == 0 then
- monitor.setCursorPos(4,11)
- monitor.setBackgroundColour((colours.lime))
- monitor.write(" 1B ")
- CBC = 1
- elseif CBN == 1 then
- monitor.setCursorPos(4,11)
- monitor.setBackgroundColour((colours.lime))
- monitor.write(" 3B ")
- CBC = 3
- elseif CBN == 2 then
- monitor.setCursorPos(4,11)
- monitor.setBackgroundColour((colours.lime))
- monitor.write(" 9B ")
- CBC = 9
- elseif CBN == 3 then
- monitor.setCursorPos(4,11)
- monitor.setBackgroundColour((colours.lime))
- monitor.write(" 15B ")
- CBC = 15
- end
- elseif mouseWidth > 2 and mouseWidth < 10 and mouseHeight == 11 then
- if CBN == 1 then
- shell.run("1B")
- monitor.setCursorPos(4,11)
- monitor.setBackgroundColour((colors.red))
- monitor.write(" 1B ")
- sleep(2)
- monitor.setCursorPos(4,11)
- monitor.setBackgroundColour((colors.lime))
- monitor.write(" 1B ")
- elseif CBC == 3 then
- shell.run("3B")
- monitor.setCursorPos(4,11)
- monitor.setBackgroundColour((colors.red))
- monitor.write(" 3B ")
- sleep(2)
- monitor.setCursorPos(4,11)
- monitor.setBackgroundColour((colors.lime))
- monitor.write(" 3B ")
- elseif CBC == 9 then
- shell.run("9B")
- monitor.setCursorPos(4,11)
- monitor.setBackgroundColour((colors.red))
- monitor.write(" 9B ")
- sleep(2)
- monitor.setCursorPos(4,11)
- monitor.setBackgroundColour((colors.lime))
- monitor.write(" 9B ")
- elseif CBC == 15 then
- shell.run("15B")
- monitor.setCursorPos(4,11)
- monitor.setBackgroundColour((colors.red))
- monitor.write(" 15B ")
- sleep(2)
- monitor.setCursorPos(4,11)
- monitor.setBackgroundColour((colors.lime))
- monitor.write(" 15B ")
- end
- end -- ends the if loop
- end -- ends the function
- repeat
- 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