rebel9 commented on a Page, Mirc bot  -  Jan 29, 2014


flazzid  -  Jan 29, 2014

ok what i am doing is making a chat bot that has a bunch of preloaded insults and i want uses on twitch to be able to type !insult23 (username) and it display the msg like today was a good day for (username), his mouth didnt override his rectum also after looking at the code where would %insult be set

anthonydfurr  -  Feb 18, 2014

Create a txt file or ini file and read from it. I am seeing way too many snippets with no opening and closing brackets (WILL CAUSE PROBLEMS).

on :TEXT:!insult :#: {
msg $active $read(*.txt)

~Where *.txt is the name of the file. (If file is stored somewhere else other than your mIRC directory, add the directory location in front of the name.

rebel9  -  Feb 20, 2014

Why create a txt when you can just put it in the code right there, it's not that big of a code snippet and if he wants to add more, its very easy to do so in scripts editor. That script does NOT cause problems and I've written a couple of scripts without brackets like that before, it works fine. There are no missing brackets, check mSLdev. I know exactly where you are talking about, right after the if statements. I have 3 different snippets running and have been for years just like that, and I've never had issues. Had that same folder copied onto several different boxes, has worked on every single one of them with several different versions of mIRC.

anthonydfurr  -  Feb 20, 2014

The reason to use a text file: You use 3 maybe 4 lines to write a loop to populate all insults instead of N plus lines to do the same thing. It is more efficient through a text file (less code to read through, less processes/memory/cpu usage, etc). Also, doing it the way you are doing it will cause the script to exponentially grow when added to. Doing it my way, the size of the script doesn't change.

Also, I didn't say the script causes problems. I said WILL cause problems. I was not talking specifically about your snippet, but just in general. I like using brackets (easier to read, easier to troubleshoot, more efficient, and common programming practice).

I was attempting to rub my programming practices on you, just trying to shed some light on issues I had with the script.

Have a great day :)

anthonydfurr  -  Feb 20, 2014

on 1:TEXT:!insult:*: {
msg $chan $read(insults.txt)

Text file saved in mIRC directory (insults.txt):
You're gay
You're dads gay.
You're brothers gay
You have 2 gay dads.
You're brother has a new boyfriend
You're dad has a diff love affair with another man, cheating on the one hes currently dating.
!@#$ loves this family.
This family loves !@#$
How much !@#$ does it take to satisfy this family?

That is all of the code :) Add 20,000 more insults and the code doesn't change. How is your way more efficient? I would understand if you have other conditional formatting going on, but even then you could accomplish same results with my code, just minor tweaks.

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.