| View previous topic :: View next topic |
| Author |
Message |
papajohn Voice
Joined: 27 Jun 2005 Posts: 3
|
Posted: Sat Mar 10, 2007 9:55 pm Post subject: Logging *only* ops conversation? |
|
|
Can I get a point in the right direction to accomplish this? Basically if i could get the bot to log only the conversation of folks flagged a certain way in the user list... Perhaps a script that does something like it, but needs tweaking in one direction or other. I'm not a total eggdrop newbie, but I haven't done much in the area of coding, and can't find much in the way of pre-fab scripts that would get me in the ballpark. Any help appreciated  |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Sun Mar 11, 2007 1:44 am Post subject: |
|
|
This should help point you in the right direction:
| Code: | set oplogfile "logs/chanop.log
bind pubm o|o * op:log
proc op:log { n u h c t } {
global oplogfile
if [isop $n $c] {
set oplog [open oplogfile a]
set timestamp [clock format [clock seconds]]
puts $oplog "$timestamp = $t"
close $oplog
}
} |
Warning: this was done at almost 1am and may have errors... |
|
| Back to top |
|
 |
papajohn Voice
Joined: 27 Jun 2005 Posts: 3
|
Posted: Sun Mar 11, 2007 12:22 pm Post subject: |
|
|
Maybe I need my nose rubbed in it. I put that as a .tcl file and ran it, crashed the bot. Told you I was not that experienced  |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Sun Mar 11, 2007 1:20 pm Post subject: |
|
|
| Code: | | set oplogfile "logs/chanop.log |
should have been
| Code: | | set oplogfile "logs/chanop.log" |
a better implementation is this one which creates a specific file per channel:
| Code: |
bind pubm o|o * op:log
proc op:log {n u h c t} {
if {[isop $n $c]} {
set oplogfile "logs/$c-chanops.log"
set oplog [open $oplogfile a]
set timestamp "[clock format [clock seconds]]"
puts $oplog "$timestamp = <$n> $t"
close $oplog
}
} |
For example, chanop log for channel #bots will be logs/#bots-chanops.log. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Mar 11, 2007 1:20 pm Post subject: |
|
|
Next time, state what the error message was when your bot crashed. It crashed because DragonLord forgot to close the open-quote, so
| Code: | | set oplogfile "logs/chanop.log |
should be
| Code: | | set oplogfile "logs/chanop.log" |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Sun Mar 11, 2007 1:32 pm Post subject: |
|
|
| Sir_Fz wrote: | Next time, state what the error message was when your bot crashed. It crashed because DragonLord forgot to close the open-quote, so
| Code: | | set oplogfile "logs/chanop.log |
should be
| Code: | | set oplogfile "logs/chanop.log" |
|
I think I posted that was the error.
However, the bot should not have crashed because of that (mine did not).
If the bot crashed on loading that script it may be in conflict with something else, so I changed the variables a little (made them internal to the procedure instead of global). |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Mar 11, 2007 3:46 pm Post subject: |
|
|
I didn't notice your reply DragonLord, probably because I clicked reply but wrote the reply late and clicked submit
Eggdrop will not run if there is such an error in a script, but it won't crash if the script is loaded when it's already running. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Sun Mar 11, 2007 5:38 pm Post subject: How to load scripts without crashing the bot |
|
|
Howto Never Crash Your Bot on Loading Scripts With Errors:
http://forum.egghelp.org/viewtopic.php?p=63899#63899
Maybe that should go into the next version of eggdrop =) |
|
| Back to top |
|
 |
fayettemat Voice
Joined: 09 Jan 2007 Posts: 27
|
Posted: Sun Mar 11, 2007 9:35 pm Post subject: Re: How to load scripts without crashing the bot |
|
|
amen you said it rosc! |
|
| Back to top |
|
 |
papajohn Voice
Joined: 27 Jun 2005 Posts: 3
|
Posted: Sun Mar 11, 2007 9:42 pm Post subject: |
|
|
Beautiful Dragnlord
I even figured out to make it record the flagged people (but don't necessarily have to be @ in the channel)
Thank you for the help  |
|
| Back to top |
|
 |
Younguns Voice
Joined: 16 Jan 2008 Posts: 1
|
Posted: Wed Jan 16, 2008 7:46 am Post subject: Thanks |
|
|
Have been looking everywhere for a peice of code to explain how to use the timestamp feature....Thanks muchly DragnLord!
(Yes...I'm a newbie to tcl programming...lol) |
|
| Back to top |
|
 |
Nor7on Op

Joined: 03 Mar 2007 Posts: 185 Location: Spain - Barcelona
|
Posted: Tue Jan 22, 2008 6:53 am Post subject: |
|
|
hi:
and if i want log too conversations via /onotice ?  |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Wed Jan 23, 2008 6:07 am Post subject: |
|
|
| Nor7on wrote: | hi:
and if i want log too conversations via /onotice ?  |
it is improper etiquette to have "conversations" via notice, use private messages instead |
|
| Back to top |
|
 |
|