eggdrop-pisg.tcl 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #pisg.tcl v0.15 by HM2K - auto stats script for pisg (perl irc statistics generator)
  2. #based on a script by Arganan
  3. # WARNING - READ THIS
  4. #
  5. # If you use this script, PLEASE read the documentation about the "Silent"
  6. # option. If you get the message "an error occured: Pisg v0.** - perl irc
  7. # statistics generator" in the channel, you are NOT running silent. Fix it.
  8. set pisgver "0.16"
  9. #Location of pisg execuitable perl script
  10. set pisgexe "/home/bot/pisg-0.73/pisg"
  11. #URL of the generated stats
  12. set pisgurl "http://nemesisforce.com/ircstats"
  13. #channel that the stats are generated for
  14. set pisgchan "#pisg"
  15. #Users with these flags can operate this function (friendly/friends by default)
  16. set pisgflags "f"
  17. #How often the stats will be updated in minutes, ie: 30 - stats will be updated every 30 minutes
  18. set pisgtime "180"
  19. bind pub $pisgflags !pisgstats pub:pisgcmd1
  20. proc pub:pisgcmd1 {nick host hand chan arg} {
  21. global pisgexe pisgurl
  22. append out "PRIVMSG $chan :"
  23. if {[catch {exec $pisgexe} error]} {
  24. append out "$pisgexe an error occured: [string totitle $error]"
  25. } else {
  26. append out "Stats: [string tolower ${pisgurl}[string trimleft $chan # ].html]"
  27. }
  28. puthelp $out
  29. }
  30. proc pisgcmd_timer {} {
  31. global pisgexe pisgurl pisgtime chan
  32. append out "PRIVMSG gchan :"
  33. if {[catch {exec $pisgexe} error]} {
  34. append out "$pisgexe an error occured: [string totitle $error]"
  35. } else {
  36. append out "Stats: [string tolower ${pisgurl}[string trimleft $chan # ].html]"
  37. }
  38. puthelp $out
  39. timer $pisgtime pisgcmd_timer
  40. }
  41. if {![info exists {pisgset}]} {
  42. set pisgset 1
  43. timer 2 pisgcmd_timer
  44. }
  45. putlog "pisg.tcl $pisgver loaded"