Your variables are not inside the loop so they are not being updated. Move them inside the while true do loop and increase the wait time (you do not want to ping the server every 100ms)