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 

Getting value "Username" of nick

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
neoclust
Halfop


Joined: 14 Aug 2009
Posts: 55

PostPosted: Tue Sep 14, 2010 4:28 pm    Post subject: Getting value "Username" of nick Reply with quote

Quote:
Eggy is ~eggy@host.us * Eggdrop
Eggy on +#tcl
Eggy using *.undernet.org The Undernet Underworld
Eggy is logged in as Eggdrop
Eggy End of /WHOIS list.


how I can get the username of that nick plz thanks.[/b]
Back to top
View user's profile Send private message
neoclust
Halfop


Joined: 14 Aug 2009
Posts: 55

PostPosted: Tue Sep 14, 2010 7:56 pm    Post subject: Reply with quote

Hello i'm using this code but the bot he doenst respond u have an idea plz !

Code:
bind join - * vip
proc vip { nick uhost hand chan } {
       bind raw  - 307 Username:check
   puthelp "whois $nick"
}

proc Username:check {from kw text} {
   set nick [lindex $arg 1]
   set vip [lindex $text 4]
   set startuser [lsearch -glob [split $vip] as*]; incr startuser
    set username [join [lrange [split $vip] $startuser end]]
    putlog "Username for $nick = $username"
   return 0
}
putlog "whois.tcl chargé"
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Tue Sep 14, 2010 8:58 pm    Post subject: Reply with quote

Here is an example... I tried it with a test bot, on Undernet, and it seemed to work ok.
However, there are many on this forum with a lot of experience. It would be interesting for them to comment with improvements, etc.

Try it with: !undernetwhois <nick>
Code:

bind pub - !undernetwhois unetwhois


proc unetwhois {nick uhost handle chan text} {
global workingchan

   set workingchan $chan
   
   bind raw - 330 330proc
   bind raw - 318 318proc

   putserv "whois [lindex [split $text] 0]"

}


proc 330proc {from keyword text} {
global workingchan loggedinas
   set loggedinas [lindex [split $text] 2]
   putserv "privmsg $workingchan : That user is logged in as $loggedinas"

unbind raw -|- 330 330proc

}

proc 318proc {from keyword text} {
global workingchan
   putserv "privmsg $workingchan : [lrange [split $text] 2 end]"

unbind raw -|- 318 318proc
unbind raw -|- 330 330proc
}

Back to top
View user's profile Send private message
neoclust
Halfop


Joined: 14 Aug 2009
Posts: 55

PostPosted: Wed Sep 15, 2010 5:36 am    Post subject: Reply with quote

Thanks man Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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