Author Topic: Mirc functions...  (Read 333 times)

morbid

  • Trial Moderator
  • Junior
  • ***
  • Posts: 61
  • Reputation +0/-0
  • I own you
  • Location: I'm probably standing right behind you.
    • View Profile
Re: Mirc functions...
« on: February 16, 2011, 02:42:14 pm »
(To script, press alt+r and click the remote tab. All code goes in there)
In mIRC, functions are called aliases.

Their setup is simple, it goes like this:

CODE
alias <aliasname> {
parameters
}
------------------------

Here is an example of an alias that displays Hello mIRC in the window you type it in.
Code: [Select]
alias helloworld {
echo -a Hello mIRC!
}
To activate that script, simply type /helloworld in any window
------------------------

So now I will show you how to create a more flexible function.
Using $1, $2, $3 and so on, you can enter your own data.

Code: [Select]
CODE
alias adder {
return $calc($1 + $2)
}
What this does is just uses the premade mIRC function, $calc, to add the first and second number typed($1 and $2)
You would use this code by typing //echo $adder(10,30)
This would echo the number 40. 10 is $1 and 30 is $2.

This should give you the basic idea on aliases.

« Last Edit: February 16, 2011, 05:20:32 pm by morbid »