Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ver = 5
- function drawScreen(staticScreen, tableScreen)
- running = true
- rkeyp = true
- cselected = 1
- num = 1
- static = true
- while running == true do
- term.clear()
- term.setCursorPos(1, 1)
- screenX, screenY = term.getSize()
- rkeyp = true
- isPrint = true
- num = 1
- static = true
- staticNum = 1
- while static == true do
- line = staticScreen[staticNum]
- if line ~= nil then
- print(line)
- staticNum = staticNum + 1
- else
- static = false
- end
- end
- num = 1
- print(" ")
- while isPrint == true do
- line = tableScreen[num]
- if line ~= nil and num ~= cselected then
- print(line)
- num = num + 1
- elseif line ~= nil and num == cselected then
- print("["..line.."]")
- num = num + 1
- else
- isPrint = false
- end
- end
- while rkeyp == true do
- breaker = os.startTimer(1)
- event = {os.pullEvent()}
- param = event[2]
- if event[1] == "key" then
- if param == 200 then
- cselected = cselected - 1
- if cselected <= 0 then
- cselected = num - 1
- end
- rkeyp = false
- elseif param == 208 then
- cselected = cselected + 1
- if cselected >= num then
- cselected = 1
- end
- rkeyp = false
- elseif param == 28 then
- return cselected
- elseif param == 15 then
- return 999
- end
- elseif event[1] == "mouse_click" then
- start = staticNum
- selectedNum = event[4] - start
- if selectedNum > 0 and selectedNum <= num then
- return selectedNum
- end
- end
- end
- end
- end
- function silentPastebin(target, path)
- if fs.exists(path) then
- return "Exists"
- end
- paste = http.get("http://pastebin.com/raw.php?i="..textutils.urlEncode(target))
- if paste then
- text = paste.readAll()
- paste.close()
- file = fs.open(path, "w")
- file.write(text)
- file.close()
- return "Success"
- else
- return "Failed"
- end
- end
- function update(targetDir)
- info = http.get("http://pastebin.com/raw.php?i=7qyyZwiT")
- check = info.readLine()
- version = info.readLine()
- pointer = info.readLine()
- info.close()
- info = nil
- if check == "Jenisis" then
- if version == ver then
- return "Up to date."
- else
- new = http.get("http://pastebin.com/raw.php?i="..pointer)
- updateCopy = new.readAll()
- new.close()
- file = fs.open(targetDir, "w")
- file.write(updateCopy)
- file.close()
- print("Update Finished.")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement