daily pastebin goal
48%
SHARE
TWEET

Userlist: v4.1

Seb May 7th, 2011 (edited) 285 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #########################
  2. #    Userlist System    #
  3. #     Version: 4.1      #
  4. # By: Sebastien         #
  5. # Mail: xplorer@live.ca #
  6. # Net: irc.undernet.org #
  7. # Chan: #mircscripting  #
  8. #########################
  9.  
  10. alias show.oplist {
  11.   if ($ini(database\ $+ # $+ .ini,opjoin,0) == $null) { echo -a 14[4AutoOp14] List Empty | halt }
  12.   var %o = 1
  13.   while (%o <= $ini(database\ $+ # $+ .ini,opjoin,0)) {
  14.     echo -a 14[4AutoOp14] $ini(database\ $+ # $+ .ini,opjoin,%o)
  15.     inc %o
  16.   }
  17. }
  18.  
  19.  
  20. alias show.voicelist {
  21.   if ($ini(database\ $+ # $+ .ini,voicejoin,0) == $null) { echo -a 14[4AutoVoice14] List Empty | halt }
  22.   var %v = 1
  23.   while (%v <= $ini(database\ $+ # $+ .ini,voicejoin,0)) {
  24.     echo -a 14[7AutoVoice14] $ini(database\ $+ # $+ .ini,opjoin,%v)
  25.     inc %v
  26.   }
  27. }
  28.  
  29. alias show.protectlist {
  30.   if ($ini(database\ $+ # $+ .ini,protect,0) == $null) { echo -a 14[3Protect14] List Empty | halt }
  31.   var %v = 1
  32.   while (%v <= $ini(database\ $+ # $+ .ini,protect,0)) {
  33.     echo -a 14[3Protect14] $ini(database\ $+ # $+ .ini,opjoin,%v)
  34.     inc %v
  35.   }
  36. }
  37.  
  38. alias show.botlist {
  39.   if ($ini(database\ $+ # $+ .ini,bot,0) == $null) { echo -a 14[12Bot14] List Empty | halt }
  40.   var %v = 1
  41.   while (%v <= $ini(database\ $+ # $+ .ini,bot,0)) {
  42.     echo -a 14[12Bot14] $ini(database\ $+ # $+ .ini,bot,%v)
  43.     inc %v
  44.   }
  45. }
  46.  
  47. on *:JOIN:#:{
  48.   if ($readini(database\ $+ $chan $+ .ini, suspend, $address($nick,2))) { msg $chan $+([,$nick,]) Is Suspended | halt }
  49.   if ($readini(database\ $+ $chan $+ .ini, infoline, $address($nick,2))) {
  50.     if ($nick == $me) { return }
  51.     msg $chan ( $+ $nick $+ ) $readini(database\ $+ $chan $+ .ini, infoline, $address($nick,2))
  52.   }
  53.   if ($readini(database\ $+ $chan $+ .ini, opjoin, $address($nick,2)) == 1) && ($readini(database\ $+ $chan $+ .ini, voicejoin, $address($nick,2)) == 1) {
  54.     .mode # +ov # $nick
  55.     halt
  56.   }
  57.   if ($readini(database\ $+ $chan $+ .ini, opjoin, $address($nick,2)) == 1) {
  58.     mode $chan +o $nick
  59.     halt
  60.   }
  61.   if ($readini(database\ $+ $chan $+ .ini, voicejoin, $address($nick,2)) == 1) {
  62.     mode $chan +v $nick
  63.     halt
  64.   }
  65. }
  66. on *:KICK:#:{
  67.   if ($readini(database\ $+ $chan $+ .ini, protect, $address($knick,2)) == 1) {
  68.     ban -k $chan $nick $knick is Protected! [Suspended: 1h]
  69.     writeini $+(database\,$chan,.ini) suspend $address($nick,2) 1
  70.     .timer 1 3600 remini $+(database\,$chan,.ini) suspend $address($nick,2) 1
  71.   }
  72. }
  73. on *:ban:#:{
  74.   if ($bnick == $nick) { halt }
  75.   if ($readini(database\ $+ $chan $+ .ini, protect, $address($bnick,2)) == 1) {
  76.     mode $chan -bo+b $banmask $nick $address($nick,2)
  77.     kick $chan $nick $bnick is Protected! [Suspended: 1h]
  78.     writeini $+(database\,$chan,.ini) suspend $address($nick,2) 1    
  79.     .timer 1 3600 remini $+(database\,$chan,.ini) suspend $address($nick,2) 1
  80.   }
  81. }
  82. on *:DEOP:#:{
  83.   if ($nick == $me) { halt }
  84.   if ($opnick == $nick) { halt }
  85.   if ($readini(database\ $+ $chan $+ .ini, keepop, $address($opnick,2)) == 1) {
  86.     mode $chan -o+o $nick $opnick
  87.     ;msg $chan $opnick has KeepOp Enabled
  88.   }
  89. }
  90.  
  91. on *:text:.who *:#:{
  92.   msg $chan Levels for $2 with this mask :: $address($2,2)
  93.   msg $chan $&
  94.     $iif($readini(database\ $+ $chan $+ .ini, manager, $address($2,2)),3+manager,4-manager) $&    
  95.     $iif($readini(database\ $+ $chan $+ .ini, infoline, $address($2,2)),3+infoline,4-infoline) $&    
  96.     $iif($readini(database\ $+ $chan $+ .ini, opjoin, $address($2,2)),3+autoop,4-autoop) $&    
  97.     $iif($readini(database\ $+ $chan $+ .ini, voicejoin, $address($2,2)),3+autovoice,4-autovoice) $&    
  98.     $iif($readini(database\ $+ $chan $+ .ini, keepop, $address($2,2)),3+keepop,4-keepop) $&    
  99.     $iif($readini(database\ $+ $chan $+ .ini, bot, $address($2,2)),3+bot,4-bot) $&
  100.     $iif($readini(database\ $+ $chan $+ .ini, protect, $address($2,2)),3+protect,4-protect) $&
  101.     $iif($readini(database\ $+ $chan $+ .ini, friendly, $address($2,2)),3+friendly,4-friendly) $&    
  102.     $iif($readini(database\ $+ $chan $+ .ini, suspend, $address($2,2)),3+suspend,4-suspend)    
  103.   $iif($readini(database\ $+ $chan $+ .ini, infoline, $address($2,2)),msg $chan Infoline: $readini(database\ $+ $chan $+ .ini, infoline, $address($2,2)),$null)
  104. }
  105.  
  106. alias show.levels {
  107.   echo -a command disabled for now
  108.   msg $chan Levels for $1 with this mask :: $address($1,2)
  109.   msg $chan $&
  110.     $iif($readini(database\ $+ $chan $+ .ini, manager, $address($1,2)),3+manager,4-manager) $&    
  111.     $iif($readini(database\ $+ $chan $+ .ini, infoline, $address($1,2)),3+infoline,4-infoline) $&    
  112.     $iif($readini(database\ $+ $chan $+ .ini, opjoin, $address($1,2)),3+autoop,4-autoop) $&    
  113.     $iif($readini(database\ $+ $chan $+ .ini, voicejoin, $address($1,2)),3+autovoice,4-autovoice) $&    
  114.     $iif($readini(database\ $+ $chan $+ .ini, keepop, $address($1,2)),3+keepop,4-keepop) $&    
  115.     $iif($readini(database\ $+ $chan $+ .ini, bot, $address($1,2)),3+bot,4-bot) $&
  116.     $iif($readini(database\ $+ $chan $+ .ini, protect, $address($1,2)),3+protect,4-protect)              
  117. }
  118.  
  119.  
  120. alias update.levels {
  121.   msg $2 Levels for $1 with this mask :: $address($1,2)
  122.   msg $2 $&
  123.     $iif($readini(database\ $+ $2 $+ .ini, manager, $address($1,2)),3+manager,4-manager) $&    
  124.     $iif($readini(database\ $+ $2 $+ .ini, infoline, $address($1,2)),3+infoline,4-infoline) $&    
  125.     $iif($readini(database\ $+ $2 $+ .ini, opjoin, $address($1,2)),3+autoop,4-autoop) $&    
  126.     $iif($readini(database\ $+ $2 $+ .ini, voicejoin, $address($1,2)),3+autovoice,4-autovoice) $&    
  127.     $iif($readini(database\ $+ $2 $+ .ini, keepop, $address($1,2)),3+keepop,4-keepop) $&    
  128.     $iif($readini(database\ $+ $2 $+ .ini, bot, $address($1,2)),3+bot,4-bot) $&
  129.     $iif($readini(database\ $+ $2 $+ .ini, protect, $address($1,2)),3+protect,4-protect) $&
  130.     $iif($readini(database\ $+ $2 $+ .ini, suspend, $address($2,2)),3+suspend,4-suspend)        
  131. }
  132.  
  133. alias cu.update {
  134.   if ($timershow) { halt }
  135.   set %dbupchan $chan
  136.   .timer $+ show 1 2 update.levels $1 %dbupchan
  137.   unset %dbupchan
  138. }
  139.  
  140. on *:TEXT:.mod *:#:{
  141.   if ($readini(database\ $+ $chan $+ .ini, manager, $address($nick,2)) !== 1) {
  142.     msg $chan you need manager level to use this command.
  143.     HALT
  144.   }
  145.   if ($readini(database\ $+ $chan $+ .ini, manager, $address($nick,2)) == 1) {
  146.     if (+bot isin $3-) { writeini $+(database\,$chan,.ini) bot $address($2,2) 1 | cu.update $2 }
  147.     if (+autoop isin $3-) { writeini $+(database\,$chan,.ini) opjoin $address($2,2) 1 | cu.update $2 | mode $chan +o $2 }
  148.     if (+autovoice isin $3-) { writeini $+(database\,$chan,.ini) voicejoin $address($2,2) 1 | cu.update $2 | mode $chan +v $2 }
  149.     if (+keepop isin $3-) { writeini $+(database\,$chan,.ini) keepop $address($2,2) 1 | cu.update $2 }
  150.     if (+protect isin $3-) { writeini $+(database\,$chan,.ini) protect $address($2,2) 1 | cu.update $2 }
  151.     if (+manager isin $3-) { writeini $+(database\,$chan,.ini) manager $address($2,2) 1 | cu.update $2 }
  152.     if (+suspend isin $3-) { writeini $+(database\,$chan,.ini) suspend $address($2,2) 1 | cu.update $2 }    
  153.     if (-bot isin $3-) { remini $+(database\,$chan,.ini) bot $address($2,2) | cu.update $2 }
  154.     if (-autoop isin $3-) { remini $+(database\,$chan,.ini) opjoin $address($2,2) | cu.update $2 | mode $chan -o $2 }
  155.     if (-autovoice isin $3-) { remini $+(database\,$chan,.ini) voicejoin $address($2,2) | cu.update $2 | mode $chan -v $2 }
  156.     if (-keepop isin $3-) { remini $+(database\,$chan,.ini) keepop $address($2,2) | cu.update $2 }
  157.     if (-protect isin $3-) { remini $+(database\,$chan,.ini) protect $address($2,2) | cu.update $2 }
  158.     if (-manager isin $3-) { remini $+(database\,$chan,.ini) manager $address($2,2) | cu.update $2 }
  159.     if (-suspend isin $3-) { remini $+(database\,$chan,.ini) suspend $address($2,2) 1 | cu.update $2 }    
  160.   }
  161. }
  162.  
  163. on *:text:+infoline *:#:{
  164.   writeini $+(database\,$chan,.ini) infoline $address($nick,2) $2-
  165.   .notice $nick Added infoline to $nick on $chan :: $2-
  166. }
  167. on *:text:-infoline:#:{
  168.   remini $+(database\,$chan,.ini) infoline $address($nick,2)
  169.   .notice $nick Removed infoline From $nick on $chan
  170. }
  171.  
  172. menu nicklist {
  173.   ~Userlist~
  174.   .Add
  175.   ..manager:writeini $+(database\,$chan,.ini) manager $address($$1,2) 1 | echo -a Added $$1 To manager level on $chan with this host: $address($$1,2) | mode $chan +o $$1
  176.   ..Op:writeini $+(database\,$chan,.ini) opjoin $address($$1,2) 1 | echo -a Added $$1 To Op list on $chan with this host: $address($$1,2) | mode $chan +o $$1
  177.   ..Voice:writeini $+(database\,$chan,.ini) voicejoin $address($$1,2) 1 | echo -a Added $$1 To Voice list on $chan with this host: $address($$1,2) | mode $chan +v $$1
  178.   ..KeepOp:writeini $+(database\,$chan,.ini) keepop $address($$1,2) 1 | echo -a Added $$1 To KeepOp list on $chan with this host: $address($$1,2) | mode $chan +o $$1
  179.   ..Protect:writeini $+(database\,$chan,.ini) protect $address($$1,2) 1 | echo -a Added $$1 To protect list on $chan with this host: $address($$1,2)
  180.   ..Bot:writeini $+(database\,$chan,.ini) bot $address($$1,2) 1 | writeini $+(database\,$chan,.ini) opjoin $address($$1,2) 1 | echo -a Added $$1 To Bot list on $chan with this host: $address($$1,2) | mode # +o $$1
  181.   .Remove
  182.   ..manager:remini $+(database\,$chan,.ini) manager $address($$1,2) | echo -a Removed $$1 From manager list on $chan with this host: $address($$1,2) | mode $chan -o $$1
  183.   ..Op:remini $+(database\,$chan,.ini) opjoin $address($$1,2) | echo -a Removed $$1 From Op list on $chan with this host: $address($$1,2) | mode $chan -o $$1
  184.   ..Voice:remini $+(database\,$chan,.ini) voicejoin $address($$1,2) | echo -a Removed $$1 From Voice list on $chan with this host: $address($$1,2) | mode $chan -v $$1  
  185.   ..KeepOp:remini $+(database\,$chan,.ini) KeepOp $address($$1,2) 1 | echo -a Removed $$1 From KeepOp list on $chan with this host: $address($$1,2)
  186.   ..Protect:remini $+(database\,$chan,.ini) protect $address($$1,2) 1 | echo -a Removed $$1 From protect list on $chan with this host: $address($$1,2)
  187.   ..Bot:remini $+(database\,$chan,.ini) bot $address($$1,2) 1 | echo -a Removed $$1 From Bot list on $chan with this host: $address($$1,2)
  188. }
  189.  
  190. menu channel {
  191.   ~Userlist~
  192.   .Show
  193.   ..Op:show.oplist
  194.   ..Voice:show.voicelist
  195.   ..Protect:show.protectlist
  196.   ..Bots:show.botlist  
  197. }
  198.  
  199. on *:LOAD:{ echo -a Userlist v3.4+client Succesfully loaded | mkdir database }
RAW Paste Data
Top