mIRC Home    About    Download    Register    News    Help

Print Thread
#184802 01/09/07 06:11 PM
Joined: Jul 2007
Posts: 42
Z
zad0909 Offline OP
Ameglian cow
OP Offline
Ameglian cow
Z
Joined: Jul 2007
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?

zad0909 #184803 01/09/07 06:20 PM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
$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"
zad0909 #184807 01/09/07 06:35 PM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
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

Last edited by Horstl; 01/09/07 06:39 PM.
Horstl #184819 01/09/07 09:07 PM
Joined: Jul 2007
Posts: 42
Z
zad0909 Offline OP
Ameglian cow
OP Offline
Ameglian cow
Z
Joined: Jul 2007
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?

zad0909 #184821 01/09/07 09:28 PM
Joined: Jun 2006
Posts: 508
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
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.

zad0909 #184822 01/09/07 09:28 PM
Joined: Jan 2006
Posts: 111
N
Vogon poet
Offline
Vogon poet
N
Joined: Jan 2006
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

noMen #184845 02/09/07 02:22 AM
Joined: Jul 2007
Posts: 42
Z
zad0909 Offline OP
Ameglian cow
OP Offline
Ameglian cow
Z
Joined: Jul 2007
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

zad0909 #184861 02/09/07 07:19 AM
Joined: Jan 2006
Posts: 111
N
Vogon poet
Offline
Vogon poet
N
Joined: Jan 2006
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.

noMen #184876 02/09/07 02:29 PM
Joined: Jul 2007
Posts: 42
Z
zad0909 Offline OP
Ameglian cow
OP Offline
Ameglian cow
Z
Joined: Jul 2007
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?

zad0909 #184885 02/09/07 03:55 PM
Joined: Jan 2006
Posts: 111
N
Vogon poet
Offline
Vogon poet
N
Joined: Jan 2006
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 ....

noMen #184886 02/09/07 04:09 PM
Joined: Jul 2007
Posts: 42
Z
zad0909 Offline OP
Ameglian cow
OP Offline
Ameglian cow
Z
Joined: Jul 2007
Posts: 42
oh, sorry man I didnt notice it.

Thank you very much.


Link Copied to Clipboard