mIRC Home    About    Download    Register    News    Help

Print Thread
$deltok #145929 29/03/06 06:39 AM
Joined: Jun 2003
Posts: 92
K
k1ll3rz Offline OP
Babel fish
OP Offline
Babel fish
K
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
Re: $deltok #145930 29/03/06 07:35 AM
Joined: Mar 2005
Posts: 420
X
xDaeMoN Offline
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
Here's a custom alias to add/delete nicks in the variable

Code:
 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!
Re: $deltok #145931 29/03/06 07:35 AM
Joined: Aug 2005
Posts: 525
S
schaefer31 Offline
Fjord artisan
Offline
Fjord artisan
S
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.

Re: $deltok #145932 30/03/06 12:18 AM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
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.
Re: $deltok #145933 30/03/06 12:50 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
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.
Re: $deltok #145934 30/03/06 01:12 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Quote:
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.

Re: $deltok #145935 30/03/06 04:38 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
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 frown

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 frown
* at least i didnt miss-spell it this time

Last edited by DaveC; 30/03/06 04:39 AM.
Re: $deltok #145936 30/03/06 06:31 AM
Joined: Mar 2005
Posts: 420
X
xDaeMoN Offline
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
Quote:
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!
Re: $deltok #145937 31/03/06 11:16 AM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
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
Re: $deltok #145938 31/03/06 04:45 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
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!