| View previous topic :: View next topic |
| Author |
Message |
neoclust Halfop
Joined: 14 Aug 2009 Posts: 55
|
Posted: Tue Sep 14, 2010 4:28 pm Post subject: Getting value "Username" of nick |
|
|
| 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 |
|
 |
neoclust Halfop
Joined: 14 Aug 2009 Posts: 55
|
Posted: Tue Sep 14, 2010 7:56 pm Post subject: |
|
|
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 |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Tue Sep 14, 2010 8:58 pm Post subject: |
|
|
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 |
|
 |
neoclust Halfop
Joined: 14 Aug 2009 Posts: 55
|
Posted: Wed Sep 15, 2010 5:36 am Post subject: |
|
|
Thanks man  |
|
| Back to top |
|
 |
|