This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Making my windrop-bot respond with the users IP adress

Old posts that have not been replied to for several years.
h
h3ctic
Voice
Posts: 15
Joined: Thu Aug 18, 2005 8:00 pm

Making my windrop-bot respond with the users IP adress

Post by h3ctic »

(this is for use in a gaming-channel)

Hi,

I'd like a tcl that responds to a trigger. eg "!ip" with the user that sent
the triggers ip adress, ex:

<user1>!ip
<bot>user1: your ip adress is 123.123.123.123

is this possible ???

note: my bot is currently Windrop 1.6.13+sharestick_cosmetic2

thanks and regards,
h3ctic
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

what's the point of such trigger? anyone knows their own IP already, why ask the bot about it?

and what's "sharestick_cosmetic2"? sounds fashionable... a new fragrance line for windrop? ;)
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

[cvslog] (2002-08-25 05:21:18 UTC) Module eggdrop1.6: Change committed
-patch("sharestick_cosmetic");
+patch("sharestick_cosmetic2");
* Alchera shrugs
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
h
h3ctic
Voice
Posts: 15
Joined: Thu Aug 18, 2005 8:00 pm

Post by h3ctic »

I believe the ip-to-country lookup does not do what I want my bot to do. My tcl coding is extremely limited. What I'd like is a tcl that responds to a trigger. eg "!ip" with the user that sent
the triggers ip adress, ex:

<user1>!ip
<bot>user1: your ip adress is 123.123.123.123

why do you shrugs over my bot's current version ? Is it too old ?
desmond wrote:what's the point of such trigger? anyone knows their own IP already, why ask the bot about it?
the point of the trigger is for a gaming channel, the user would do:

<user1>!ip

and the bot would actually say something like:

<bot>user1 is hosting a game of xxxx at his ip adress 123.123.123.123

Can somone please show me how to do this ??? ...as mentioned, my tcl scripting skills are extremely limited :(
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

why forcing the bot to tell that, what's wrong with user telling it himself?
h
h3ctic
Voice
Posts: 15
Joined: Thu Aug 18, 2005 8:00 pm

Post by h3ctic »

demond wrote:why forcing the bot to tell that, what's wrong with user telling it himself?
Many of the gamers in the channel comes in via java and have next to no knowledge about irc and its commands, let alone figuring out the difference between lan ip and 'external ip' etc, I guess I could simply give them a link to whatismyip.com or whatnot, but for some reason I feel its easier both for them...and me to learn them to simply type: !ip

:)

Now...can this be done using windrop or not ? (i know some of the scripts that do similar stuff needs dnsresolv, but this is perhaps included in the dns.dll ?)
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Ofloo's IP TCL may do what you wish.

Ensure you edit the following three lines:

Code: Select all

variable trigger "!locator" ;# channel trigger
variable channel "#eggdrop.conf,#therapy" ;# define your list of channels seperated by a ','
variable flag "-" ;# this flag decides who gets to use your trigger
The above script should work on Windrop.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
h
h3ctic
Voice
Posts: 15
Joined: Thu Aug 18, 2005 8:00 pm

Post by h3ctic »

Hi Alchera,

and thanks for the tip. The tcl however does not do what I wanted :(

Its nice and all, but it works like this:

<+user1> !ip
Private: -Bot- Error usage: !ip <nick|host|ip>.
<+user1> !ip user1
<@Bot> Result lookup for (user1) is (Norway).

Whereas I wanted it to do this:


<+user1> !ip
<@Bot> IP for (user1) is 123.123.123.123

As previously mentioned my tcl scripting skills is extremely limited so I doubt I'll be able to recode it to do what I want either :(

Anyone that could take a look at the script and edit it for me ?? :wink:
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

Code: Select all

bind pub - !ip foo
proc foo {n u h c t} {
   dnslookup [lindex [split $u @] 1] bar $n $c
}
proc bar {ip host stat nick chan} {
   if {$stat} {
      puthelp "privmsg $chan :$nick's ip address is $ip"
   } {
      puthelp "privmsg $chan :error resolving $nick's ip"
   }
}
h
h3ctic
Voice
Posts: 15
Joined: Thu Aug 18, 2005 8:00 pm

Post by h3ctic »

weeeeeeeeeeeeee :mrgreen: :mrgreen: :mrgreen: :mrgreen:

HUGE thanks demond !!!!!!!!!!!!!!!!!!!11

One last question:

whats wrong with this (its your code only modified a bit, adding more triggers):

Code: Select all

set trigger1   "@ip"
set trigger2   "@ip game2"
set trigger3   "@game3"
bind pub $trigbind $trigger1 text-1
bind pub $trigbind $trigger2 text-2
bind pub $trigbind $trigger3 text-3
proc text-1 {n u h c t} {
   dnslookup [lindex [split $u @] 1] text-11 $n $c
}
proc text-11 {ip host stat nick chan} {
   if {$stat} {
      puthelp "privmsg $chan :$nick's ip address is $ip"
   } {
      puthelp "privmsg $chan :error resolving $nick's ip"
   }
} 
proc text-2 {n u h c t} {
   dnslookup [lindex [split $u @] 1] text-22 $n $c
}
proc text-22 {ip host stat nick chan} {
   if {$stat} {
      puthelp "privmsg $chan :$nick is hosting a game of GAME2 at the ip address $ip"
   } {
      puthelp "privmsg $chan :error resolving $nick's ip"
   }
} 
proc text-3 {n u h c t} {
   dnslookup [lindex [split $u @] 1] text-33 $n $c
}
proc text-33 {ip host stat nick chan} {
   if {$stat} {
      puthelp "privmsg $chan :$nick hosting a game of GAME3 at the ip address $ip"
   } {
      puthelp "privmsg $chan :error resolving $nick's ip"
   }
} 
result was:

Code: Select all

<user1> @ip
<bot> user1's ip address is 123.123.123.123
<user1> @ip game2
<bot> user1's ip address is 123.123.123.123

(note on trigger "@ip game2" I wanted the bot to say: <bot> user1 is hosting a game of GAME2 at the ip address 123.123.123.123 - instead it seems it triggered the trigger1, not trigger2.... )

<user1> @game3
<bot> user1 is hosting a game of GAME3 at the ip address 123.123.123.123
I suspect it has something to do with the fact that trigger2 has a space in its name ??
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

use this:

Code: Select all

bind pub - !game foo
proc foo {n u h c t} {
   dnslookup [lindex [split $u @] 1] bar $n $c $t
}
proc bar {ip host stat nick chan game} {
   if {$stat} {
      puthelp "privmsg $chan :$nick is hosting $game on $ip"
   } {
      puthelp "privmsg $chan :error resolving $nick's ip"
   }
} 
and use it like this: !game GAME1
h
h3ctic
Voice
Posts: 15
Joined: Thu Aug 18, 2005 8:00 pm

Post by h3ctic »

ah yes..nice demond !!

that way i see i can "bring the variable with me" into the proc...but what if I want several triggers that includes spaces...like

"!ip game1"
"!ip game2"
"!ip game3"

where the bot would respond:

<user1>!ip game1
<bot>user1 starting game1 at ip 123.123.123.123

<user2>!ip game2
<bot>user1 starting game2 at ip 123.123.123.123

etc
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

why several triggers when what you want is perfectly done with the code I gave you???
h
h3ctic
Voice
Posts: 15
Joined: Thu Aug 18, 2005 8:00 pm

Post by h3ctic »

I really appreciate your help, and the code you provided works 110% for that one !game trigger, the thing is that in the channel its possible to start different games and it would be nice to have the bot to advertise it, like:

<user1>!game cs
<bot>a game of cs starting at ip 1.2.3.4

<user2>!game ut
<bot>a game of ut forming at ip 1.2.3.4

etc

It seems problematic however to have triggers that includes spaces, so if its not possible I can simply do:

!gamecs
!gameut

but it would still be interesting to get confirmed if its possible with two-word-triggers (that includes spaces) :)
Locked