iteration
This commit is contained in:
		
							
								
								
									
										20
									
								
								dig.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								dig.lua
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,20 @@
 | 
				
			|||||||
 | 
					local args = { ... }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rednet.open(modem_location)
 | 
				
			||||||
 | 
					receiverID = rednet.lookup("lns", lns_server)
 | 
				
			||||||
 | 
					current_time = os.time()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					data = {
 | 
				
			||||||
 | 
					    ["action"] = "lookup",
 | 
				
			||||||
 | 
					    ["hostname"] = args[1]
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rednet.send(receiverID, data)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					while true do
 | 
				
			||||||
 | 
					    id, msg = rednet.receive()
 | 
				
			||||||
 | 
					    if id == receiverID then
 | 
				
			||||||
 | 
					        io.write(msg .. "\n")
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
		Reference in New Issue
	
	Block a user