Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ver()
- return 0.4
- end
- function center(inp_text)
- if string.len(inp_text) > 49 then
- return "style.center(): string longer than 49"
- else
- spaces = ""
- limit = 24 - math.floor(string.len(inp_text) / 2)
- for i=1, limit do
- spaces = spaces.." "
- i = i + 1
- end
- return spaces..inp_text
- end
- end
- function right(inp_text)
- if string.len(inp_text) > 49 then
- return "style.left(): string longer than 49"
- else
- spaces = ""
- limit = 49 - string.len(inp_text)
- for i=1, limit do
- spaces = spaces.." "
- i = i + 1
- end
- return spaces..inp_text
- end
- end
- function shorten(inp_text, lenth)
- if string.len(inp_text) > lenth then
- inp_text = ".."..string.sub(inp_text, (string.len(inp_text) - (lenth - 3)))
- end
- return inp_text
- end
- function itemName(inp_text)
- if inp_text == nil then
- return "<unknown item>"
- else
- itemNameCuts = {"item.", "tile.", ".name"}
- for i=1, table.getn(itemNameCuts) do
- inp_text = string.gsub(inp_text, itemNameCuts[i], "")
- end
- return inp_text
- end
- end
Add Comment
Please, Sign In to add comment