Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function cprint(...)
- local s = "&1"
- for k, v in ipairs(arg) do
- s = s .. v
- end
- s = s .. "&0"
- local fields = {}
- local lastcolor, lastpos = "0", 0
- for pos, clr in s:gmatch"()&(%x)" do
- table.insert(fields, {s:sub(lastpos + 2, pos - 1), lastcolor})
- lastcolor, lastpos = clr , pos
- end
- for i = 2, #fields do
- term.setTextColor(2 ^ (tonumber(fields[i][2], 16)))
- io.write(fields[i][1])
- end
- end
- cprint("&1Getting Updated Version... \n\n")
- shell.run("pastebin", "get", "dGA50rfG", ".userpastebin.updated")
- cprint("\n&1")
- if fs.exists(shell.resolve(".userpastebin.updated")) == true then
- cprint("&1Success!\n")
- else
- cprint("&1Failed!&0\n")
- return
- end
- if fs.exists(shell.resolve("userpastebin")) == true then
- cprint("&1Removing Old Version... ")
- shell.run("rm", "userpastebin")
- if fs.exists(shell.resolve("userpastebin")) == false then
- cprint("&1Success!\n")
- else
- cprint("&1Failed!&0\n")
- return
- end
- end
- cprint("&1Renaming Updated Version... ")
- shell.run("rename", ".userpastebin.updated", "userpastebin")
- if fs.exists(shell.resolve("userpastebin")) == true then
- cprint("&1Success!&0\n")
- shell.run("userpastebin", "update", "rm")
- else
- cprint("&1Failed!&0\n")
- return
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement