mIRC Homepage
Posted By: RangerX_ Can't get hostmask for $me? - 16/04/03 11:40 PM
I have a bot scripted to run on the same computer as I'm on. For commands meant for me only, I run a simple hostmask check to see if the user is me or not. The function is:

;CHECKS TO MAKE SURE IT'S ME
alias isme {
if ($address($1,2) == $address($me,2)) {
return $true
}
return $false
}

The bug comes into play when the bot is disconnected and reconnected to a server (due to a netsplit, manual reconnect, etc.). The bot seems to be no longer to find it's own address. It returns the following:

[19:41:02] -RangerBot- Address mismatch; You aren't my owner!!
[19:41:04] -RangerBot- You: *!*@159.178.254.37
[19:41:06] -RangerBot- Me:

No address. The only solution is to restart mIRC. Is there something I'm doing wrong?
Posted By: KingTomato Re: Can't get hostmask for $me? - 16/04/03 11:51 PM
When it joins the channel, the user masks are unknown. Try adding this line to your bot, or add to the on join event you have currently...

Code:
on 1:JOIN:#: {
  if ($nick == $me) { /who $chan }
}


That will who the whole channel, activly getting every user's host mask in the channel. >:F
Posted By: RangerX_ Re: Can't get hostmask for $me? - 17/04/03 02:25 AM
Very execellent. Works perfectly.

Maybe something like that could be implemented into the program in the future? Or might that be too resource intensive or something?
Posted By: Collective Re: Can't get hostmask for $me? - 17/04/03 07:25 AM
Increases the chances of you flooding yourself off the server, would make a nice option though..
© mIRC Discussion Forums