Basically, the eggdrop is used in a web hosting support channel, our ops are all staff members of the company, I need a script to kind of record when someone helps a user, as they have requirements to be met every week.. I need to somehow set it up to when a user types !helped <nickname> <explanation> the bot will check if the <nickname> is infact an op in the channel, and then append a text file for that user, in a directory, for this, i'll use /home/rpope904/stafflogs so, say the user typed !helped rpope904 Nameservers help
The bot would write to the file /home/rpope904/stafflogs/rpope904.txt:
<Helped users nick> was helped with NameServers Help on DATE / TIME.
@rosc:
I fail to see the relevance of your comment...
@rpope904:
Something like this should do the trick, it is untested however, but I believe I've taken most precautions to prevent unauthorized access to the filesystem and sanitize any and all input data. Let me know how it works out..
This script assumes the helping op is added to your eggdrop's user database with op privileges.
bind pub - "!helped" pub_helped
proc pub_helped {nick host hand chan text} {
set data [split $text]
set helper [lindex $data 0]
if {[validuser [set h_hand [nick2hand $helper $chan]]] && [matchattr $h_hand o|o]} {
set reason [join [lrange $data 1 end]]
set fid [open [file join "/home" "rpope904" "stafflogs" [file tail $h_hand]] "WRONLY APPEND CREAT"]
puts $fid "$nick was helped with $reason on [clock format [clock seconds]]"
close $fid
} {
puthelp "PRIVMSG $nick :The nickname $helper was not recognized as an authorized op. Please check your data and try again."
}
}
@rpope904:
Error found and corrected, see my previous post.
@rosc:
If you do not feel like writing scripts to a commercial entity, that's your choice. But please refrain from making posts like the one above, as it really isn't helpful to anyone.