botsirctwitchmirc

I'm trying to implement a quote system in mIRC for my Twitch bot, reading from the text file works, but adding doesn't


I'm trying to build my own Twitch bot using mIRC and I've ran into a problem. I've been using simple commands to show TEXT when typing TEXT in the channel.

When I got the basics I went further and I'm trying to implement a quote system now, it worked before, but seems to stop writing quotes to the .text file on my pc since yesterday. The !quote command works if I add text to the text file manually, but it won't write them into the file with !addquote. The rest of the code doesn't interact with this and I've tried running separate pieces of code, with no succes.

I'm not sure if the problem is code related, since it worked before, but I can't seem to resolve/see the problem myself.

I was hoping someone here might see the problem.

Thanks in regard.

on *:TEXT:!addquote *:#: {
if ($nick !isop #) { return }
write quotes.txt $2- $+
msg $chan Added: $2-
}

on *:TEXT:!quote:#: {
if ((%floodquote) || ($($+(%,floodquote.,$nick),2))) { return }
set -u10 %floodquote On
set -u30 %floodquote. $+ $nick On
msg $chan $read(quotes.txt)
}

Solution

  • I fixed it by putting it in a new file. No idea why it worked but it did somehow.