| View previous topic :: View next topic |
| Author |
Message |
iamdeath Master

Joined: 11 Feb 2005 Posts: 323 Location: *HeLL*
|
Posted: Tue Dec 25, 2007 7:06 am Post subject: WHO help |
|
|
Hi, I was trying to assist a user here, while working on his request I am stuck at the middle, WHO mechanism is taken from caesars script it helped me to find out how it works. but for somereasons it's not working fine ;/
| Code: | # binds #
bind pub - "!matchip" proc:match
bind raw - 352 who:check
proc proc:match {nick uhost handle channel text} {
global matchip
set matchip $text
putserv "WHO $channel"
}
# who check #
proc who:check {from key arg} {
global matchip
set chan [lindex $arg 1]
set nick [lindex $arg 5]
set uhost *!*@[lindex [split $arg] 3]
set realname [lrange [lindex [split $arg ":"] 1] 1 end]
if {[strlwr $matchip] == [strlwr $uhost]} {
puthelp "PRIVMSG $chan :Found $nick matching your request."
}
unset matchip
} |
The error I am getting is:
| Code: | [16:02] <Cricket`-> [14:38] Tcl error [who:check]: can't read "matchip": no such variable
[16:02] <Cricket`-> [14:38] Tcl error [who:check]: can't read "matchip": no such variable
[16:02] <Cricket`-> [14:38] Tcl error [who:check]: can't read "matchip": no such variable
[16:02] <Cricket`-> [14:38] Tcl error [who:check]: can't read "matchip": no such variable
[16:02] <Cricket`-> [14:38] Tcl error [who:check]: can't read "matchip": no such variable
[16:02] <Cricket`-> [14:38] Tcl error [who:check]: can't read "matchip": no such variable
[16:02] <Cricket`-> [14:38] Tcl error [who:check]: can't read "matchip": no such variable
[16:02] <Cricket`-> [14:38] Tcl error [who:check]: can't read "matchip": no such variable
[16:02] <Cricket`-> [14:38] Tcl error [who:check]: can't read "matchip": no such variable
[16:02] <Cricket`-> [14:38] Tcl error [who:check]: can't read "matchip": no such variable
[16:02] <Cricket`-> [14:38] Tcl error [who:check]: can't read "matchip": no such variable
[16:02] <Cricket`-> [14:38] Tcl error [who:check]: can't read "matchip": no such variable
[16:03] <Cricket`-> [14:38] Tcl error [who:check]: can't read "matchip": no such variable
[16:03] <Cricket`-> [14:38] Tcl error [who:check]: can't read "matchip": no such variable
[16:03] <Cricket`-> [14:38] Tcl error [who:check]: can't read "matchip": no such variable
[16:03] <Cricket`-> [14:38] Tcl error [who:check]: can't read "matchip": no such variable
[16:03] <Cricket`-> [14:38] Tcl error [who:check]: can't read "matchip": no such variable
[16:03] <Cricket`-> [14:38] Tcl error [who:check]: can't read "matchip": no such variable |
Thanks
iamdeath _________________ |AmDeAtH @ Undernet
Death is only the *Beginning*... |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Tue Dec 25, 2007 12:54 pm Post subject: |
|
|
could try something like | Code: | set match(ip) ""
proc pub:match {nick host handle channel text} {
global match
if {$text == ""} {return 0}
set match(ip) "$text"
puthelp "WHO $channel"
return 1
}
proc raw:match {from key text} {
global match
set chan [lindex $text 1]
set nick [lindex $text 5]
set host "*!*@[lindex $text 3]"
set geos [lrange [lindex [split $text ":"] 1] 1 end]
if {[strlwr $match(ip)] == [strlwr $host]} {
puthelp "PRIVMSG $chan :Found $nick matching your request."
}; set match(ip) ""; return
}
bind pub - !matchip pub:match
bind raw - 352 raw:match
putlog "loaded who.tcl"
return | btw, what ircd is this please? _________________ TCL the misunderstood |
|
| Back to top |
|
 |
iamdeath Master

Joined: 11 Feb 2005 Posts: 323 Location: *HeLL*
|
Posted: Tue Dec 25, 2007 2:23 pm Post subject: |
|
|
Thanks for the reply, it's for Undernet version u2.10.12.12.
Ok the tcl works fine for the first entry but then it halts with no responce, prolly it's not killing set match(ip) properly.
| Code: | [23:21] <iamdeath> !matchip *!*@iamdeath.users.undernet.org
[23:21] <Cricket`-> Found iamdeath matching your request.
[23:21] <iamdeath> !matchip *!*@cricket.users.undernet.org
[23:22] <iamdeath> !matchip *!*@cricketbot.users.undernet.org |
Thanks
iamdeath _________________ |AmDeAtH @ Undernet
Death is only the *Beginning*... |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Tue Dec 25, 2007 2:44 pm Post subject: |
|
|
Thats gd wasn't expecting it to work. Since i didn't test it. Thanks for the information on ircd type. use to unrealircd. Try changing | Code: | | }; set match(ip) ""; return | to Also, it could be worth removing the return, since that way it would possible just return as many matches as it gets from the /who #channel output. Like the foreach loop would. using return would brake the loop from the /who #channel
edit; fixed typeo. should of been loop not look. _________________ TCL the misunderstood
Last edited by TCL_no_TK on Wed Dec 26, 2007 2:11 am; edited 1 time in total |
|
| Back to top |
|
 |
iamdeath Master

Joined: 11 Feb 2005 Posts: 323 Location: *HeLL*
|
Posted: Tue Dec 25, 2007 11:23 pm Post subject: |
|
|
works fine like this
So far works fine, dont know about the future
Thanks alot
iamdeath _________________ |AmDeAtH @ Undernet
Death is only the *Beginning*... |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Wed Dec 26, 2007 2:12 am Post subject: |
|
|
no worries. glad it worked out. _________________ TCL the misunderstood |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Thu Dec 27, 2007 1:07 pm Post subject: |
|
|
You do know that eggdrops already keep a host cached for every chanuser right?
| Code: | bind pub - !matchip pub:match
proc pub:match {nick host handle channel text} {
if {$text == ""} {
return;
}
foreach user [chanlist $channel] {
if {[string match -nocase [getchanhost $user] $text]} {
putserv "PRIVMSG $channel :$user matches $text."
}
}
} |
|
|
| Back to top |
|
 |
iamdeath Master

Joined: 11 Feb 2005 Posts: 323 Location: *HeLL*
|
Posted: Thu Dec 27, 2007 2:38 pm Post subject: |
|
|
Thanks metroid, that was really easy .. I never thought of doing that.. thanks alot
iamdeath _________________ |AmDeAtH @ Undernet
Death is only the *Beginning*... |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Thu Dec 27, 2007 3:51 pm Post subject: |
|
|
Yeah. Thats a good tip, but i dont relay on it as it only last for as long as wait-split is set for. which for me isn't verry long  _________________ TCL the misunderstood |
|
| Back to top |
|
 |
|