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 

Statistics.tcl by perpleXa (the pubm problem)

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Sun Jan 18, 2009 5:36 pm    Post subject: Statistics.tcl by perpleXa (the pubm problem) Reply with quote

Hello,
I hope this is the right place for this.

This is about Statistics.tcl by perplexa.
Can be found here: http://www.egghelp.org/cgi-bin/tcl_archive.tcl?mode=download&id=1079


Discovered that scripts can cause channel monitoring via console with +p flag, and channel logging of all traffic with the +p flag, can be interferred with (stopped) by some scripts.

I do not know .tcl scripting myself.

Inititally found mention of the problem here: http://forum.egghelp.org/viewtopic.php?t=12824&highlight=logging+channel+message
see the post(s) by nml375 Posted: Tue Dec 12, 2006

I found that xchannel will cause it.

Then, stumbled into some help with it here:
http://forum.egghelp.org/viewtopic.php?p=86959#86959
I'd actually given up on it, since I can't work on it myself.
This was sort of accidental in this thread. (much thanks to "user"!")

Now I have discovered the same problem again, with Statistics.tcl by perplexa.
If I simply shut it off via .chanset, then console viewing of the channel traffic returns. I'm sure it is the Statistics.tcl script.

Would anyone that knows .tcl be able to look at the Statistics script and let me know if it is fixable (without causing other problems) ?
and if so, how and where to edit it?

Thanks
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Mon Jan 19, 2009 8:21 pm    Post subject: Reply with quote

Code:
if {(![channel get $channel stat])} {
   return 0
}

Basically, if the channel isn't set +stat a return of 0 is issued. This is the problem with returning values (in this case a zero, 0) from procedures that are triggered by binds. Change it to merely a 'return'. And by the looks of skimming through that script, every single 'return 0' can be changed safely to 'return'. This should undo the "trapping" the script was doing.
_________________
speechles' eggdrop tcl archive
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Tue Jan 20, 2009 11:42 am    Post subject: Reply with quote

speechles wrote:
Code:
if {(![channel get $channel stat])} {
   return 0
}

Basically, if the channel isn't set +stat a return of 0 is issued. This is the problem with returning values (in this case a zero, 0) from procedures that are triggered by binds. Change it to merely a 'return'. And by the looks of skimming through that script, every single 'return 0' can be changed safely to 'return'. This should undo the "trapping" the script was doing.


Thank you for replying.

I am a bit confused though. From what I previously read here:
http://forum.egghelp.org/viewtopic.php?p=86959#86959
"return 0" IS what is needed.

But, as an experiment anyway, I have tried what you suggested.
I edited the .tcl script.
Text searched for 'return 0' , and changed every instance to simply 'return' .

Loaded bot.
With .chanset -stat , +p in console and I can monitor traffic in the channel, same as before.
With .chanset +stat , and still +p in console, I cannot... same as before

In other words, no change. Sad Editing the 'return 0' instances to 'return' did not fix it.

I do appreciate your time in this though. Or anyone else that can comment here and help, as I'd like to get this script fixed.

Do you (or anyone else) have further suggestions for me to try next?

Thanks
Back to top
View user's profile Send private message
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Wed Jan 21, 2009 10:44 am    Post subject: Reply with quote

tcl-commands.doc:
Code:
    (6)  PUBM (stackable)
         bind pubm <flags> <mask> <proc>
         procname <nick> <user@host> <handle> <channel> <text>

         Description: just like MSGM, except it's triggered by things said
           on a channel instead of things /msg'd to the bot. The mask is
           matched against the channel name followed by the text and can
|          contain wildcards. If the proc returns 1, Eggdrop will not log
|          the message that triggered this bind.

Returning 0 is the right thing to do. There must be some procs returning something else... What commands are not being logged? Try all commands, note which ones prevent logging, look up the bind (in the top of the script), find the proc triggered by the bind and take a look at the end of the proc (if you don't invoke "return", the value returned by the last command invoked will be returned - which can be pretty unpredictable in some cases)
_________________
Have you ever read "The Manual"?
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Wed Jan 21, 2009 12:04 pm    Post subject: Reply with quote

user wrote:
tcl-commands.doc:
Code:
    (6)  PUBM (stackable)
         bind pubm <flags> <mask> <proc>
         procname <nick> <user@host> <handle> <channel> <text>

         Description: just like MSGM, except it's triggered by things said
           on a channel instead of things /msg'd to the bot. The mask is
           matched against the channel name followed by the text and can
|          contain wildcards. If the proc returns 1, Eggdrop will not log
|          the message that triggered this bind.

Returning 0 is the right thing to do. There must be some procs returning something else... What commands are not being logged? Try all commands, note which ones prevent logging, look up the bind (in the top of the script), find the proc triggered by the bind and take a look at the end of the proc (if you don't invoke "return", the value returned by the last command invoked will be returned - which can be pretty unpredictable in some cases)


Thank you for the reply.

Commands not being logged? I don't understand the question. Sorry.

Perhaps I've not explained the problem and symptoms.
I have a script that I want to use.
When I enable it, logging of regular messages in the channel to the channel log ceases.
Further, I can no longer see regular channel messages from within the partyline.
For channel logging, I do have the +p flag set
For channel monitoring via the partyline, I do have the +p flag set in console.
Both channel monitoring and logging work, when that script is disabled.
Both stop as soon as the script is enabled.
It is not that some commands are not being logged... EVERYTHING is not being logged.

The script in question is already mentioned in my first post. I didn't think I should try to post the whole script in here.
Should I?


I did find this, in the top of the script:
Code:

bind PUB   -|-  ${trigger}stat   [namespace current]::spew
  bind PUB   -|-  ${trigger}top10  [namespace current]::toplist
  bind PUB   -|-  ${trigger}top20  [namespace current]::toplist
  bind PUBM  -|-  *                [namespace current]::monitor
  bind CTCP  -|-  ACTION           [namespace current]::ctcp
  bind EVNT  -|-  save             [namespace current]::save
  bind TIME  -|-  {00 * * * *}     [namespace current]::cleanupdb


if that has meaning to you.
I can see what you mentioned... the bind PUBM part , but I don't know what to do with it or how to interpret it. Sorry.
Does the asterisk mean that this script reacts to everything? (sorry if that sounds dumb)

Regarding the proc s throughout the rest of the script, I do see that some of them include a line "return 0" at the end of them.

But some do not.
Some seem to have specific values in the "return".
Could a "return 0" be added as the last line in the proc , without upsetting the operation of the script?

Text searching the script for "return" and ignoring all the "return 0" found,
I find:

Code:

    return "\[Top$number $type - No valuable information available for \002$channel\002\]"

and

return $output

and

return $killed

and

return $i

and

return $num\.0

and

return [expr {($secondary == 10) ? ($primary+1.0) : "$primary.$secondary"}]


at various places in the script


I guess you'd have to look at the script... I'm not doing a very good job of explaining it, I'm afraid.


Thank you for looking at this with me.
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 Support & Releases 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