iteration
This commit is contained in:
		
							
								
								
									
										8
									
								
								dig.lua
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								dig.lua
									
									
									
									
									
								
							@ -18,6 +18,12 @@ rednet.send(receiverID, data)
 | 
				
			|||||||
while true do
 | 
					while true do
 | 
				
			||||||
    id, msg = rednet.receive()
 | 
					    id, msg = rednet.receive()
 | 
				
			||||||
    if id == receiverID then
 | 
					    if id == receiverID then
 | 
				
			||||||
        io.write(msg .. "\n")
 | 
					        if msg == nil then
 | 
				
			||||||
 | 
					            print("Hostname not found!")
 | 
				
			||||||
 | 
					            break
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            io.write(msg .. "\n")
 | 
				
			||||||
 | 
					            break
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
@ -48,7 +48,7 @@ while true do
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        -- check if hostname in data
 | 
					        -- check if hostname in data
 | 
				
			||||||
        if request.hostname == nil then
 | 
					        if request.hostname == nil then
 | 
				
			||||||
            rednet.send(client_id, "not found")
 | 
					            rednet.send(client_id, nil)
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
            rednet.send(client_id, data[request.hostname])
 | 
					            rednet.send(client_id, data[request.hostname])
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user