thanks to the bot of you... i believe the !chaninfo and !nickinfo is ok now... the problem now is the !who <nick> the one u made iamdeath seems to be working, but comes with a little bug dat i simply could not see in ur code... the problem is that when i restart the bot with the new !whois script... it starts displaying all the whois infor of all the nicks from the channel even when no one including me initiated a !whois command yet. dya guys think its being triggered by another script badchan.tcl maybe? i duno... pls help ^_^ again thanks to the both of u.
Actually, the code written by iamdeath will dump the information from any WHOIS to the channel specified - including the ones done by the eggdrop core itself.. You'd probably need some request-tracking, so that output is only produced when a whois is requested using this script. The queueing system in my previous post might be a something to get started with.
Also, it does not use "args" properly within the script:whois1, as this is already a list of arguments. Changing the name to something different than "args" should solve that problem however.
Thanks for point it out masheen, to me the bot is showing on it's whois when it's reconnecting or being restarted. It is not showing all the users in the channel. I guess the tcl badchan.tcl you're using is causing the problem, that tcl must be scanning hosts for all the users in the channel. Try to stop it and then restart the bot you will find out yourself, yet I am reading more about it and if I get something helpfull i'll revise my script.
Tcl error [script:whois1]: can't read "user": no such variable
Tcl error [script:whois1]: can't read "user": no such variable
Tcl error [script:whois1]: can't read "user": no such variable
Tcl error [script:whois1]: can't read "user": no such variable
This will come when you restart the bot, once you perform the !whois command that msg will stop coming. Hey excuse me please, I aint a good TCL programmer, I am in learning stage.
@iamdeath:
Try adding some tests wether user has been set before you actually read it (in script:whois1), and you'll get rid of those errors.
Also, change the name of the argument "args" to something else (anything but "args"), also "join" the output from "lrange", and you can drop all those regsubs (alot faster, and proper).
ie:
thanks alot nml.. the 2nd tip I am using and I got rid of regsub issues thanks alot for the tip.. but the first tip.. I can't get it done, can you help me how to solve that issue?.. I've tried all the possible ways.
The trick is that tcl uses "lazy" operators, that is, in the case of "test1 || test2", if the first test is true, there is no need to evaluate the second one, since it cannot alter the resulting condition. So in the above case, if the variable does'nt exist, there is'nt any use for testing it against "nickname".
set mychannel "#Channel"
bind pub -|- !whois script:whois
proc script:whois { nick host handle chan text } {
global user
set text [split $text]
set user [lindex $text 0]
if {$user == ""} {puthelp "NOTICE $nick :You need to supply a nickname."; return}
putquick "WHOIS $user"
}
bind raw - "311" script:whois1
bind raw - "312" script:whois1
bind raw - "318" script:whois1
bind raw - "319" script:whois1
bind raw - "401" script:whois1
bind raw - "301" script:whois1
bind raw - "313" script:whois1
bind raw - "330" script:whois1
bind raw - "317" script:whois1
proc script:whois1 {from key text} {
global mychannel user
set text [split $text " "]
set topaste [join [lrange $text 1 end] " "]
set nickname [lindex $text 1]
if {![info exists user] || [string compare -nocase $nickname $user]} {return 0}
putserv "PRIVMSG $mychannel :$topaste"
}
putlog "!whois script loaded by iamdeath."
yay! Thanks alot nml, that was really very usefull.. Thanks alot, I understand it now, earlier it was'nt clear to me. Now it's in my brain like drilled .. you rock man... by the way, did we just wasted our time, we already had a tcl like this in TCL archive LOL WHOIS TCL
anyway got to learn many things from this posts and yeah I have updated more raw so that all the replies can be seen in the channel.
how to make it work automatically to all channel that bot entry?
example :
we are stay in #chan-b
than command in #chan-b !chaninfo #chan-a
the bot will display information at #chan-b about #chan-a
I need additional info for how many users there, how many banned mask, how many ops, and how many +v are in chan-a.