rebel9 commented on a Page, Mirc twitch.tv bot  -  Jan 29, 2014
on *:TEXT:!insult *:#: {
  set -u3 %insult $rand(1,10)
  if (%insult == 1) msg $chan You're gay
  if (%insult == 2) msg $chan You're dads gay.
  if (%insult == 3) msg $chan You're brothers gay
  if (%insult == 4) msg $chan You have 2 gay dads.
  if (%insult == 5) msg $chan You're brother has a new boyfriend
  if (%insult == 6) msg $chan You're dad has a diff love affair with another man, cheating on the one hes currently dating.
  if (%insult == 7) msg $chan Dick loves this family.
  if (%insult == 8) msg $chan This family loves dick
  if (%insult == 9) msg $chan How much dick does it take to satisfy this family?
  if (%insult == 10) msg $chan HUGGEEEEEEE faggot.
}

Just keep adding those if statements with the next following number, and change the last parameter to however many insults you have. I can optimize this however you want, I just don't have a grasp on exactly what it is you're trying to do. Let me know if there is anything here you'd like me to change, wont take but a few seconds.

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?
HUGGEEEEEEE faggot.

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.