mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2006
Posts: 16
S
Sturm Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Jul 2006
Posts: 16
what is the code for a random user? i know $nick is the last user to type, but how do i say a random user's nick with code?

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
here is an example for the
Code:
//var %allnicks = $nick(#,0) , %i = 1 | sline # $nick(#,$r(1,%allnicks))

Joined: Jul 2006
Posts: 16
S
Sturm Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Jul 2006
Posts: 16
so, where would i put that?

I don't need to change anything on there right?

And would %allnicks wherever i put it in the script be replaced by a random user?

Last edited by Sturm; 10/07/06 12:02 AM.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
You shouldn't need to change anything, presuming you want to use the sline with the random nick. %allnicks holds the total number of nicks currently in the channel.

Read /help Nick and Address Identifiers
then scroll down to the $nick(#,N/nick,aohvr,aohvr) entry

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
if you want to you can put it in popups.ini for the channel
[code]
-
Select Allnicks:var %allnicks = $nick(#,0) , %i = 1 | sline # $nick(#,$r(1,%allnicks))
-

or in aliases.ini
alllnicks var %allnicks = $nick(#,0) , %i = 1 | sline # $nick(#,$r(1,%allnicks))

or in remotes
alias alllnicks var %allnicks = $nick(#,0) , %i = 1 | sline # $nick(#,$r(1,%allnicks))

for either alias use /allnicks

for the popups just right click the channel and choose "Select allnicks" by clicking on it

Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
Code:
alias randuser return $nick($chan,$r(1,$nick($chan,0)))


Code goes in remotes (alt+r) and is used in a channel as $randuser.

Examples:
//msg $chan Hello, $randuser
//me slaps $randuser around a bit with a large trout

BTW, MikeChat you have an unused variable (%i) in your code and it could be shortened similar to mine, though I wasn't sure he wanted to select a nick (he said "say") so I offer another solution.

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
good points, I started out thinking of a loop and didnt clean it up very well.
and you are right that the OP said "say" rather than "select" , all I can say is "Oops"


Link Copied to Clipboard