teeworlds_network/examples/03_send_chat.rb

14 lines
311 B
Ruby
Raw Normal View History

2022-11-04 15:57:50 +00:00
# Chat spamming client
require_relative 'lib/teeworlds-client'
client = TeeworldsClient.new(verbose: true)
# connect to localhost and detach a background thread
client.connect('localhost', 8303, detach: true)
loop do
# send a chat message every 5 seconds
sleep 5
client.send_chat('hello friends!')
end