Advertisement
Lanzr

play

Oct 23rd, 2022 (edited)
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. local times = 0
  2. local timelimit = 2
  3. rednet.open("back")
  4.  
  5. local function resetTerm()
  6. term.clear()
  7. term.setCursorPos(1,1)
  8. end
  9.  
  10.  
  11. local termX,termY = term.getSize()
  12. local winTopBar = window.create(term.current(),1,1,termX,1)
  13. local winMain = window.create(term.current(),1,2,termX,termY)
  14. local turhost
  15. local proc
  16. local retryTimes = 10
  17. if(arg[1] == nil) then
  18. print("pls input url")
  19. return
  20. end
  21. resetTerm()
  22. proc = "procDance"
  23. resetTerm()
  24.  
  25. local function init()
  26. while 1 do
  27. turhost = rednet.lookup(proc)
  28. if (turhost ~= nil) then
  29. times = times + 1
  30. print("target find! num: ",times)
  31. rednet.send(turhost,"start")
  32. os.sleep(3)
  33. if(times >= timelimit) then
  34. break
  35. end
  36. end
  37. os.sleep(1)
  38. end
  39. return false
  40. end
  41. local function playm()
  42. shell.run("loop_player.lua",arg[1])
  43. end
  44.  
  45. init()
  46. playm()
  47. -- if(init()) then
  48. -- return
  49. -- end
  50.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement