mIRC Home    About    Download    Register    News    Help

Print Thread
#203357 12/08/08 07:25 PM
Joined: Oct 2007
Posts: 214
B
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Oct 2007
Posts: 214
Hello

I just wanted to find out and know from the scripters out there if there is a more faster, efficient way of shortening a few commands yet achieving the same result.

Heres the existing code:

Code:
alias unlock_all {

prop # unlock Topic
prop # unlock Onjoin
prop # unlock Pass
prop # unlock Category
prop # unlock Pics
prop # unlock Ownerkey
prop # unlock Hostkey
prop # unlock Memberkey

}


Any feedback or comments is great appreciated.

Thanks in advance

- J

Last edited by Buggs2008; 12/08/08 07:25 PM.
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
First of all, shortening something doesn't necessarily make it faster.

Your code could be shortened a bit this way:
Code:
alias unlock_all {
  tokenize 32 Topic Onjoin Pass Category Pics Ownerkey Hostkey Memberkey
  prop # unlock $*
}
but I very much doubt it's faster.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Jan 2004
Posts: 1,359
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,359
Is $* in the help? I can't find anything about it.

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
It's not, but it re-executes the command with each individual token in $1-:

/tokenize 32 a b c
/echo -a $*

echo's:
a
b
c

It's a cheap way to loop a single command over a list of tokens


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"

Link Copied to Clipboard