mIRC Homepage
Posted By: Nizzle Get IP address - 12/02/05 02:25 PM
Hi,

I made my very first bot in IRC and I was wondering how to returns someones IP adress. I now have something like this but it obviously doesnt work.

on @[IP][*:TEXT:!ip *:#: {
$ip $nick
}

I iam stuck from the $ip variable. Dont know how to continue... any help?
Posted By: Chris2015 Re: Get IP address - 12/02/05 02:43 PM
unless you have groups setup in your userlist for @[IP][..
you do not need @[IP][*:text:...etc..

on *:text:!ip:#:msg $chan My ip is $ip
this will msg the channel with your IP (or your bots ip...)

on *:text:!ip *:#:{ if $2 !ison $chan {
msg $chan you got the nickname wrong
}
else { msg $chan $2 host is $address($2,2)
}
}
this will return the host of $2..example...
!ip Chris2015
that will get my hostmask and msg it to the channel


hope this helps
Posted By: gemeau50 Re: Get IP address - 12/02/05 02:44 PM
$ip - returns your IP address.

Are you really looking for the user's IP or are you looking for the portion of address after " @ "?

For a starter look at $site
Posted By: Nizzle Re: Get IP address - 12/02/05 03:33 PM
I'm looking for the IP address of the user.

So when I do !ip nickname it has to return the users IP address.

I tried

on *:text:!ip *:#:{ if $2 !ison $chan {
/msg $chan you got the nickname wrong
}
else { /msg $chan $2 host is $address ($2,2)
}
}

But for some reason it doesnt work.
Posted By: Chris2015 Re: Get IP address - 12/02/05 03:39 PM
are you typing !ip on the SAME mirc that you put the script on?
if so then it wont work..previously you said that you had a bot..
so put the code on your bot, not YOUr client.
Posted By: Nizzle Re: Get IP address - 12/02/05 03:41 PM
I miight be an IRC noob but I know that :tongue:

I'm in the channel with my bot but it just doesnt sho wanything confused
Posted By: Mentality Re: Get IP address - 12/02/05 03:47 PM
on *:text:!ip *:#:{
if ($2 !ison $chan) {
msg $chan you got the nickname wrong
}
else {
msg $chan $2 host is $address($2,2)
}
}


You had a space between $address and ($2,2). I tested the above in my own mIRC so it should work okay smile

Regards,
Posted By: Nizzle Re: Get IP address - 12/02/05 03:49 PM
Nizzle host is *!*@g9113.upc-g.chello.nl

it does work now tho but it shows my erm well it isnt my IP address of is it?

Anyway thx for all ur help I didnt mention that in all my otehr posts shocked
Posted By: Mentality Re: Get IP address - 12/02/05 03:51 PM
That is your hostname. You cannot obtain the IP address without performing a /DNS lookup. You may wish to see /help ON DNS.

Regards,
Posted By: Chris2015 Re: Get IP address - 12/02/05 03:51 PM
you will have to resolve that..that is jsut as good as an ip address..

/dns *!*@---------

also..sorry about the space
<--is half asleep

happy scriptin'
Posted By: Nizzle Re: Get IP address - 12/02/05 03:52 PM
ok thx guys I'll see what I can do on my own now smile

Cheers!
Posted By: tidy_trax Re: Get IP address - 12/02/05 04:58 PM
If the server masks hostnames then you won't have any way of getting the users ip address other than asking them for it.
Posted By: Gamersad Re: Get IP address - 13/02/05 11:11 AM
Yeah, if there is a mode protecting the users IP you cant do it... I dont really see a use for this command unless your an IRCop and its in an oper channel.. or something even then *shrugs* ip addresses are quit pointless to an everyday IRC user... (we mask ours at our network.. +x on unreal.)
© mIRC Discussion Forums