Advertisement
Le_JuiceBOX

ComputerCraft_ColorLabeler_Computer

Apr 18th, 2023
734
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. local SEPERATOR = "======================================="
  2. local SYMBOL = "§"
  3. local PATTERN = "&"
  4.  
  5. function MAIN()
  6.     clear()
  7.     say(SEPERATOR)
  8.     say("Welcome to the AdvancedLabeler!")
  9.     say("Use the pattern '"..PATTERN.."C' to add color this computers's label.")
  10.     say(SEPERATOR)
  11.     say("Enter your new label/nametag:")
  12.     local labelText = PATTERN.."f"..io.read() --// resets the default italic
  13.     labelText = string.gsub(labelText,PATTERN,SYMBOL)
  14.     say(SEPERATOR.."\n")
  15.     shell.run("label set \""..labelText.."\"")
  16.     say("Renamed turtle to \""..labelText.."\".\nEnd.\n")
  17.     say(SEPERATOR)
  18. end
  19.  
  20. function clear() shell.run("clear"); end
  21. function say(...) print(...); end
  22.  
  23. MAIN()
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement