mIRC Home    About    Download    Register    News    Help

Print Thread
#86597 12/06/04 01:22 PM
Joined: Mar 2004
Posts: 359
L
Fjord artisan
OP Offline
Fjord artisan
L
Joined: Mar 2004
Posts: 359
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.

#86598 12/06/04 02:26 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
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.


"All we are saying is give peace a chance" -- John Lennon
#86599 12/06/04 02:28 PM
Joined: Mar 2004
Posts: 359
L
Fjord artisan
OP Offline
Fjord artisan
L
Joined: Mar 2004
Posts: 359
Havent tested it yet, but i'll try it and as far as youve described it, its what im lookin for

Thanks smile

#86600 12/06/04 02:37 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
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


"All we are saying is give peace a chance" -- John Lennon
#86601 12/06/04 02:39 PM
Joined: May 2004
Posts: 24
K
Ameglian cow
Offline
Ameglian cow
K
Joined: May 2004
Posts: 24
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:

Last edited by kocam; 12/06/04 02:41 PM.
#86602 12/06/04 02:51 PM
Joined: Mar 2004
Posts: 359
L
Fjord artisan
OP Offline
Fjord artisan
L
Joined: Mar 2004
Posts: 359
-
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

#86603 12/06/04 02:57 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
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.


"All we are saying is give peace a chance" -- John Lennon
#86604 12/06/04 10:43 PM
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
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

#86605 12/06/04 11:01 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
That is very true, thanks smile


"All we are saying is give peace a chance" -- John Lennon

Link Copied to Clipboard