What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Auto Buff Help

JoeBobJr

Member
Joined
Oct 25, 2014
Messages
151
Reaction score
0
I'm trying to get into coding some of these plugins but having some issues. I'm trying something simple like buffing myself with Refreshment when the buff comes off and for some reason the code isn't working when I run the plugin it never does anything. Can someone tell me what I am doing wrong?

I've just been looking at other people's codes and going off them trying to figure it out. So one part of the code I don't understand is the buff time <= 2 I'm not sure what 2 is just seen it on another code and decided to use it and try it out.

Code:
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Threading;
using System.Collections.Generic;
using System.Linq;
using ArcheBuddy.Bot.Classes;

namespace DefaultNameSpace{
   public class DefaultClass : Core
   {
       public static string GetPluginAuthor()
       {
           return "JoeBobJr";
       }

       public static string GetPluginVersion()
       {
           return "1.0.0.0";
       }

       public static string GetPluginDescription()
       {
           return "Auto Buff: Defiler";
       }

       //Call on plugin start
       public void PluginRun()
       {         
           while (true){
               while (skillCooldown("Refreshment") == 0 && buffTime("Refreshment") <= 2) {
                Thread.Sleep (100); 
           }
            UseSkill ("Refreshment", false, true);
            Log("Buff Used: Refreshment");

       }
       //Call on plugin stop
       public void PluginStop()
       {
       }
       }
    }
}

I compiled in the Plugin Editor and then run the default.dll in the Manager and nothing happens it never buffs me.
 
I've noticed that it takes me from being AFK so its doing something. Maybe it's checking the buff but its not casting it. Maybe the UseSkill is wrong because if it wasn't doing anything at all it wouldn't bring me back out of AFK.
 
You need to add the level or use some more generic code like

me.getBuffs().Exists(b => b.name.StartsWith ("Refreshment"))
 
So I use that in my while loop to check if the buff exists?

Even if I use the rank in the name it still spams it. I can't seem to stop it. I've tried the code you provided also and still the same thing.

Code:
if (skillCooldown("Refreshment") == 0 && me.getBuffs().Exists(b => b.name.StartsWith ("Refreshment")))
                // Casting "Refreshment"
                {
                    UseSkill("Refreshment", true);
                    Log("Used: Refreshment");
                }

This code doesn't work as you suggested but the next code does work. So I'm not exactly sure how to use the code you provided if that is not correct.

Code:
if (skillCooldown("Refreshment") == 0 && buffTime("Refreshment (Rank 4)") <= 2)
                // Casting "Refreshment"
                {
                    UseSkill("Refreshment", true);
                    Log("Used: Refreshment");
                }

Both of those codes still spam the skill. It still doesn't work.
 
try this
if(buffTime("Refreshment") == 0 && skillCooldown("Refreshment") == 0)
UseSkillAndWait("Refreshment", true);
 
Try this one:

Code:
        public void PluginRun()
        {
            while(true)
            {
                // AutoBuff Refreshment
                if (buffTime(53) == 0 && buffTime(331) == 0 && buffTime(332) == 0 && buffTime(333) == 0 && buffTime(334) == 0 && buffTime(794) == 0 && buffTime(795) == 0 && buffTime(796) == 0 && buffTime(7655) == 0 && skillCooldown(10645) == 0))
                   UseSkill(10645, false, true); //Refreshment

                Thread.Sleep(100);
            }
        }
 
Try this one:

Code:
        public void PluginRun()
        {
            while(true)
            {
                // AutoBuff Refreshment
                if (buffTime(53) == 0 && buffTime(331) == 0 && buffTime(332) == 0 && buffTime(333) == 0 && buffTime(334) == 0 && buffTime(794) == 0 && buffTime(795) == 0 && buffTime(796) == 0 && buffTime(7655) == 0 && skillCooldown(10645) == 0))
                   UseSkill(10645, false, true); //Refreshment

                Thread.Sleep(100);
            }
        }

That looks like a whole bunch of non sense just to pop a buff. There has to be an easier way.
 
It is basically from the Quest plugin, and there it works ...
Checks all possible ranks of the buff by id, so this is not non sense.

Probably also this will work and is a lot shorter:
if (me.getBuffs().Exists(b => b.name.StartsWith ("Refreshment") && skillCooldown(10645) == 0)
 
I am also looking for similar code. Is there a way to automatically rebuff myself instantly as soon as I have a buff purged off. So for example if it is my "Purge" magic defense buff and it gets purged off can a mod instantly rebuff myself? Anyone know how to write this?

I would be willing to paypal someone to simply write me this plugin that re-applies a buff as soon as it is purged off of me in Gladiator arena.
 
Last edited:
Back
Top