Originally Posted By: EasyObserver
Hi and thanks very much lire, much appreciated. Could you tell me please what the significance of the ! symbol is in the first line? I had tried using elseif but I guess I got that all screwed up because I couldn't get it to work. What is the difference between else and elseif? Also...if the script were to be run in all channels I have ops in, I realize I would just not add a channel name, however, would I still use just the # symbol in the script or $chan, or do they both basically represent the same thing? This script will be used for several bans (condensing several small ban scripts) so each ban would be in () and seperated by || . Is there a limit to how many bans a script like this can handle comfortably? Thanks again for your fix, I appreciate it. I hope I'm not asking too many questions, but like I said in my original message, I'm trying to learn.

the ! symbol indicates opposite, or other. in this case, the first event parameter is for the nickname. * means any username, @ means OP, and ! means the opposite. !@* means any username that is not op.
note: usually you are never op when you join a channel, X (or the network bot) ops a privileged user when they join. but whatever floats your boat

elseif is just like an if statement, you need something to check for it to be an elseif. an else is for doing (code) if nothing else in the bracket is triggered. ex.
Code:
if ($read(me.txt,2name)) { halt }
elseif ($read(me.txt,name2)) { stuff | halt } 
else { stuff1 }
if this finds 2name in me.txt, it does the first if statement and does not proceed with the elseif and else statements. if it finds name2 in the file but not 2name, it does the elseif statement and ignores the else statement. if both return false/not triggered, it does the else statement.

You can add pretty much as many banned addresses to if statements since mIRC only uses about 20 MB of ram (based off my task manager window with 20 channels open, 7 active channels handling a whole bunch of messaged and joins/parts.) so adding more statements shouldn't be a problem. I do see an easier way, though, instead of going through copying and pasting the if statement with different hosts. Try having a text file, let's say bannedhosts.txt. You would have your if statement structured like
Code:
  if ($address iswm $read(bannedhosts.txt)) {
(iswm could be substituted with isin) and your file would look like
Code:
address1
address2
address3
etc. If you don't want to have to edit the file, you could just /write bannedhosts.txt (newaddress) so it automatically keeps the format for you.

please tell me if i'm wrong on any of this. i'm a bit rusty

Last edited by judge2020; 29/12/14 03:16 AM. Reason: edited, you're not going crazy seeing this change