Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Buffer= {}
- local Object= {}
- local goal= {"computer","monitor","drive","printer"}
- local limit= 20000
- local X,Y= term.getSize()
- Object[1]= {}
- Object[1].stage= 0
- Object[1].limit= 10
- function main(update)
- scanner(update)
- end
- function scanner(update)
- if (update) then
- gCount,count= 0,0
- while true do
- for q=1,#goal do
- h= peripheral.wrap(goal[q].."_"..gCount)
- if (h ~= nil) then
- Buffer[#Buffer+1]= {}
- Buffer[#Buffer].name= goal[q].."_"..gCount
- end
- end
- gCount= gCount+1
- count= count+1
- per= gCount/(limit/(X-8))
- Object[1].stage= math.ceil(per)
- if (count >= 500) then draw("Scanning",".",1,1) count= 0 sleep(0) end
- if (gCount >= limit) then gCount= 0 Buffer= {} end
- end
- else
- end
- end
- function draw(Text,simbol,x,y)
- term.clear()
- term.setCursorPos(x,y)
- io.write(Text)
- for i=1,Object[1].stage do
- io.write(simbol)
- end
- print()
- --print(Object[1].stage)
- for i=1,X do
- io.write("_")
- end
- if (#Buffer > 0) then
- for i=1,#Buffer do
- print(Buffer[i].name)
- end
- end
- end
- main(true)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement