| View previous topic :: View next topic |
| Author |
Message |
h3ctic Voice
Joined: 18 Aug 2005 Posts: 15
|
Posted: Thu Aug 18, 2005 8:03 pm Post subject: Making my windrop-bot respond with the users IP adress |
|
|
(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 |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Thu Aug 18, 2005 10:24 pm Post subject: |
|
|
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?  |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
|
| Back to top |
|
 |
h3ctic Voice
Joined: 18 Aug 2005 Posts: 15
|
Posted: Sat Aug 20, 2005 5:53 pm Post subject: |
|
|
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  |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sat Aug 20, 2005 6:13 pm Post subject: |
|
|
| why forcing the bot to tell that, what's wrong with user telling it himself? |
|
| Back to top |
|
 |
h3ctic Voice
Joined: 18 Aug 2005 Posts: 15
|
Posted: Sat Aug 20, 2005 7:01 pm Post subject: |
|
|
| 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 ?) |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Sat Aug 20, 2005 8:15 pm Post subject: |
|
|
Ofloo's IP TCL may do what you wish.
Ensure you edit the following three lines:
| Code: | 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 |
|
| Back to top |
|
 |
h3ctic Voice
Joined: 18 Aug 2005 Posts: 15
|
Posted: Sun Aug 21, 2005 7:20 am Post subject: |
|
|
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 ??  |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sun Aug 21, 2005 4:27 pm Post subject: |
|
|
| Code: |
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"
}
}
|
|
|
| Back to top |
|
 |
h3ctic Voice
Joined: 18 Aug 2005 Posts: 15
|
Posted: Mon Aug 22, 2005 1:42 am Post subject: |
|
|
weeeeeeeeeeeeee
HUGE thanks demond !!!!!!!!!!!!!!!!!!!11
One last question:
whats wrong with this (its your code only modified a bit, adding more triggers):
| Code: |
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: |
<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 ?? |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Mon Aug 22, 2005 2:07 am Post subject: |
|
|
use this:
| Code: |
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 |
|
| Back to top |
|
 |
h3ctic Voice
Joined: 18 Aug 2005 Posts: 15
|
Posted: Mon Aug 22, 2005 3:15 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Mon Aug 22, 2005 3:48 am Post subject: |
|
|
| why several triggers when what you want is perfectly done with the code I gave you??? |
|
| Back to top |
|
 |
h3ctic Voice
Joined: 18 Aug 2005 Posts: 15
|
Posted: Mon Aug 22, 2005 3:56 am Post subject: |
|
|
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)  |
|
| Back to top |
|
 |
|