Im having some problems with this script I made some edits and it works but I would like to make it so the bot will not founder or admin anyone but a bot owner. Here is part of code.
proc founder {nick host hand chan text} {
if {$text == ""} {
putquick "MODE $chan +q $nick"
putlog "#$hand# has founder themselves in $chan"
} else {
set foundernick [lindex $text 0]
putquick "MODE $chan +q $foundernick"
putlog "#$hand# has founder $foundernick in $chan"
}
}
This works..ie
!founder
or !founder nick
the problem is with the second command. Any of the current owners can !founder nick and the bot will founder them. I would like it to only be able to founder a nick witht the n flag.
This part works perfect but im confused on how to to reverse it..heh
I actually binded it to a User defined flag. The problem is not with users using the founder command itself.The bot will not respond to users who do not have the flag.The problem im having is that I had a few instances where a peep that has the flag(Is allowed to use the !founder and !admin command) has mistakenly typed !founder nick(Who should not be founder)
heh make sense ?
I was hoping there was a way to make the bot check to see if the user being foundered has the user defined flag before it +q or +a.
ie
!founder Billy
The bot checks to see if Billy has the user defined flag or owner flag.If so it +q them if not it states this user is not a bot owner.
Im confused now even more..heh
The defounder is for admins etc that /away they can !defounder before they set away.
Like ribot said, use 'matchattr' to determine if the user has the right flags, but flags belong to HANDLES, not nicks. To find the handle from a nick use 'nick2hand', which will return * if no matching user is found (making 'validuser' return 0)...so something like this should do it:
Only because...
* the nick did not contain special chars that would make 'lindex' choke on the _string_ recieved from irc
* the nick was == the handle of some existing user
* the nick was on the channel
If one of these conditions are not met, your script will either generate a error message or do nothing but log a message about setting mode +q on someone that are not even on the channel