Originally Posted By: Yochai
* Don't use excessive Braces { } where you don't need them, and you only need them when there's more then one line in the command.

The { Brace means "Begin" and the } Brace means "End" so if there's only one line to the event or command, you don't need to give the script a beginning and end command.

For example:

ON *:text:*:*: { if ($nick = Blah) { do something here } }

Which the scrip reads like this: ON *:text:*:*: Begin-event if ($nick = Blah) Begin-if do something here End-if End-event

So as you see, you don't need to tell it where to begin and end if there's only one line.

So this would better:

ON *:text:*:*: if ($nick = Blah) do something here

Now besides the fact that it's useless to put excessive Braces, they all use more CPU.

That's because the { Begin Brace is actually a command that calls a procedure to check for the } End Brace (and run all the commands between of course).

It doesn't take a lot of CPU of course, but it's about the same amount as calling an alias (see "Saving CPU/memory usage").


Advance Scripting Tips by Yochai uploaded in mircscripts.org http://www.mircscripts.org/comments.php?cid=2778


irc.universochat.net
#escripting