mIRC Homepage
Posted By: LostServ Is there.. - 12/06/04 01:22 PM
Is there a way to "grab" a nickname from the current channel? for an example:

-Bot Loaded-
--Scanning Nicknames--
<Bot> Aha, I see you, George!


Just to clear something up, because I have a weird feeling if I don't say this then you'll think this is what I mean.. I don't want it to read nicknames from a list, but from the current channel so it could be possibly anybody in the channel.
Posted By: Zyzzyx26 Re: Is there.. - 12/06/04 02:26 PM
Code:
alias scan {
 var %i = $nick($1,0)
 while (%i) {
  var $+(%,nick,%i) = $nick($1,%i)
  dec %i
 }
 { other commands here }
}
I am not sure this is what you wanted, but i'll try it smile
This checks every nick in the channel and stores them in temp. variables.

Lest say John is the 5th nick in the nicklist, then John's nick would be stored in a temporary variable called %nick5
Later on the same script you can refer to John's nick as %nick5

The usage of the alias is /scan <#channel>

Hope this is what you wanted wink
Zyzzy.
Posted By: LostServ Re: Is there.. - 12/06/04 02:28 PM
Havent tested it yet, but i'll try it and as far as youve described it, its what im lookin for

Thanks smile
Posted By: Zyzzyx26 Re: Is there.. - 12/06/04 02:37 PM
Cool smile If you want to say 'Aha, I see you, <nick>" to any random nick from the channel, you could add this to the command parts:
Code:
msg $1 Aha, I see you, %nick $+ $rand(1,$nick($1,0))
And this would get a random nick and say that sentence.

Greetings,
Zyzzyx. smile
Posted By: kocam Re: Is there.. - 12/06/04 02:39 PM
Try this
Code:
alias checknick {
  ; here u set your friends' name separated by space.
  var %x George Mike Peter
  var %z = 1
  while ($nick($1,%z)) {
    var %c $ifmatch
    if ($istok(%x,%c,32)) {
      var %friends = $addtok(%friends,%c,32)
    }
    inc %z
  }
  if (%friends) {
    msg # Aha I see you, $replace(%friends,$chr(44),$chr(44) $+ $chr(32)) $+ !!!
  }
  else {
    msg # Uh, I cant see you. Where are u gone?
  }
}


usage: /checknick #channel

EDIT: sry Zyzzyx26, i saw your post too late :tongue:
Posted By: LostServ Re: Is there.. - 12/06/04 02:51 PM
-
OTHER Unknown command
-

thats what i get when i try Zyzzyx's and for the other one im not sure thats what im lookin for frown im on ver 6.15
Posted By: Zyzzyx26 Re: Is there.. - 12/06/04 02:57 PM
Code:
alias scan {
 var %i = $nick($1,0)
 while (%i) {
  var $+(%,nick,%i) = $nick($1,%i)
  dec %i
 }
 msg $1 Aha, I see you, %nick $+ $rand(1,$nick($1,0))
}
Try this one smile That 1st code i gave you was a general one. The Other commands here part was to you to change it to whatever you wanted to do.
This code here should do what you wish to smile

Zyzzy.
Posted By: Kelder Re: Is there.. - 12/06/04 10:43 PM
I think you forgot some parsing, unless you want to have the nick show as whatever happens to be in the global variable %nick appended with a random number smile
msg $1 Aha, I see you, %nick [ $+ [ $rand(1,$nick($1,0)) ] ]

There's other ways using $eval and $+(), this is my favorite though smile
Posted By: Zyzzyx26 Re: Is there.. - 12/06/04 11:01 PM
That is very true, thanks smile
© mIRC Discussion Forums