mIRC Homepage
Posted By: asmodeo Is good? - 18/12/07 09:33 AM
hi for all!
In one remote is better to use $chan or # ? for example:

on 20:JOIN:#:{ msg ($chan or #) Hello! } }

Which of these code is most faster?

thx smile
Posted By: sparta Re: Is good? - 18/12/07 09:46 AM
I don't think any of them are faster then the other.. $chan return the channel, # return the same thing.
Posted By: asmodeo Re: Is good? - 18/12/07 10:31 AM
thanks sparta smile

other question:
Code1:

On *:JOIN:#mychan:{
if ($nick !isop # && $nick ishop #) { cs op # $nick } }

Code2:
On *:JOIN:#mychan:{
if (($nick !isop #) && ($nick ishop #)) { cs op #$nick } }

what is the difference between Code1 and code2?

and in the same dude, between Code 3 and Code4
Code3:

on *:join:#mychan:{
if (($nick !isop # && $nick ishop #) || ($nick isnotify)) { cs op # $nick } }

Code4:

on *:join:#mychan:{
if ((($nick !isop #) && ($nick ishop #)) || ($nick isnotify))) { cs op # $nick } }

What is the best way to optimize my scripts? thisĀ“s the real my question
Posted By: Riamus2 Re: Is good? - 18/12/07 11:14 AM
The use of parentheses is up to you. As long as you use the minimum number and you use them in the correct place(s), you're fine. Some people prefer extra parentheses. Some prefer not as many. Personally, I prefer Code 1 over Code 2, and Code 3 over Code 4. But again, that's just a preference. I find it easier to read.

For speed checks, I've typed up how to do that multiple times in the forum and I'd suggest searching for posts by me that include the work "speed". Then you can see how to test any 2+ items for speed differences yourself.

EDIT: Btw, I prefer $chan over # as well... I think it's easier to see what you're referring to as # may not always be a channel depending where it is used.
© mIRC Discussion Forums