mIRC Home    About    Download    Register    News    Help

Topic Options
#184802 - 01/09/07 07:11 PM I.P Identifyer?
zad0909 Offline
Ameglian cow

Registered: 30/07/07
Posts: 42
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?

Top
#184803 - 01/09/07 07:20 PM Re: I.P Identifyer? [Re: zad0909]
argv0 Offline
Planetary brain

Registered: 13/10/03
Posts: 3918
Loc: Montreal, QC, Canada
$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.
_________________________
- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"

Top
#184807 - 01/09/07 07:35 PM Re: I.P Identifyer? [Re: zad0909]
Horstl Offline
Hoopy frood

Registered: 03/11/06
Posts: 1559
Loc: Germany
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


Edited by Horstl (01/09/07 07:39 PM)

Top
#184819 - 01/09/07 10:07 PM Re: I.P Identifyer? [Re: Horstl]
zad0909 Offline
Ameglian cow

Registered: 30/07/07
Posts: 42
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?

Top
#184821 - 01/09/07 10:28 PM Re: I.P Identifyer? [Re: zad0909]
deegee Offline
Fjord artisan

Registered: 16/06/06
Posts: 508
Loc: Storage
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.

Top
#184822 - 01/09/07 10:28 PM Re: I.P Identifyer? [Re: zad0909]
noMen Offline
Vogon poet

Registered: 17/01/06
Posts: 111
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

Top
#184845 - 02/09/07 03:22 AM Re: I.P Identifyer? [Re: noMen]
zad0909 Offline
Ameglian cow

Registered: 30/07/07
Posts: 42
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

Top
#184861 - 02/09/07 08:19 AM Re: I.P Identifyer? [Re: zad0909]
noMen Offline
Vogon poet

Registered: 17/01/06
Posts: 111
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.

Top
#184876 - 02/09/07 03:29 PM Re: I.P Identifyer? [Re: noMen]
zad0909 Offline
Ameglian cow

Registered: 30/07/07
Posts: 42
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?

Top
#184885 - 02/09/07 04:55 PM Re: I.P Identifyer? [Re: zad0909]
noMen Offline
Vogon poet

Registered: 17/01/06
Posts: 111
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 ....

Top
#184886 - 02/09/07 05:09 PM Re: I.P Identifyer? [Re: noMen]
zad0909 Offline
Ameglian cow

Registered: 30/07/07
Posts: 42
oh, sorry man I didnt notice it.

Thank you very much.

Top