Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Iron Man Armor #CENSORED#
- mon = peripheral.find("monitor")
- function drawBackground()
- mon.setBackgroundColor(colors.black)
- mon.clear()
- mon.setTextColor(colors.black)
- x,y = mon.getSize()
- for yc = 1,15 do
- if yc%2 == 1 then
- mon.setBackgroundColor(colors.lightBlue)
- else
- mon.setBackgroundColor(colors.lightGray)
- end
- for xc = 1,x do
- mon.setCursorPos(xc, yc)
- mon.write(" ")
- end
- mon.setCursorPos(1,yc)
- mon.write(yc..":")
- end
- end
- function inputPage(level)
- mon.clear()
- mon.setBackgroundColor(colors.lightGray)
- mon.setCursorPos(x/2 - 4, y/2-1)
- mon.write("Enter label")
- mon.setCursorPos(x/2 - 4, y/2+1)
- mon.write("in computer")
- term.clear()
- x,y = term.getSize()
- term.setCursorPos(x/2-8, y/2-2)
- print("Enter Armor Type")
- term.setCursorPos(x/2 - 8, y/2)
- print(" ")
- term.setCursorPos(x/2 - 8, 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,14 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.lightBlue)
- else
- mon.setBackgroundColor(colors.lightGray)
- end
- mon.setTextColor(colors.white)
- mon.write(label)
- mon.setCursorPos(x-2, i)
- mon.setBackgroundColor(colors.black)
- mon.setTextColor(colors.white)
- mon.write(" X ")
- end
- end
- mon.setBackgroundColor(colors.red)
- mon.setCursorPos(x/2 - 5, 15)
- mon.write("Unequip Armor")
- if unequip then
- mon.setBackgroundColor(colors.black)
- mon.setTextColor(colors.white)
- mon.setCursorPos(x/2 - 10, 17)
- mon.write("Ready to unequip armor")
- mon.setCursorPos(x/2 - 12, 19)
- mon.write("Armor Removal Process Prepared. Enter Transponder Pad.")
- end
- end
- while true do
- x,y=mon.getSize()
- mon.clear()
- drawBackground()
- drawButtons()
- event, param1, param2, param3 = os.pullEvent("monitor_touch")
- if param2 < x - 2 and param3 < 15 then
- if fs.exists(tostring(param3)) then
- rs.setAnalogOutput("back", tonumber(param3))
- unequip = false
- else
- inputPage(param3)
- end
- elseif param3 == 15 then
- rs.setAnalogOutput("back", 15)
- unequip = true
- else
- fs.delete(tostring(param3))
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement