Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This code is made by Plazter, Feel free to change the code for the better.
- -- The code was made to make it easy for spawn monitors in a minecraft server.
- m = peripheral.find("monitor")
- -- settings
- local function mWrite(text)
- local x2,y2 = m.getCursorPos()
- local x,y = m.getSize()
- m.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
- m.write(text)
- end
- local function nLine()
- line = line + 2
- m.setCursorPos(1,line)
- end
- local function rank(text)
- m.setCursorPos(1,line)
- mWrite(text)
- nu = 0
- end
- local function msg(text)
- line = line +1
- m.setCursorPos(1,line)
- nu = nu + 1
- m.write(nu..": ".. text)
- end
- local function col(text)
- if text == "white" then
- m.setTextColor(colors.white)
- elseif text == "black" then
- m.setTextColor(colors.black)
- elseif text == "red" then
- m.setTextColor(colors.red)
- elseif text == "green" then
- m.setTextColor(colors.green)
- elseif text == "orange" then
- m.setTextColor(colors.orange)
- elseif text == "gray" then
- m.setTextColor(colors.gray)
- elseif text == "lgray" then
- m.setTextColor(colors.lightGray)
- elseif text == "brown" then
- m.setTextColor(colors.brown)
- elseif text == "blue" then
- m.setTextColor(colors.blue)
- elseif text == "cyan" then
- m.setTextColor(colors.cyan)
- elseif text == "purple" then
- m.setTextColor(colors.purple)
- elseif text == "pink" then
- m.setTextColor(colors.pink)
- elseif text == "lime" then
- m.setTextColor(colors.lime)
- elseif text == "lblue" then
- m.setTextColor(colors.lightBlue)
- elseif text == "magenta" then
- m.setTextColor(colors.magenta)
- elseif text == "yellow" then
- m.setTextColor(colors.yellow)
- end
- end
- local function title(text)
- m.clear()
- m.setCursorPos(1,1)
- mWrite(text)
- end
- line = 1
- nu = 0
- -- Main program, Dont delete above this
- title("Your Title here")
- msg("some rule or perk")
- msg("Perk")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement