* Alchera shrugs-patch("sharestick_cosmetic");
+patch("sharestick_cosmetic2");
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 sentAlchera wrote:Ip-to-Country lookup lib
the point of the trigger is for a gaming channel, the user would do:desmond wrote:what's the point of such trigger? anyone knows their own IP already, why ask the bot about it?
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: !ipdemond wrote:why forcing the bot to tell that, what's wrong with user telling it himself?
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
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"
}
}
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"
}
}
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
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"
}
}