mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 83
D
Babel fish
OP Offline
Babel fish
D
Joined: Dec 2002
Posts: 83
I would like to get ht mask of a bot which is not in any channel but is in IRC server (I can make a /who on it).

But when I make a $address(robot,6), I obtain a $null.

I don't understand why. Somebody can explain me ?

Joined: Feb 2005
Posts: 681
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Feb 2005
Posts: 681
That happens because the address doesn't remain in the IAL
unless they're on a common channel with you. From mirc.hlp..

The reason why only addresses for users on the same channels
as you are stored is because this guarantees the integrity of
the list. ie. that a specific nickname is associated with a
specific address.


Trying using the /userhost command and catch raw 302.

Code:
alias getaddress {
  set -eu10 $+(%,getaddress.,$1) $true
  userhost $1
}
raw 302:*: {
  var %nick = $remove($gettok($2,1,61),*),%address = $right($gettok($2,2,61),-1)
  if ($eval($+(%,getaddress.,%nick),2)) {
    [color:green]haltdef[/color]
    unset $+(%,getaddress.,%nick)
    [color:red]/yourcommand[/color] $+(%nick,!,%address)
  }
}


/getaddress nick

Joined: Dec 2002
Posts: 83
D
Babel fish
OP Offline
Babel fish
D
Joined: Dec 2002
Posts: 83
Thanks a lot mIRCmaniac for your code

Joined: Feb 2005
Posts: 681
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Feb 2005
Posts: 681
Hey check this out, using this /sleep alias by Online you
could make an identifier for this to return an address.

//echo -a $userhost(mIRCManiac)

Code:
alias userhost {
  if ($isid) {
    if ($address($1,5)) return $v1
    set -eu5 $+(%,userhost.,$1) $true
    userhost $1
    [color:green]sleep[/color] [color:red]500[/color]
    var %r = $eval($+(%,ruserhost.,$1),2)
    unset $+(%,ruserhost.,$1) $+(%,userhost.,$1)
    return %r
  }
  userhost $1
}
[color:green]alias sleep {
  var %a = $ticks $+ .wsf
  write %a <job id="js"><script language="jscript">WScript.Sleep( $+ $$1 $+ );</script></job>
  .comopen %a WScript.Shell
  if !$comerr { .comclose %a $com(%a,Run,3,bstr,%a,uint,0,bool,true) }
  .remove %a
}[/color]
raw 302:*: {
  var %address = $replace($remove($2,*,+),=,!),%nick = $gettok(%address,1,33)
  if ($eval($+(%,userhost.,%nick),2)) {
    set -eu5 $+(%,ruserhost.,%nick) %address
    haltdef
  }
}


You may need to raise this depending on the lag on
your network, I had it as low as 10ms and it worked.


I couldn't haltdef a null 302 from displaying, bug maybe?
-
userhost: no such user
-

Last edited by mIRCManiac; 14/04/06 04:49 PM.
Joined: Dec 2002
Posts: 83
D
Babel fish
OP Offline
Babel fish
D
Joined: Dec 2002
Posts: 83
The last line "userhost no such nick" is diplayed by mIRc when there is no data in $2 in the raw 302.

Joined: Feb 2005
Posts: 681
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Feb 2005
Posts: 681
This I know, but haltdef should prevent that from displaying and it doesn't.

Hey I finally kicked that monkey off my back, now I
just have an old hand, but that's just from overuse.

Last edited by mIRCManiac; 14/04/06 04:05 PM.

Link Copied to Clipboard