Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- 987DVwt4
- local Terminal = require("/terminal").new()
- local active = false
- local showColorsWindow = false
- local showChanged = false
- function Main()
- active = true
- ShowMainPage()
- end
- function ShowMainPage()
- showChanged = false
- while true do
- local n = os.getComputerLabel() or ""
- Terminal:reset()
- Terminal:displayHeader({
- "Turtle Renamer:",
- "Use '"..Terminal.replaceSymbol.."' in your entry to color text.",
- "Enter '/c' to see a list of color ids.",
- "",
- "Name: '"..n.."'",
- "ID: "..os.getComputerID().."",
- "",
- })
- local text = Terminal:prompt("Enter name:")
- if text == "/c" then
- ShowColorsPage()
- else
- text = Terminal:mcColorize(text or "Turtle")
- local success = Terminal:promptConf("\nAre you sure you want '"..text.."'?",true)
- if success then
- shell.run("label set \""..text.."\"")
- sleep(0.5)
- Terminal:reset()
- break
- end
- end
- end
- end
- function ShowColorsPage()
- Terminal:cancelPrompt()
- showChanged = false
- Terminal:reset()
- Terminal:displayColumn(1,21,
- {
- "0 - Black",
- "2 - Dark Green",
- "4 - Dark Red",
- "6 - Gold",
- "8 - Dark Grey",
- "a - Green",
- "c - Red",
- "e - Yellow",
- "k - OBFUSCATE",
- "m - STRIKE-THROUGH",
- "o - ITALIC",
- }, {
- "1 - Dark Blue",
- "3 - Dark Aqua",
- "5 - Dark Purple",
- "7 - Grey",
- "9 - Blue",
- "b - Aqua",
- "d - Light Purple",
- "f - White",
- "l - BOLD",
- "n - UNDERLINE",
- "r - RESET",
- }
- )
- Terminal:pressAnyKeyToContinue();
- end
- Main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement