Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.find("monitor")
- freqRange = 60
- ECInput = peripheral.wrap("top")
- ECOutput = peripheral.wrap("bottom")
- ioPort = peripheral.wrap("right")
- function drawBackground()
- mon.setBackgroundColor(colors.black)
- mon.clear()
- x,y = mon.getSize()
- for yc = 1,y do
- if yc%2 == 1 then
- mon.setBackgroundColor(colors.purple)
- else
- mon.setBackgroundColor(colors.magenta)
- end
- for xc = 1,x do
- mon.setCursorPos(xc, yc)
- mon.write(" ")
- end
- end
- end
- function inputPage(level)
- mon.clear()
- mon.setBackgroundColor(colors.pink)
- mon.setCursorPos(1, 1)
- mon.write("go to")
- mon.setCursorPos(1, 2)
- mon.write("computer")
- term.clear()
- x,y = term.getSize()
- term.setCursorPos(x/2-8, y/2-2)
- print("Enter Name")
- term.setCursorPos(2, y/2)
- print(" ")
- term.setCursorPos(2, y/2)
- label = read()
- term.setBackgroundColor(colors.black)
- term.clear()
- file = fs.open(tostring(param3), "w")
- file.write(label)
- file.close()
- end
- function drawButtons()
- x,y = mon.getSize()
- for i=1,y do
- if fs.exists(tostring(i)) then
- file = fs.open(tostring(i), "r")
- label = file.readAll()
- file.close()
- mon.setCursorPos(x/2 - string.len(label)/2, i)
- if i%2 == 1 then
- mon.setBackgroundColor(colors.purple)
- else
- mon.setBackgroundColor(colors.magenta)
- end
- mon.setTextColor(colors.white)
- mon.write(label)
- mon.setCursorPos(x, i)
- mon.setBackgroundColor(colors.black)
- mon.setTextColor(colors.white)
- mon.write("X")
- end
- end
- end
- if fs.exists("freq") then
- file = fs.open("freq", "r")
- freq = file.readAll()
- file.close()
- else
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("GO TO")
- mon.setCursorPos(1,1)
- mon.write("COMPUTER")
- term.clear()
- term.setCursorPos(1,1)
- print("Enter a unique number for where you want this pad to appear on the touchscreen. 1 is the top of the screen:")
- write("> ")
- freq = read()
- file = fs.open("freq", "w")
- file.write(freq)
- file.close()
- end
- if fs.exists("incCheck") == false then
- shell.run("pastebin get kSr7S9ym incCheck")
- end
- ECInput.setFrequency(freq + freqRange)
- ECOutput.setFrequency(freqRange)
- shell.openTab("incCheck")
- while true do
- x,y=mon.getSize()
- mon.clear()
- drawBackground()
- drawButtons()
- event, param1, param2, param3 = os.pullEvent("monitor_touch")
- if param2 < x then
- if fs.exists(tostring(param3)) then
- ECInput.setFrequency(freqRange)
- ECOutput.setFrequency(param3 + freqRange)
- if ECInput.pushItem("East",1) == 1 then
- rs.setOutput("back", true)
- sleep(3)
- rs.setOutput("back", false)
- var = ioPort.getStackInSlot(1)
- while var == nil do
- sleep(0.1)
- var = ioPort.getStackInSlot(1)
- end
- var = ioPort.getStackInSlot(2)
- while var == nil do
- rs.setAnalogOutput("right", 1)
- sleep(0.5)
- rs.setOutput("right", false)
- var = ioPort.getStackInSlot(2)
- end
- ioPort.pushItem("down", 2)
- rs.setOutput("right", false)
- rs.setOutput("back", false)
- ECInput.setFrequency(freqRange + freq)
- else
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("No Drive")
- sleep(1)
- end
- else
- inputPage(param3)
- end
- else
- fs.delete(tostring(param3))
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement