krom

BatteryGuy

Feb 16th, 2013
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.80 KB | None | 0 0
  1. local nSlaveID = 28
  2. local nTimeout = 30
  3. local bCool = true
  4.  
  5.  
  6. local function slowmo(str)
  7.     local x, y = term.getCursorPos()
  8.     local l = string.len(str)
  9.     if l == 0 then
  10.         return
  11.     end
  12.    
  13.     for i=1,l do
  14.         term.setCursorPos(x,y)
  15.         term.write(string.sub(str,i,1))
  16.         sleep(0.05)
  17.         x = x+1    
  18.     end
  19. end
  20.  
  21. yourmonitor = peripheral.wrap("right")
  22. term.redirect(yourmonitor)
  23.  
  24. term.clear()
  25. term.setCursorPos(1,1)
  26.  
  27. print("**************")
  28. print("* Welcome    *")
  29. print("**************")
  30. print("")
  31. print("Enabling network, connecting to BatteryGuy")
  32. rednet.open("top")
  33. print("Network enabled. Receiving...")
  34.  
  35. while bCool  == true do
  36.     local id,msg,foo = rednet.receive(nTimeout)
  37.  
  38.     if id == nil then
  39.         print("Timeout")
  40.         bCool = false
  41.     else
  42.         print(msg)
  43.     end
  44.  
  45.     sleep(0.1)
  46. end
Advertisement
Add Comment
Please, Sign In to add comment