Advertisement
RobotBubble

Jammer

Dec 5th, 2017
103
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- jammer
  2.  
  3. term.clear()
  4. term.setCursorPos(1,1)
  5.  
  6. sides = {'front','back','left','right','top','bottom'}
  7.  
  8. function enter(p)
  9. oldx, oldy = p.getCursorPos()
  10. p.setCursorPos(1,(oldy+1))
  11. end
  12.  
  13. function signalJam(m,p)
  14. for i=1,42500 do
  15. p.clearLine()
  16. _,poldy = p.getCursorPos()
  17. p.setCursorPos(1,(poldy))
  18. p.write("Channel "..tostring(i))
  19. m.transmit(i,i,"-Static-")
  20. end
  21. end
  22.  
  23. for i=1,#sides do
  24. if (peripheral.getType(sides[i]) == "modem" and peripheral.call(sides[i], 'isWireless')) then
  25. modem = peripheral.wrap(sides[i])
  26. break
  27. end
  28. end
  29.  
  30.  
  31. if (modem) then
  32. term.write("Jamming open channels...")
  33. enter(term)
  34. while true do
  35. signalJam(modem,term)
  36. sleep(0.5)
  37. end
  38. else
  39. term.write("No wireless modem found... Exiting.")
  40. end
Advertisement
RAW Paste Data Copied
Advertisement