mIRC Home    About    Download    Register    News    Help

Print Thread
#191930 18/12/07 09:33 AM
Joined: Oct 2007
Posts: 36
A
asmodeo Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Oct 2007
Posts: 36
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


·´¯`·.¸¸“Jã¢k øf ãll ‡rãÐ꧅„…Mã§têR øf Nønꔸ¸.·´¯`·
asmodeo #191931 18/12/07 09:46 AM
Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
I don't think any of them are faster then the other.. $chan return the channel, # return the same thing.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
sparta #191933 18/12/07 10:31 AM
Joined: Oct 2007
Posts: 36
A
asmodeo Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Oct 2007
Posts: 36
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


·´¯`·.¸¸“Jã¢k øf ãll ‡rãÐ꧅„…Mã§têR øf Nønꔸ¸.·´¯`·
asmodeo #191937 18/12/07 11:14 AM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.

Last edited by Riamus2; 18/12/07 11:15 AM.

Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard