Advertisement
Guest User

@botcheck

a guest
Apr 30th, 2017
394
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.88 KB | None | 0 0
  1. //===== Hercules Script ======================================
  2. //= @botcheck atcmd
  3. //===== By ===================================================
  4. //= True Zeal
  5. //===== Description ==========================================
  6. //= Runs @whomap2 on a specified list of maps.
  7. //===== Comments =============================================
  8. //= Add maps to '.map$' array in OnInit label.
  9. //============================================================
  10.  
  11. -   script  Bot Check Command   FAKE_NPC,{
  12.  
  13. //----- Configuration -----
  14.  
  15. OnInit:
  16. // -----------------------------------------------------------
  17. //  Configuration settings.
  18. // -----------------------------------------------------------
  19.  
  20.     .@command_name$ = "botcheck";   // Sets the name of the @command (change 'botcheck' to your liking)
  21.     .gm_level = 20;                 // Sets the minimum GM level required to use command
  22.     .delay_level = 40;              // Sets the minimum GM level required to avoid usage delay
  23.     .delay_time = 15;               // Sets the delay time between usage (in seconds)
  24.  
  25.     //--- Sets the list of maps to run @whomap2 on
  26.     setarray(.map$[0],
  27.         "first_map_name",   // Note: Every entry excluding the last one must have a comma!
  28.         "second_map_name",
  29.         "last_map_name"     // Note: Last entry must never have a comma!
  30.     );
  31.  
  32.     bindatcmd("" + .@command_name$ + "", "Bot Check Command::OnAtCommand", gm_level);
  33.     end;
  34.  
  35. OnAtCommand:
  36.     if (#bot_chk_delay > gettimetick(2))
  37.     {
  38.         message(strcharinfo(PC_NAME),"Please wait a few more seconds before using the command again.");
  39.         end;
  40.     }
  41.  
  42.     message(strcharinfo(PC_NAME),"Running bot check...");
  43.     for (.@i = 0; .@i < getarraysize(.map$); ++.@i)
  44.     {
  45.         if (getmapusers("" + .map$[.@i] + ""))
  46.             atcommand("@whomap2 " + .map$[.@i] + "");
  47.         sleep2(30);
  48.     }
  49.  
  50.     sleep2(200);
  51.     message(strcharinfo(PC_NAME),"Bot check complete.");
  52.  
  53.     if (getgmlevel() < .delay_level)
  54.         #bot_chk_delay = gettimetick(2) + (.delay_time);
  55.     end;
  56.  
  57.  
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement