Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- p=0
- scroll = function()
- local event, scrollDirection, x, y = os.pullEvent("mouse_scroll")
- p = p+scrollDirection
- term.setCursorPos(1, 5)
- term.write(tostring(i))
- drawjobs(p)
- end
- drawjobs = function(start)
- term.clear()
- for i=1, 19 do
- term.setCursorPos(1, i)
- curjob = jobs[start+i]
- if curjob then
- code = curjob:sub(1, 10)
- codes[start+i] = code
- text = curjob:sub(11, #curjob)
- term.write(text)
- else
- break
- end
- end
- end
- file = fs.open("job", "r")
- jobs = {}
- codes = {}
- while true do
- line = file.readLine()
- if line then
- table.insert(jobs, line)
- else
- break
- end
- end
- drawjobs(0)
- while true do
- parallel.waitForAny(scroll())
- parallel.waitForAny(scroll())
- end
Advertisement
Add Comment
Please, Sign In to add comment