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 

hostname -> nickname

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
edu
Voice


Joined: 29 Oct 2006
Posts: 31

PostPosted: Wed Jan 24, 2007 5:49 am    Post subject: hostname -> nickname Reply with quote

Hi

I have a little problem ...
Code:

set edu(bot_host) "*!*@bot.users.undernet.org"


After I've setted that variable I want to find if that 'hostname' is on the channel where the bot is running. I want to switch the hostname into the host's nickname Rolling Eyes , ex:

If nickname "eggie" has hostname "*!*@bot.users.undernet.org", I want to 'show' that nickname

Thanks
_________________
Seek the truth
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Jan 24, 2007 4:44 pm    Post subject: Reply with quote

Code:
foreach n [chanlist $chan] {
 if {[string match -nocase $edu(bot_host) $n![getchanhost $n $chan]]} {
  # Found nick: $n
  break
 }
}

But what's the purpose of that? if it's to know if your bot is on the channel then a simple [botonchan $chan] will do that.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
edu
Voice


Joined: 29 Oct 2006
Posts: 31

PostPosted: Thu Jan 25, 2007 4:32 am    Post subject: Reply with quote

It's not for the bot, it's for something else

It doesn't work
Code:

set edu(hostname) "*!*@edu.users.undernet.org"
bind pub o|- .find edu:find
proc edu:find {nickname hostname handle channel text} {
   global edu
   foreach n [chanlist $channel] {
      if {[string match -nocase $edu(hostname) $n![getchanhost $n $channel]]} {
         # Found nick: $n
         putquick "PRIVMSG $channel :Found $n"
         break
      }
   }
}


Rolling Eyes
_________________
Seek the truth
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Jan 25, 2007 3:45 pm    Post subject: Reply with quote

Try:
Code:
set edu(hostname) "*!*@edu.users.undernet.org"
bind pub o .find edu:find
proc edu:find {nickname hostname handle channel text} {
   global edu
   foreach n [chanlist $channel] {
      if {[string match -nocase $edu(hostname) $n![getchanhost $n $channel]]} {
         set found $n
         break
      }
   }
   if {[info exists found]} {
      putserv "privmsg $channel :Found $n"
   }
}

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
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