This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Logging *only* ops conversation?

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
p
papajohn
Voice
Posts: 3
Joined: Mon Jun 27, 2005 1:49 pm

Logging *only* ops conversation?

Post by papajohn »

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 :)
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

This should help point you in the right direction:

Code: Select all

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...
p
papajohn
Voice
Posts: 3
Joined: Mon Jun 27, 2005 1:49 pm

Post by papajohn »

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 :wink:
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

Code: Select all

set oplogfile "logs/chanop.log 
should have been

Code: Select all

set oplogfile "logs/chanop.log"
a better implementation is this one which creates a specific file per channel:

Code: Select all

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.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Next time, state what the error message was when your bot crashed. It crashed because DragonLord forgot to close the open-quote, so

Code: Select all

set oplogfile "logs/chanop.log
should be

Code: Select all

set oplogfile "logs/chanop.log"
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

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: Select all

set oplogfile "logs/chanop.log
should be

Code: Select all

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).
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

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.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

How to load scripts without crashing the bot

Post by rosc2112 »

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 =)
f
fayettemat
Voice
Posts: 27
Joined: Tue Jan 09, 2007 6:10 pm

Re: How to load scripts without crashing the bot

Post by fayettemat »

rosc2112 wrote: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 =)
amen you said it rosc!
p
papajohn
Voice
Posts: 3
Joined: Mon Jun 27, 2005 1:49 pm

Post by papajohn »

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 :)
Y
Younguns
Voice
Posts: 1
Joined: Wed Jan 16, 2008 7:43 am

Thanks

Post by Younguns »

Have been looking everywhere for a peice of code to explain how to use the timestamp feature....Thanks muchly DragnLord! :D

(Yes...I'm a newbie to tcl programming...lol)
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

hi:

and if i want log too conversations via /onotice ? :roll:
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

Nor7on wrote:hi:

and if i want log too conversations via /onotice ? :roll:
it is improper etiquette to have "conversations" via notice, use private messages instead
Post Reply