mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2006
Posts: 27
Z
Zaephyr Offline OP
Ameglian cow
OP Offline
Ameglian cow
Z
Joined: Aug 2006
Posts: 27
How can I have my bot select a random name from the channel list? For use in this line of text.

Nisstyre walks slowly up to [randomnick] and asks would you care for something to drink?

and if the person says "Yes and the name of a drink"

then the bot would act:

Nisstyre goes to the bar and pours a [whatever drink was said]

Joined: Feb 2005
Posts: 342
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
It would be nice if you actually started looking stuff up, so far, on this page, I see four posts by you, all asking how to do something with your bot. Why don't you try using /help a bit? It's a good place to start to learn mIRC scripting. We certainly don't want to write every script for you.

With that said, you would want to use:

Code:
alias randomnick {
  var %chan = $1
  var %rand = $rand(1,$nick(%chan,0))
  var %nick = $nick(%chan,%rand)
  return %nick
}


You can use: $randomnick(#channel) to return a random nick from the specified channel. I used a lot of "vars" so you could see how these identifiers work.

If you don't understand part of an identifier, use /help to read more about it.

Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
$nick($chan,$calc($rand(1,999) % $nick($chan,0) + 1)) does the same thing. wink

Also, no need to be derogatory towards them. They are trying to learn as you once started to.


-KingTomato
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Code:
alias rnick return $nick($1,$rand(1,$nick($1,0)))


$rnick(#channel)


Link Copied to Clipboard