|
Joined: Jun 2003
Posts: 92
Babel fish
|
OP
Babel fish
Joined: Jun 2003
Posts: 92 |
can sum1 tell me wut the command for deleting $nick from %variable? or how to add nicknames to a variable where i can type /msg %variable and it message all the nicks in variable?
thanx in advance
k1ll3rz
|
|
|
|
Joined: Mar 2005
Posts: 420
Fjord artisan
|
Fjord artisan
Joined: Mar 2005
Posts: 420 |
Here's a custom alias to add/delete nicks in the variable alias _set {
if ( $1 == -a ) set %nickss $addtok(%nickss,$1,44)
elseif ( $1 == -d ) set %nicks $remtok(%nickss,$1,1,44)
}
type: '/set -a <nick>' to add or '/set -d <nick>' to delete. Then to send the message to the nicks in the variable, type: '//msg %nickss <message>' For more info about $deltok & $addtok, /help $remtok /help $addtok
If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
|
|
|
|
Joined: Aug 2005
Posts: 525
Fjord artisan
|
Fjord artisan
Joined: Aug 2005
Posts: 525 |
Assuming the following:
%variable = nick1 nick2 nick3
To delete a nick from this list %variable = $remove(%variable, nick2)
You can also specify multiple nicks %variable = $remove(%variable, nick2, nick3, nickN)
To add a nick %variable = %variable nick4
Again, you can specify more than one nick %variable = %variable nick4 nick5 nickN
N being any number.
If you're doing this via some sort of command, then swap nickN for $1 $2 or whatever the nick token is in.
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
You don't want to be using $remove. Imagine you have this list:
%nicks Theone,one,Alone
Say you want to remove the second nick (one), you are suggesting to use $remove(%nicks,one), and guess what that will leave you with?
Exactly, all nicks in this list are compromised, as the string "one" is removed from all nicks. Even your own example will backfire at you, once you have a nick like nick14, and you want to remove nick1, then all nicknames that are nick1* will be compromised, such as nick11, nick12, nick13...
A token based solution ($deltok or $remtok etc) is better suited for this.
Gone.
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
DONT USE schaefer31 example (sorry dude) as $remove is real bad for cutting parts of nicks out ie "bobby bobbo bob" remove bob gets ya "by bo" OOOPS!
xDaeMoN was real close except he told u to use /set when he ment /_set and his allias has a typo in it where it says %nicks and not %nickss
For a start you want %variable formated using commas to sepearte the nicks, this is becuase usingt commas in /MSG nick1,nick2,nick3 blah well message all of them the message (on most irc servers)
So to add a nick, which lets say is in %nick (u might be using $nick it makes no difference where it comes from) %variable = $addtok(%variable,%nick,44) the 44 is the asc for the comma which lets $addtok know how to see one nick from the next, also $addtok wont add the nick twice
To delete a nick %variable = $addtok(%variable,%nick,1,44) the 1 means the first occurance of %nick, which there should be only one anyway, but its needed, 44 was as before
and to message everyone msg %variable message here
--edit-- someone already answered this, thats what i get for stopping to eat my lunch in the middel of it
Last edited by DaveC; 30/03/06 12:52 AM.
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
To delete a nick %variable = $addtok(%variable,%nick,1,44) the 1 means the first occurance of %nick, which there should be only one anyway, but its needed, 44 was as before I think you meant $deltok rather than $addtok in this section.
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
To delete a nick %variable = $addtok(%variable,%nick,1,44) the 1 means the first occurance of %nick, which there should be only one anyway, but its needed, 44 was as before correction to above (thanks Russel) I was to late to edit To delete a nick %variable = $deltok(%variable,%nick,1,44)the 1 means the first occurance of %nick, which there should be only one anyway, but its needed, 44 was as before * i copied and pasted from the line above then adjusted the parameters and forgot to fix the identifier * at least i didnt miss-spell it this time
Last edited by DaveC; 30/03/06 04:39 AM.
|
|
|
|
Joined: Mar 2005
Posts: 420
Fjord artisan
|
Fjord artisan
Joined: Mar 2005
Posts: 420 |
xDaeMoN was real close except he told u to use /set when he ment /_set and his allias has a typo in it where it says %nicks and not %nickss My bad. Thanks for catching that Dave, was in a hurry.
If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
|
|
|
|
Joined: Jan 2003
Posts: 2,523
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 2,523 |
I think you meant $remtok() rather than $deltok() :tongue:
/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
aaaggghhhhh spewwing I did as well, then just followed along when Russel tricked me by saying deltok.
/me lights fire under russel, u evil evil evil guy!
|
|
|
|
|