Advertisement
Guest User

Untitled

a guest
Jan 19th, 2019
381
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 2.31 KB | None | 0 0
  1. ######################################
  2. # THIS IS A WIP! ERRORS ARE EXPECTED #
  3. ######################################
  4.  
  5. #################
  6. # StatsMod Hack #
  7. #################
  8. #
  9. # This script is a way to provide tracking stats by nickname, while that function isn't on the module itself.
  10. # I've done it to personal use, so don't expect it to be a super script! :D
  11. # It's advisable to edit it to fit your needs
  12. # In order to use this script you have to do a few changes on your stats.conf. They're the following:
  13. ## set autoadd 0
  14. ## set use-eggdrop-userfile 1
  15. ## set anti-autoadd-flags "mnofvb-|mnofvb-"
  16. ## set anti-stats-flag "b|b"
  17. # Enjoy!
  18.  
  19. ### Configuration ###
  20. # How many minutes between each add user check?
  21. set checktime "5"
  22.  
  23. # List of badnicks that shouldn't be added
  24. set badnicks {Guest* *Serv Achmed Lily}
  25.  
  26. ### End of configuration ###
  27.  
  28. ### Binds ###
  29. # Adding users to the userfile
  30. bind cron - "*/$checktime * * * *" addstats
  31.  
  32. # Adding new nicks upon nick change to userfile
  33. bind nick - "*" addnew
  34. ### End of Binds ###
  35.  
  36. ### Procedures ###
  37. # Proc off adding nicks
  38. proc addstats {minute hour day month weekday} {
  39.     global badnicks botnick
  40.     foreach chan [channels] {
  41.         foreach user [chanlist $chan] {
  42.             if {![validuser $user]} {
  43.                 set isnick 0
  44.                 if {[lsearch $badnicks $user] >= 0 || [string match -nocase $user $botnick]} {
  45.                     set isnick 1
  46.                     break
  47.                 }
  48.                 #foreach check $badnicks {
  49.                 #   if {![string match -nocase "$check" $user]} {
  50.                 #       continue
  51.                 #   }
  52.                 #   if {[string match -nocase "$check" $user] || [string match -nocase $user $botnick]} {
  53.                 #       set isnick 1
  54.                 #       break
  55.                 #   }
  56.                 #}
  57.                 if {!$isnick} {
  58.                     adduser $user ${user}!*@*
  59.                 } else {
  60.                     return
  61.                 }
  62.             }
  63.         }
  64.     }
  65. }
  66.  
  67. # Proc off adding new nicks
  68. proc addnew {nick uhost hand chan newnick} {
  69.     global badnicks botnick
  70.     if {![validuser $newnick]} {
  71.         set isnick 0
  72.         foreach check $badnicks {
  73.             if {![string match -nocase "$check" $newnick]} {
  74.                 continue
  75.             }
  76.             if {[string match -nocase "$check" $newnick] || [string match -nocase $newnick $botnick]} {
  77.                 set isnick 1
  78.                 break
  79.             }
  80.         }
  81.         if {!$isnick} {
  82.             adduser $newnick ${newnick}!*@*
  83.         } else {
  84.             return
  85.         }
  86.     }
  87. }
  88. ### End of procedures ###
  89.  
  90. putlog "StatsMod Hack v0.3 loaded"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement