Basic IRC command help script

By H2O on Aug 31, 2011

I made a very basic but very user friendly help system. I made this with first time mIRC users in mind. Add this code to remotes not popups, you do need to swap all the #ChannelName s with a channel you want to use.

on *:TEXT:*!Help*:#ChannelName: /notice $nick Welcome $Nick ! This training guide is for training new channel owners and there operators. This will cover everything from registration of a nick to banning and everything in between. This guide is to be used with mIRC. Below will be a list of commands. For a first time user, I recommend using them in order. If you are just here for a refresher, please by all means use what you need! | /notice $nick !Register Nick | /notice $nick !Identify Nick | /notice $nick !join Channel | /notice $nick !Register Channel | /notice $nick !Cycle Channel | /notice $nick !Add AOP | /notice $nick !Channel Central | /notice $nick !Kick | /notice $nick !Ban | /notice $nick !Credits

on *:TEXT:*!Register Nick*:#ChannelName: /notice $nick First thing you want to do if you have not already is register your nick. /msg nickserv register [password] [email] is the command you need to use. To make sure you did it right, you should do a /whois nick on yourself. It should spit out Status: is a registered nick.
on *:TEXT:*!Identify Nick*:#ChannelName: /notice $nick Depending on if you have an auto identifier or not you do need to identify every time you log in using /msg NickServ IDENTIFY password Again use the /Whois nick command to make sure you are a registered nick
on *:TEXT:*!Join Channel*:#ChannelName: /notice $nick Next, if you don't have the channel made that you are going to be using, is making your channel. Use /join #channelname to make your channel
on *:TEXT:*!Register Channel*:#ChannelName: /notice $nick Next use   /msg chanserv register #channelname [password] [description] (without the []s of course) to register your channel. You MUST have a registered nick and be identified before you register your channel. Once that is done you should have a ~ by your name name showing you are the channel owner.
on *:TEXT:*!Cycle Channel*:#ChannelName: /notice $nick Now, every time you log in and you have identified you need to cycle the channel. To cycle a channel its /cycle #channelname. If they don't have an auto identifier they must do this every time after they identify.
on *:TEXT:*!Add Aop*:#ChannelName: /notice $nick For you as the owner to add other operators  to the channel there are 3 types. The only one we should worry about is AOP. To add a AOP use /msg chanserv AOP #CHANNELNAME Add NICK then it would be the same thing for them. You can only add registered nicks to AOP so identify and cycle do apply.
on *:TEXT:*!Channel Central*:#ChannelName: /notice $nick Now that your nick and the channel is all set up, lets get to the fun stuff. First lets open up Channel Central. Double click in the main chat area.  Up top you can change your topic. You maintain your ban list from here. You can set key (password) needed to get into your channel. 
on *:TEXT:*!Kick*:#ChannelName: /notice $nick How do you kick someone? Kicking someone is easy. And kicking someone is used as a warning. Use /k nick to kick. Pretty simple  huh? When someone is kicked they can recover from that fairly quickly. In fact people that know how have auto rejoin on kick. A kick is a warning.
on *:TEXT:*!Ban*:#ChannelName: /notice $nick To ban you would use /ban nick a ban is not lifted in till you lift it. Meaning they can not rejoin your channel. To lift a ban go back into your Channel Central and lift the ban. After you ban you should kick. Even with a ban, they are still in your channel, they they cant talk.
on *:TEXT:*!Credits*:#ChannelName: /notice $nick Credit goes to H2O from irc.majestic-irc.net for writing this basic IRC help script.

Comments

Sign in to comment.
Jethro   -  Sep 22, 2011

The else rings true in conjunction with the first if statement that's made. The elseif is an alternate condition that has nothing to do with the the first if condition. For instance,

inc %count
if (%count > 2) {
  this is your 3rd count
  unset %count
}
elseif (%count == 2) {
 this is your 2nd count
}
else {
 this is your first count!
}
 Respond  
Savage_CL   -  Sep 22, 2011

the difference between if and elseif is simple.
elseif only checks if the last check was false.
this means that when the first (else)if statement rings true
the rest won't, until it hits an if again.

 Respond  
Frenetic   -  Sep 03, 2011

Yeah Jethro_, it was only an example. Lol, I don't know, I've been told lots of things on how to speed it up, such as if you use "/msg" or "/halt" or "/if" and so, so..yea

 Respond  
Jethro   -  Sep 03, 2011

In actuality, it should've been:

if ($1-2 == !register nick) {

About the difference between using "if" and "elseif," I was told that elseif makes the speed comprison faster...but I could well be incorrect.

One thing to be aware is that if you use "if" all the way, and you are to make a conditonal comparison for different parts of statement to be executed, you'll have to be sure to put a halt or return, otherwise mirc will trigger all of them all once...

 Respond  
Frenetic   -  Sep 03, 2011

Also, the best way in my opinion to do this would be if statements... like this:
Code:

on :TEXT::#channel here:{
if ($1- == !register nick) notice $nick First thing you want to do if you have not already is register your nick. /msg nickserv register [password] [email] is the command you need to use. To make sure you did it right, you should do a /whois nick on yourself. It should spit out Status: is a registered nick.
elseif ($1- == !Identify Nick) ...

Why not,

on *:TEXT:*:#channel here:{
if ($1- == !register nick) notice $nick First thing you want to do if you have not already is register your nick. /msg nickserv register [password] [email] is the command you need to use. To make sure you did it right, you should do a /whois nick on yourself. It should spit out Status: is a registered nick.
if ($1- == !Identify Nick) ...

Instead of elseif?

 Respond  
PyThOn   -  Sep 03, 2011

 Respond  
Jethro   -  Sep 02, 2011

I knew jaytea was gonna say that lol 'cause this matter had been brought up before.

jaytea is really amazing with his constant reminders to keep script writers on the right track. He makes a perfect "personal trainer" in MSL.

 Respond  
jaytea   -  Sep 02, 2011

it is more efficient to use multiple events than one 'catch all' event with a bunch of checks.

 Respond  
Savage_CL   -  Sep 01, 2011

Also note that mSL is not a programming language, but a scripting language. The more events you put in a script, the more mIRC looks for with each line in each channel on each network you are connected to. This can, when you load it up too much, cause some problems with mIRC stalling or even crashing. Using one event would likely be the better option not just in terms of cleanliness but performance. Every little bit counts when you are working with a language so "slow"!

-Savage_CL

 Respond  
Jethro   -  Aug 31, 2011

Well, indeed I missed reading the part about popups in his description, as I was looking at the code itself. That's what received my attention at first glance. I've never liked to clog up the remote with a massive amount of messages. The remote winds up looking messy and long. The line break identifier can be used, but it's gonna be huge still. Last but not least, if a message gets long enough, it could get cut off.

P.S. I wasn't implying that this basic script uses message as massive as it looks, but over the long haul, you may find yourself adding more messages...and that can add up.

 Respond  
Ahmed Zaggoudi   -  Aug 31, 2011

It will be nice If you organize your database for example :

on *:TEXT:*!Register Nick*:#ChannelName: {
  /command1
  /command2
  /command2
... etc
}
 Respond  
Savage_CL   -  Aug 31, 2011

no need to be hostile. I learned the same lesson with the last snippet I posted. This is a community of scripters that help eachother and learn from eachother. We are simply giving other (some may say better) ways to do it. There are downfalls to each of them. Jethro_'s being that it requires an external file and mine being.... well I don't really know to be honest. Yours would be that it puts more stress on mIRC and it's extremely redundant. I'm not saying it's wrong, and I'm not saying I wouldn't have done the same thing in the past, but I've learned from my past code through this community and several irc channels and now I know easier/better ways to do things. I attempted to show you one of those. If you don't want feedback, don't post your code on Hawkee, because that's what this site is for.

 Respond  
H2O   -  Aug 31, 2011

Yes, i could have written this 15 different ways. But i chose this way for ease of access for me to expand on in the future. and i changed the des to say remotes.

 Respond  
Savage_CL   -  Aug 31, 2011

Jethro_ you missed to biggest mistake he made :P

This belongs in Remotes, not Popups.

Also, the best way in my opinion to do this would be if statements... like this:

on *:TEXT:*:#channel here:{
if ($1- == !register nick) notice $nick First thing you want to do if you have not already is register your nick. /msg nickserv register [password] [email] is the command you need to use. To make sure you did it right, you should do a /whois nick on yourself. It should spit out Status: is a registered nick.
elseif ($1- == !Identify Nick) ...

I'm not typing the whole thing out. you get my point. This allows you to more easily change the channel and reduces the load on mIRC.

Finally, with nickserv etc, you can use "/msg nickserv update" to update your modes. (even though you don't need to because channels can't turn off "automode" unless they just give you access lower than that level."

 Respond  
Jethro   -  Aug 31, 2011

It'd be best if you could make a text file and then play each line. You put all the notice messages the way they appear in it and then use:

on *:TEXT:!Help:#ChannelName: .ignore -cu3 $nick 2 | .play -cl1 irccmd.txt 
on *:TEXT:!Register Nick:#ChannelName: .ignore -cu3 $nick 2 | .play -cl2 irccmd.txt

etc....
The will play the first line for !help, second line for !register nick, and so on. The -c switch prompts it to see it as a command.

You don need * to enclose those triggers unless you want them to trigger anywhere in a sentence. The ignore command is to prevent the possibility of trigger flood.

 Respond  
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.