Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------ Variables ------------
- path = ""
- rank = ""
- headerIsCentered = true
- rankType = "1"
- kitHeader = "Rank kit"
- kit = {
- ""
- }
- kitItemPrefix = "--> "
- textSize = 1
- headerColor = colors.red
- divideColor = colors.yellow
- kitHeaderColor = colors.orange
- kitItemColor = colors.lime
- rankRankColor = colors.white
- rankTypeColor = colors.lightGray
- divideFormat = "="
- ------- Code below ----------------
- os.pullEvent = coroutine.yield
- mon = peripheral.find("monitor")
- mX, mY = mon.getSize()
- header = path..": "..rank
- os.setComputerLabel(header)
- divideString = ""
- repeat
- divideString = divideString..divideFormat
- until string.len(divideString) >= mX
- function cWrite(text,line)
- local len = string.len(text)
- mon.setCursorPos(math.floor((mX/2))-(len/2),line)
- mon.write(text)
- end
- mon.setTextScale(textSize)
- mon.setBackgroundColor(colors.black)
- mon.clear()
- mon.setTextColor(headerColor)
- if headerIsCentered == false then
- mon.setCursorPos(1,1)
- mon.write(header)
- else
- cWrite(header,1)
- end
- mon.setCursorPos(1,3)
- mon.setTextColor(divideColor)
- mon.write(divideString)
- mon.setCursorPos(1,5)
- mon.setTextColor(rankTypeColor)
- mon.write("Rank type: ")
- mon.setTextColor(rankRankColor)
- mon.write(tostring(rankType))
- mon.setTextColor(divideColor)
- mon.setCursorPos(1,7)
- mon.write(divideString)
- mon.setCursorPos(1,9)
- mon.setTextColor(kitHeaderColor)
- mon.write(kitHeader)
- yPos = 10
- mon.setTextColor(kitItemColor)
- for k,v in pairs(kit) do
- yPos = yPos + 1
- mon.setCursorPos(1,yPos)
- mon.write(kitItemPrefix..v)
- end
- -- Locking the pc
- while true do
- term.setBackgroundColor(colors.black)
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.lightGray)
- term.write("This computer is protected.")
- coroutine.yield()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement