2022-11-05 10:07:16 +00:00
|
|
|
#!/usr/bin/env ruby
|
2022-11-05 16:27:54 +00:00
|
|
|
# frozen_string_literal: true
|
2022-11-05 10:07:16 +00:00
|
|
|
|
2022-11-04 15:57:50 +00:00
|
|
|
# Chat spamming client
|
|
|
|
|
2022-11-09 07:40:17 +00:00
|
|
|
require_relative '../lib/teeworlds_client'
|
2022-11-04 15:57:50 +00:00
|
|
|
|
|
|
|
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!')
|
2022-11-05 10:07:16 +00:00
|
|
|
end
|