Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.95 KB | None | 0 0
  1. using System;
  2. using System.Windows.Forms;
  3. using System.Threading;
  4. using System.Collections.Generic;
  5. using ArcheBuddy.Bot.Classes;
  6.  
  7. namespace YourNamespace
  8. {
  9.     public class YourClass : Core
  10.     {  
  11.         bool doBarding        = true;               // Run and loot corpses.  
  12.         bool doLoot           = false;               // Run and loot corpses.        
  13.         bool diceLoot         = true;               // Dice mode selection. It will roll if true and won't if false.
  14.         bool doLogs           = true;               // Logging for debug purposes.
  15.         Random randomRollTime = new Random();        
  16. ////////////////////////////////////////////////////////
  17. //////// MAINLOOP
  18. ////////////////////////////////////////////////////////    
  19.         public void PluginRun()
  20.         {      
  21.              
  22.             onLootDice += on_RollDice;
  23.             while(true)
  24.             {    
  25.                 if (me.isAlive())
  26.                 {
  27.                     BardSkillRotation();  
  28.                     LootAround();
  29.                    
  30.                 }
  31.                 Thread.Sleep (500);
  32.             }      
  33.         }
  34. ////////////////////////////////////////////////////////
  35. //////// Debug
  36. ////////////////////////////////////////////////////////  
  37.         public void DebugLog(string Logger_string)
  38.         {
  39.             if (doLogs == true)  
  40.             {
  41.                Log(Logger_string);
  42.             }
  43.         }  
  44. ////////////////////////////////////////////////////////
  45. //////// STOP
  46. ////////////////////////////////////////////////////////    
  47.         public void PluginStop()
  48.         {  
  49.             //onLootDice -= on_RollDice;    
  50.             DebugLog("Bard skill rotation has been stopped.");
  51.         }  
  52. ////////////////////////////////////////////////////////
  53. //////// CheckBuffCastBuff
  54. ////////////////////////////////////////////////////////  
  55.         public void CheckBuffCastBuff(string Buffname, string Buffspell)
  56.         {
  57.             if (buffTime(Buffname) == 0)  
  58.             {
  59.                 UseSkillAndWait(Buffspell);
  60.                 Thread.Sleep (500);
  61.             }
  62.         }          
  63. ////////////////////////////////////////////////////////
  64. //////// BARD SKILL ROTATION
  65. ////////////////////////////////////////////////////////            
  66.         public void BardSkillRotation()
  67.         {
  68.          if (doBarding == true)  
  69.             {
  70.                 CheckBuffCastBuff(Гимн земли II, Гимн земли);
  71.                 CheckBuffCastBuff(Рапсодия битвы I, Гимн земли);
  72.                 CheckBuffCastBuff(Песнь исцеления III, Песнь исцеления);
  73.                 CheckBuffCastBuff(Походный марш V, Походный марш);
  74.             }
  75.         }    
  76. ////////////////////////////////////////////////////////
  77. //////// Loot
  78. ////////////////////////////////////////////////////////  
  79.         public void LootAround()
  80.         {
  81.             if (doLoot == true)    
  82.             {        
  83.                 foreach (var corps in getCreatures())
  84.                 {
  85.                     if (corps.dropAvailable && me.dist(corps) <= 20)
  86.                     {
  87.                         if (me.dist(corps) <= 2)
  88.                         {
  89.                             PickupAllDrop(corps);
  90.                         }
  91.                         else
  92.                         {
  93.                             ComeTo(corps, 2);
  94.                             PickupAllDrop(corps);
  95.                         }
  96.                     }
  97.                     Thread.Sleep(100);
  98.                 }    
  99.             }
  100.         }  
  101. ////////////////////////////////////////////////////////
  102. //////// RollDice
  103. ////////////////////////////////////////////////////////          
  104.         public void on_RollDice(Item item)
  105.         {
  106.             if (diceLoot == true)
  107.             {
  108.                 Thread.Sleep(randomRollTime.Next(1000, 2500));
  109.  
  110.                 DebugLog("Rolling on item: " + item.name);
  111.                 item.Dice(true);
  112.             }
  113.             else
  114.             {
  115.                 Thread.Sleep(randomRollTime.Next(1000, 2500));    
  116.                 DebugLog("Declining on item: " + item.name);
  117.                 item.Dice(false);
  118.             }
  119.         }
  120. ////////////////////////////////////////////////////////
  121. //////// UseSkill
  122. ////////////////////////////////////////////////////////            
  123.         public void UseSkillAndWait(string skillName, bool selfTarget = false)
  124.         {
  125.             while (me.isCasting || me.isGlobalCooldown)
  126.             {
  127.                 Thread.Sleep(50);
  128.             }              
  129.             if (!UseSkill(skillName, false, selfTarget))
  130.             {
  131.                 while (me.isCasting || me.isGlobalCooldown)
  132.                 {
  133.                     Thread.Sleep(50);
  134.                 }
  135.             }
  136.             else
  137.                 DebugLog(": Used ->" +skillName);
  138.         }
  139.     }
  140. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement