Quote:
Is it always faster to call an alias in a remote?


Imho, it depends greatly on how the alias being called is coded. And also on why it has to be called.
There are many cases where aliases are not needed even though the programmer wants to neaten the code.
As a matter of fact, it is generally recommended to use a subalias whenever some statements in the source
repeat themselves.This will then save space and therefore, the interpreter's parser would be quicker (only if
things are well written though :p ).

Code:
2.And then, would you rather call in an alias, or use signals?


The advantage of the "on signal" event is stated in the help file itself.

Originally Posted By: from the help file
Signals are a simple way of triggering signal
events in multiple scripts at the same time.


Whereas, simple aliases can't be called in multiple scripts at the same time.

Furthermore,

Originally Posted By: from the help file
By default the signal is triggered after all current
scripts have finished executing. You can however use -n to make the script trigger immediately.


This statement clearly shows that in some particular cases, signal events are better
to use than any other method.

For example, in a protection script, you could just use a signal with the -n switch.
This will make your protection script react before all other scripts.

Quote:
3.Also, for a flood script, which is faster.

On text or on ^:Text?

I noticed when there's flooding, my mIRC temporarily freezes and the Ctrl Breaks return my 2 major text events, 1's on text and the other is on ^ text.

My current flood-kicking script is on text, but I read a flood script which uses ^. It basically increases a variable for $nick.$chan.etc and ban kicks if the variable researches a number.

And then there really isn't much of a way to combine the 2, right?


If your mIRC freezes when there is flooding, it may be normal. Normal, because it was a massive flood where
all the better and fastest protection scripts would freeze. Not normal, because the protection script was
badly written.

The basic usage of the ^ prefix is to halt mIRC's default displayed texts for particular events.
It may gain some milliseconds if correctly used but it won't be significant enough during massive floods.
The protection script you read (the one using ^) may only be better as it may have been written better.
Prefer hash tables for protection scripts. They are basically quicker. But I think I've read something on
variable being faster than hash tables in some cases.
Once more, the way some function reacts (rapidity, reliability) stand only on the way it was written.

4.Which is faster.

Quote:

if (a) && (b) {
do this
}
if (c) && (d) {
do that
}

Basically for any event all if statements have to be called.


If you don't want all the 'Ifs' to be executed, then use 'ElseIf'.

Quote:
The above should be faster than..

if (a) && (b) && (!c) && (!d) {

I'm guessing there's a cutoff point, because you could go all the way to... if (y) && (z), right?


It won't be faster because you use && everywhere. This means that for the "if" to be validated, it has
to go through all the conditions. It won't be validated only and only if some conditions are false. The
first false condition in a "if" statement containing only '&&s' is the cutoff point.

5.

I've found only this solution (for now) to reverse all the modes put on a channel.
Basically, the function 'RevMode' parses the <string> $1- for each character looking
for a '-' or a '+' and then replaces the latters accordingly until the end of the
<string>.

Code:
on *:mode:#:{ MODE $chan $RevMode($1-) }

Alias RevMode {
  Var %m = $1- , %i = 1 , %k , %z
  While $mid(%m,%i,1) {
    Var %k = $v1
    Var %z = %z $+ $iif((%k == -),+,$iif((%k == +),-,%k))
    Inc %i
  }
  Return %z
}


If ever I find a way ( or maybe someone else will find it), then there'll surely be a
new post following this one. wink

Cordialement


tropnul