Bukz

Auto-ignore with "whitelists"

Jul 16th, 2011
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.41 KB | None | 0 0
  1. clanTagsToExclude = "DES| {TyD} B} |BC|"    // Add as many clan tags to exclude from auto-ignoring as you'd like.
  2. namesToExclude    = "Brahma makkE flowtron" // Add as many names to exclude from auto-ignoring as you'd like.
  3.  
  4. timeBetIgnoreChecks = 1000 // The number of milliseconds between every check. Increase this number if you experience performance problems.
  5.  
  6. if (! (checkalias autoignoreall)) [ autoignoreall = 1 ]
  7.  
  8. isExcludedClient = [
  9.   bool = 0
  10.   loop ai (listlen $clanTagsToExclude) [
  11.     if (strstr (findpn $arg1) (at $clanTagsToExclude $ai)) [ bool = 1 ]
  12.   ]
  13.   loop bi (listlen $namesToExclude) [
  14.     if (strcmp (findpn $arg1) (at $namesToExclude $bi)) [ bool = 1 ]
  15.   ]
  16.   result $bool
  17. ]
  18.  
  19. ignoreAllClients = [
  20.   if $autoignoreall [
  21.     loop ci 21 [
  22.       if (! (isExcludedClient $ci)) [ ignore $ci ]
  23.     ]
  24.     sleep $timeBetIgnoreChecks ignoreAllClients
  25.   ]
  26. ]
  27.  
  28. if (! (checkalias mapstartalways)) [ mapstartalways = "" ]
  29. if (! (strstr $mapstartalways ignoreAllClients)) [ add2alias mapstartalways [ if $connected ignoreAllClients ] ]
  30.  
  31. // Uncomment (remove the beginning "//") the line below, and edit "KEY" to the key of your choice, to enable a "toggle bind" for the script. (e.g. Press the bind to disable, press again to enable.)
  32. // bind KEY [ if $autoignoreall [ autoignoreall = 0; echo (c 2)Auto-ignore all script (c 3)disabled ] [ autoignoreall = 1; echo (c 2)Auto-ignore all script (c 0)enabled ] ]
Advertisement
Add Comment
Please, Sign In to add comment