mIRC Homepage

I.P Identifyer?

Posted By: zad0909

I.P Identifyer? - 01/09/07 06:11 PM

Is there anyway for my bot given jsut an ip and on command to do a whois type of thing and then give the screen name for that ip?
Posted By: argv0

Re: I.P Identifyer? - 01/09/07 06:20 PM

$ip refers to your bots ip. you can't really look up users by ip-- you can *try* to with the /who command but it does not return results for users who are +i, which is usually about 95% of the users logged on.
Posted By: Horstl

Re: I.P Identifyer? - 01/09/07 06:35 PM

You could use a "trigger" like the one below; as the ip is some kind of confidential data imho, I added (at least) a "very simple security check"...

Add these lines to your bot's remotes. Change "yournick" and "somepassword":
Code:
on *:notice:*:*: {
  if ($1 == getip) { 
    if (($nick == yournick) && ($2 == somepassword)) { .notice $nick my current ip is $ip }
    else { .notice $nick request denied. }
  }
}


To make bot send you a notice with his current ip, type:
Code:
/notice <nick-of-your-bot> getip <password>


Edit: reading your request again; I doubt this is what you wanted. To avoid further guess... can you please clarify what you want the bot to do? smile
Posted By: zad0909

Re: I.P Identifyer? - 01/09/07 09:07 PM

Sorry, I'll try and be a bit more specific.
Something like this !whois (nick/ip goes here)

The bot would then do a whois and notice the person who did the command one of the following:

If the person did !whois (nick here)
IT would tell them the ip of that nick provided that person is on of course.

IF the person did !whois (ip here)
IT would tell them the nick that goes to that ip.

I am just not sure the ip version will work. I know bots can do the whois and get the ip for a nick (the code for that would be appreciated as well). However would the !whois ip work?
Posted By: deegee

Re: I.P Identifyer? - 01/09/07 09:28 PM

If the person did /dns (nick here)
IT would tell them the ip of that nick provided that person is on of course.
No scripting needed, just as easy for them to type... shocked


As for the IP, read what argv0 said above.
Posted By: noMen

Re: I.P Identifyer? - 01/09/07 09:28 PM

Maybe something like this?
Code:
on *:TEXT:*:#: {
  if ($1 == !whois) && ($2) {
    set %noticenick $nick
    if (. isin $2) {
      .enable #who
      .who $2
    }
    else {
      .enable #whois
      .whois $2
    }
  }
}

#who off
raw 352:*: {
  .disable #who
  .notice %noticenick $4 has nick $6
}
raw 315:*: {
  .disable #who
  .notice %noticenick $2 not found
}
#who end

#whois off
raw 311:*: {
  .disable #whois
  .notice %noticenick $2 has ip $4
}
raw 318:*: {
  .disable #whois
  .notice %noticenick $2 not found
}
#whois end
Posted By: zad0909

Re: I.P Identifyer? - 02/09/07 02:22 AM

Thanks a lot.

Still looking for one that can give the nick that matches the IP. So you can find a nick with just an ip. Also can you make it so that when it does the whois it will also say what chans they are in? Since it does it on the whois anyway I just need the bot to say it.

Thanks
Posted By: noMen

Re: I.P Identifyer? - 02/09/07 07:19 AM

You could do something like this:
Code:
#whois off
raw 311:*: {
  set %whoisfound 1
  .notice %noticenick $2 has ip $4
}
raw 319:*: {
  set %whoisfound 1
  .notice %noticenick $2 is on chans $3-
}
raw 318:*: {
  .disable #whois
  if (!%whoisfound) {
    .notice %noticenick $2 not found
  }
  unset %whoisfound
}
#whois end


But like argv0 said, you can't always find somebody by his ip.
Posted By: zad0909

Re: I.P Identifyer? - 02/09/07 02:29 PM

Thanks I see.

Think you can get it to where when you do the !whois command it will also say what chans they are in since its in the whois anyway?
Posted By: noMen

Re: I.P Identifyer? - 02/09/07 03:55 PM

Originally Posted By: zad0909
Thanks I see.

Think you can get it to where when you do the !whois command it will also say what chans they are in since its in the whois anyway?


I think I did in my last example with the raw 319 event ....
Posted By: zad0909

Re: I.P Identifyer? - 02/09/07 04:09 PM

oh, sorry man I didnt notice it.

Thank you very much.
© 2022 mIRC Discussion Forums