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 

Quakenet chanstat

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


Joined: 26 Dec 2008
Posts: 205
Location: Quakenet, #Football

PostPosted: Sat Nov 13, 2010 3:38 pm    Post subject: Quakenet chanstat Reply with quote

hey, was wondering if anyone could make a script that will display Quakenet's Q stats results:

[21:33:29] -> *q* chanstat #channelname
[21:33:30] -Q- Statistics for #channelname:
-
[21:33:30] -Q- Date added: 04/12/08 16:20 GMT
-
[21:33:30] -Q- Since 04/12/08 16:20 GMT: maximum size 166, 116044 joins (163.7 joins/day).
-
[21:33:30] -Q- Since 04/12/08 16:20 GMT: maximum size 166, 116044 joins (163.7 joins/day).

Would be nice if that could be triggered to be displayed in a room.
Thanks
_________________
Idling at #Football, Quakenet.
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Mon Nov 15, 2010 8:34 pm    Post subject: Reply with quote

I dont use Quakenet, so I cant really help much with this one. However, it should be pretty straight forward to do all this with a few notc binds and pub bind. You will need to change a few things.
Code:
# bind the public command to trigger sending the chanstat message to Q
# NOTE: change ".chanstats" to the trigger you want
bind pub -|- ".chanstats" pub:qchanstats

proc pub:qchanstats {nick uhost hand chan text} {
 global qsc
  # send the message to Q
  #NOTE: you should change this to "Q@quakenet.org" or w/e youre server uses
  puthelp "PRIVMSG Q :chanstat $chan"
  # set this to send back to the requested channel
  set qsc(request) "$chan"
  # set the timer to remove the request after 120
  utimer 120 [list unset qsc(request)]
}

# bind all the notices we are 'echo'ing back to the channel
bind notc -|- "Statistics for*" notc:qchanstats
bind notc -|- "Date added*" notc:qchanstats
bind notc -|- "Since*" notc:qchanstats

# ignoring compatibility, change if you use an old version of eggdrop
proc notc:qchanstats {nick uhost hand text dest} {
 global qsc
  if {([info exists qsc(request)])&&([validchan $qsc(request)])} {
   # send the notice text to the channel
   puthelp "PRIVMSG $qsc(request) :[join [lrange [split $text] 0 end]]"
  }
}
hope it helps Smile
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
Football
Master


Joined: 26 Dec 2008
Posts: 205
Location: Quakenet, #Football

PostPosted: Fri Nov 19, 2010 10:25 am    Post subject: Reply with quote

Thanks TCL_NO_Talk! works great!

Code:

[16:22:03] <@Football> Statistics for #Football:
[16:22:05] <@Football> Date added: 04/06/10 20:13 GMT
[16:22:09] <@Football> Since 04/06/10 20:13 GMT: maximum size 15, 1209 joins (7.2 joins/day).
[16:22:11] <@Football> Since 04/06/10 20:13 GMT: maximum size 15, 1209 joins (7.2 joins/day).


Any chance the output could be edited?

What I mean is, the script itself will contain 3 different lines that can determine what the output would look like ("Operating Since:" for example) and then the info will be written in the end of the line?

That would be great..
_________________
Idling at #Football, Quakenet.
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Sun Nov 21, 2010 8:00 am    Post subject: Reply with quote

Exclamation sorry for late reply *work*

I wouldn't be able to say for sure, its really a case of
Code:
# ignoring compatibility, change if you use an old version of eggdrop
proc notc:qchanstats {nick uhost hand text dest} {
 global qsc
  if {([info exists qsc(request)])&&([validchan $qsc(request)])} {
   # send the notice text to the channel
   set full_line [join [lrange [split $text] 0 end]]
   # first line depending on what we recive it could be:
   # "Statistics", "Date" or "Since"
   set line_1 [lindex $text 0]
   # second line, could be:
   # "for", "added" or "04/06/10 20:13 GMT" (the date + time + timezone)
   set line_2 [lindex $text 1]
   # ...etc
   puthelp "PRIVMSG $qsc(request) :[join [lrange [split $text] 0 end]]"
  }
}
or easyer option would be just to split them up in to sep. binds,
so when
Code:
bind notc -|- "Statistics for*" notc:qcs:first
would go to a a proc named notc:qcs:first, and do that so you know what you will get from each one, sud make it easyer to change the text from each. So they dont all go to the same proc and you have to do alot of work.

Hopefully, that makes sense. if you need me to write a few more examples or piece together more of a script for it let me know.
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Sat Nov 27, 2010 9:35 am    Post subject: Reply with quote

Just use regexp to grab out the data you want to display, also the chanstat has two Since lines, the second line is a trip counter which can be reset, so it depends which Since line you want to use/display (or both).
_________________
r0t3n @ #r0t3n @ Quakenet
Back to top
View user's profile Send private message MSN Messenger
BigToe
Halfop


Joined: 30 Dec 2010
Posts: 99

PostPosted: Wed Mar 09, 2011 3:38 pm    Post subject: Reply with quote

Hi, current onput is:

Statistics for #channel:
Date added: 11/02/09 18:47 GMT
Since 11/02/09 18:47 GMT: maximum size 22, 9197 joins (12.2 joins/day).
Since 11/02/09 18:47 GMT: maximum size 22, 9197 joins (12.2 joins/day).

Can someone modify the code that will A. paste only one 'since' and B. add an option to rewrite the sentences

for example instead of

"Date added" - "Founded on:"...

Thanks
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