I am trying to create an IRC Bot on twitch using Lua. Yes, I am also trying to embed twitch whisper support with it, which is why I need to make two sockets, and have them both be monitored for commands. Only issue is, I'm not getting or finding any luck with this. I bet once someone here know's how to do this type of Lua, I would feel ashamed.
Should I make both receiving sockets in one while true do? I'm aiming for high performance, even though I could dedicate one CPU core for this, however, efficiency is great.
Since the code is very long, I (obviously) removed all oauth keys for twitch irc and uploaded to pastebin. http://pastebin.com/1VSenkK7
If you don't want to open pastebin, the code is similar to below.
copas.addthread(function()
while true do
local gchat,status = copas.receive(globaltcp,6)
if gchat=="?" then
copas.send(globaltcp,"?")
print("hi")
end
end
end)
copas.addthread(function()
while true do
local wchat,status = copas.receive(whispertcp,6)
if wchat=="?" then
copas.send(whispertcp,"?")
print("test")
end
end
end)
copas.loop()
I want to be able to have printing ability also. Hopefully this may be solved, but if you do. I'm not kidding, KUDOS to you. EDIT: Corrupted pastebin link.

2 comments
This is for ROBLOX only
Yeah... Scripting Helpers is very specifically for RBX.Lua only. I took a look at your code to try and help, but I don't know those APIs at all.