You can create aliases in mIRC easy, which can help making your script more functional, and you can access commands quicker, becuase you dont have to use the mouse and go through menu's, like you would have to with popups. To create aliases it's important that you know mIRC/IRC commands.
A alias gets called from the commandline (the place where you type your text), or from Remote, or Popups. Aliases get's executed by using executor command, which is "/" in mIRC by default, I doubt many people use something else.
For your alias scripting goto to the alias section (press ALT-A).
Starting out with a simple alias, could be like this:
/nt /mode # +nt
This would put the channel modes +nt on the currently active channel window, you call/execute the command by typing /nt. This might be usefull consider it's only 1 line.
You can add more lines as well, Each command needs to breaked with a return, Or a '|' to let me mIRC know, Here's a new command. I'm going to give you examples of both, right now.
setaway {
ame is gone
away I'm not here
}
This above example used return, This is probably what you should start out with, Since it's easy to have a overview off. You can make the script using '|' but in 1 line. It would look like this:
setaway { ame is gone | away I'm not here }
You can also access parameters from your command, Let's say we expand the little away script we made above, By using parameters to for example, Give a reason why we are away.
setaway {
ame is gone: $1-
away $1-
}
Using the command now /setaway would now put you away with a reason, I made a little quick script to give you a understanding in how parameters work.
parmtest {
echo -a Full Parameter: $1-
echo -a Single Parameter.. You typed $1 And $2 And Um.. $3
echo -a Word1 & Word2.. $1-2
}
Now by executing the command /parmtest foo bar rewl. That part shouldn't be hard to understand. Let's expand the away script a little more, By saying you want to change your nick. When you type /setaway .
setaway {
; We have to store the old nick, for use in the /back command
; The old nickname, will saved in %normalnick variable.
set %normalnick $me
; Now %reason will contain the away reason.
set %reason $2-
; The new nick is $1 .. so let's change it to that.
nick $1
; global action/describe, that we are gone, and earlier
; we saved the away reason in %reason
ame is gone: %reason
; The IRC command to put our self's away, so Other's know we
; are away
away %reason
}
Now let's add the back function, We are just going to call it via the command /back.
back {
; we had the old nickname in the %normalnick variable, let's change
; it, back then.
nick %normalnick
; let's notify in public that we are in fact back. and what
; we are back from
ame is back from %reason
; Let's clean this up, so it wont bother us for next time.
unset %normalnick %reason
; The IRC server still thinks we are away, so we just put our selfs
; back, by only typeing /away
away
}
Note: that when your making aliases in remote, popups, or in alias, you do NOT need '/'.
? Discuss This Article here.
|