egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Logging *only* ops conversation?

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
papajohn
Voice


Joined: 27 Jun 2005
Posts: 3

PostPosted: Sat Mar 10, 2007 9:55 pm    Post subject: Logging *only* ops conversation? Reply with quote

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 Smile
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Sun Mar 11, 2007 1:44 am    Post subject: Reply with quote

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
View user's profile Send private message
papajohn
Voice


Joined: 27 Jun 2005
Posts: 3

PostPosted: Sun Mar 11, 2007 12:22 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Sun Mar 11, 2007 1:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Mar 11, 2007 1:20 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Sun Mar 11, 2007 1:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Mar 11, 2007 3:46 pm    Post subject: Reply with quote

I didn't notice your reply DragonLord, probably because I clicked reply but wrote the reply late and clicked submit Smile

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
View user's profile Send private message Visit poster's website
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sun Mar 11, 2007 5:38 pm    Post subject: How to load scripts without crashing the bot Reply with quote

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
View user's profile Send private message
fayettemat
Voice


Joined: 09 Jan 2007
Posts: 27

PostPosted: Sun Mar 11, 2007 9:35 pm    Post subject: Re: How to load scripts without crashing the bot Reply with quote

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!
Back to top
View user's profile Send private message
papajohn
Voice


Joined: 27 Jun 2005
Posts: 3

PostPosted: Sun Mar 11, 2007 9:42 pm    Post subject: Reply with quote

Beautiful Dragnlord Smile

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 Smile
Back to top
View user's profile Send private message
Younguns
Voice


Joined: 16 Jan 2008
Posts: 1

PostPosted: Wed Jan 16, 2008 7:46 am    Post subject: Thanks Reply with quote

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

(Yes...I'm a newbie to tcl programming...lol)
Back to top
View user's profile Send private message
Nor7on
Op


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Tue Jan 22, 2008 6:53 am    Post subject: Reply with quote

hi:

and if i want log too conversations via /onotice ? Rolling Eyes
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Wed Jan 23, 2008 6:07 am    Post subject: Reply with quote

Nor7on wrote:
hi:

and if i want log too conversations via /onotice ? Rolling Eyes

it is improper etiquette to have "conversations" via notice, use private messages instead
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber