Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local times = 0
- local timelimit = 2
- rednet.open("back")
- local function resetTerm()
- term.clear()
- term.setCursorPos(1,1)
- end
- local termX,termY = term.getSize()
- local winTopBar = window.create(term.current(),1,1,termX,1)
- local winMain = window.create(term.current(),1,2,termX,termY)
- local turhost
- local proc
- local retryTimes = 10
- if(arg[1] == nil) then
- print("pls input url")
- return
- end
- resetTerm()
- proc = "procDance"
- resetTerm()
- local function init()
- while 1 do
- turhost = rednet.lookup(proc)
- if (turhost ~= nil) then
- times = times + 1
- print("target find! num: ",times)
- rednet.send(turhost,"start")
- os.sleep(3)
- if(times >= timelimit) then
- break
- end
- end
- os.sleep(1)
- end
- return false
- end
- local function playm()
- shell.run("loop_player.lua",arg[1])
- end
- init()
- playm()
- -- if(init()) then
- -- return
- -- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement