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.

Quakenet chanstat

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Quakenet chanstat

Post by Football »

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.
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

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

# 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 :)
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Post by Football »

Thanks TCL_NO_Talk! works great!

Code: Select all

[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.
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

:!: sorry for late reply *work*

I wouldn't be able to say for sure, its really a case of

Code: Select all

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

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.
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

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
B
BigToe
Halfop
Posts: 99
Joined: Thu Dec 30, 2010 4:49 pm

Post by BigToe »

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
Post Reply