This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Getting value "Username" of nick

Help for those learning Tcl or writing their own scripts.
Post Reply
n
neoclust
Halfop
Posts: 55
Joined: Fri Aug 14, 2009 11:03 am

Getting value "Username" of nick

Post by neoclust »

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]
n
neoclust
Halfop
Posts: 55
Joined: Fri Aug 14, 2009 11:03 am

Post by neoclust »

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

Code: Select all

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é"
w
willyw
Revered One
Posts: 1203
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

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: Select all

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
}

n
neoclust
Halfop
Posts: 55
Joined: Fri Aug 14, 2009 11:03 am

Post by neoclust »

Thanks man :)
Post Reply