Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Windows.Forms;
- using System.Threading;
- using System.Collections.Generic;
- using ArcheBuddy.Bot.Classes;
- namespace YourNamespace
- {
- public class YourClass : Core
- {
- bool doBarding = true; // Run and loot corpses.
- bool doLoot = false; // Run and loot corpses.
- bool diceLoot = true; // Dice mode selection. It will roll if true and won't if false.
- bool doLogs = true; // Logging for debug purposes.
- Random randomRollTime = new Random();
- ////////////////////////////////////////////////////////
- //////// MAINLOOP
- ////////////////////////////////////////////////////////
- public void PluginRun()
- {
- onLootDice += on_RollDice;
- while(true)
- {
- if (me.isAlive())
- {
- BardSkillRotation();
- LootAround();
- }
- Thread.Sleep (500);
- }
- }
- ////////////////////////////////////////////////////////
- //////// Debug
- ////////////////////////////////////////////////////////
- public void DebugLog(string Logger_string)
- {
- if (doLogs == true)
- {
- Log(Logger_string);
- }
- }
- ////////////////////////////////////////////////////////
- //////// STOP
- ////////////////////////////////////////////////////////
- public void PluginStop()
- {
- //onLootDice -= on_RollDice;
- DebugLog("Bard skill rotation has been stopped.");
- }
- ////////////////////////////////////////////////////////
- //////// CheckBuffCastBuff
- ////////////////////////////////////////////////////////
- public void CheckBuffCastBuff(string Buffname, string Buffspell)
- {
- if (buffTime(Buffname) == 0)
- {
- UseSkillAndWait(Buffspell);
- Thread.Sleep (500);
- }
- }
- ////////////////////////////////////////////////////////
- //////// BARD SKILL ROTATION
- ////////////////////////////////////////////////////////
- public void BardSkillRotation()
- {
- if (doBarding == true)
- {
- CheckBuffCastBuff(Гимн земли II, Гимн земли);
- CheckBuffCastBuff(Рапсодия битвы I, Гимн земли);
- CheckBuffCastBuff(Песнь исцеления III, Песнь исцеления);
- CheckBuffCastBuff(Походный марш V, Походный марш);
- }
- }
- ////////////////////////////////////////////////////////
- //////// Loot
- ////////////////////////////////////////////////////////
- public void LootAround()
- {
- if (doLoot == true)
- {
- foreach (var corps in getCreatures())
- {
- if (corps.dropAvailable && me.dist(corps) <= 20)
- {
- if (me.dist(corps) <= 2)
- {
- PickupAllDrop(corps);
- }
- else
- {
- ComeTo(corps, 2);
- PickupAllDrop(corps);
- }
- }
- Thread.Sleep(100);
- }
- }
- }
- ////////////////////////////////////////////////////////
- //////// RollDice
- ////////////////////////////////////////////////////////
- public void on_RollDice(Item item)
- {
- if (diceLoot == true)
- {
- Thread.Sleep(randomRollTime.Next(1000, 2500));
- DebugLog("Rolling on item: " + item.name);
- item.Dice(true);
- }
- else
- {
- Thread.Sleep(randomRollTime.Next(1000, 2500));
- DebugLog("Declining on item: " + item.name);
- item.Dice(false);
- }
- }
- ////////////////////////////////////////////////////////
- //////// UseSkill
- ////////////////////////////////////////////////////////
- public void UseSkillAndWait(string skillName, bool selfTarget = false)
- {
- while (me.isCasting || me.isGlobalCooldown)
- {
- Thread.Sleep(50);
- }
- if (!UseSkill(skillName, false, selfTarget))
- {
- while (me.isCasting || me.isGlobalCooldown)
- {
- Thread.Sleep(50);
- }
- }
- else
- DebugLog(": Used ->" +skillName);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement