Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Decompiler from JoJa Productions
- x,y = term.getSize()
- percentage = 0
- notrunning = true
- newfile = ""
- args = { ... }
- function gui()
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.cyan)
- term.setBackgroundColor(colors.black)
- term.setCursorPos((x-16)/2,1)
- term.write("Jo")
- term.setTextColor(colors.orange)
- term.write("Ja")
- term.setTextColor(colors.gray)
- term.write(" Productions")
- term.setTextColor(colors.white)
- if notrunning then
- term.setCursorPos((x-20)/2,y-6)
- term.write("Dateinamen eingeben:")
- term.setCursorPos((x-20)/2,y-4)
- else
- term.setCursorPos(4, y-6)
- term.setBackgroundColor(colors.green)
- for i=0,percent do
- term.write(" ")
- end
- term.setBackgroundColor(colors.red)
- for i=percent,x-8 do
- term.write(" ")
- end
- end
- end
- function compile(pname)
- file = fs.open(pname,"r")
- lines = file.readAll()
- linesarray = {}
- lines:gsub(".",function(c) table.insert(linesarray,c) end)
- for i=1,#linesarray do
- code = string.byte(linesarray[i])
- char = string.char(code-12)
- newfile = newfile..char
- end
- file.close()
- file = fs.open(string.sub(pname, 1, string.find(pname, ".joja")-1), "w")
- file.write(newfile)
- file.close()
- end
- running = true
- while notrunning do
- gui()
- if #args ~= 1 then
- pname = io.read()
- else
- pname = args[1]
- end
- if fs.exists(pname) and string.find(pname, ".joja") then
- notrunning = false
- compile(pname)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement