egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Making my windrop-bot respond with the users IP adress
Goto page 1, 2  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
h3ctic
Voice


Joined: 18 Aug 2005
Posts: 15

PostPosted: Thu Aug 18, 2005 8:03 pm    Post subject: Making my windrop-bot respond with the users IP adress Reply with quote

(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
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Thu Aug 18, 2005 9:14 pm    Post subject: Reply with quote

Ip-to-Country lookup lib
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Thu Aug 18, 2005 10:24 pm    Post subject: Reply with quote

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? Wink
Back to top
View user's profile Send private message Visit poster's website
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Thu Aug 18, 2005 11:10 pm    Post subject: Reply with quote

[cvslog] (2002-08-25 05:21:18 UTC) Module eggdrop1.6: Change committed

Quote:
-patch("sharestick_cosmetic");
+patch("sharestick_cosmetic2");


* Alchera shrugs
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
h3ctic
Voice


Joined: 18 Aug 2005
Posts: 15

PostPosted: Sat Aug 20, 2005 5:53 pm    Post subject: Reply with quote

Alchera wrote:
Ip-to-Country lookup lib


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 Sad
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sat Aug 20, 2005 6:13 pm    Post subject: Reply with quote

why forcing the bot to tell that, what's wrong with user telling it himself?
Back to top
View user's profile Send private message Visit poster's website
h3ctic
Voice


Joined: 18 Aug 2005
Posts: 15

PostPosted: Sat Aug 20, 2005 7:01 pm    Post subject: Reply with quote

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

Smile

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
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Sat Aug 20, 2005 8:15 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
h3ctic
Voice


Joined: 18 Aug 2005
Posts: 15

PostPosted: Sun Aug 21, 2005 7:20 am    Post subject: Reply with quote

Hi Alchera,

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

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 Sad

Anyone that could take a look at the script and edit it for me ?? Wink
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sun Aug 21, 2005 4:27 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
h3ctic
Voice


Joined: 18 Aug 2005
Posts: 15

PostPosted: Mon Aug 22, 2005 1:42 am    Post subject: Reply with quote

weeeeeeeeeeeeee Mr. Green Mr. Green Mr. Green Mr. Green

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
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Mon Aug 22, 2005 2:07 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
h3ctic
Voice


Joined: 18 Aug 2005
Posts: 15

PostPosted: Mon Aug 22, 2005 3:15 am    Post subject: Reply with quote

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
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Mon Aug 22, 2005 3:48 am    Post subject: Reply with quote

why several triggers when what you want is perfectly done with the code I gave you???
Back to top
View user's profile Send private message Visit poster's website
h3ctic
Voice


Joined: 18 Aug 2005
Posts: 15

PostPosted: Mon Aug 22, 2005 3:56 am    Post subject: Reply with quote

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) Smile
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive All times are GMT - 4 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber