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

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Help on writing a plugin.

Majik01

New Member
Joined
Jan 16, 2013
Messages
99
OK very new to programming here, I wanted to see if I could write a very basic plugin to auto loot when combat ends. I'm using Twists Template (Thanks Twist) but cant seem to find out where to look, any help would be awesome, Is there a resource I can look at to show me commands I can use?

I'm thinking it needs to be something like

Code:
if (Me.Combat.Ends)
return SendKeys.Send("-")

- is my Vacuum key.
 
All the public API can be viewed with an object browser if you reference Wildbuddy.exe and it's DLLs.

Code:
if (!GameManager.LocalPlayer.IsInCombat && GameManager.CanVacuum)
    CommonBehaviors.VacuumLoot();
 
How did I guess you would be the one to answer, Thanks, ill let you know how I get on.
 
Any recommendations on a free or cheap Object Browser. Do I need to get Visual Studio, and if so what version do I need? I downloaded the free one VS Code, but it didn't include an object browser.

I tried to access the Wildbuddy.exe in .NET Reflector but it just caused an overflow error (maybe too large?)

Maybe this is to complex for me, but I like trying new things.
 
VS C# Express would work well enough! There's an informative guide on setting up your IDE for Wildbuddy somewhere in the Dev section you should look at!
 
Still working on this, gonna look for vid on using object browser, have VS 2013, but couldn't find any references to vacuum in any of the dll's in Willdbuddy folder.

Death if I want to use the code u posted for not in combat would I just need to remove the in combat line?

Like:
Code:
if (!GameManager.CanVacuum)
    CommonBehaviors.VacuumLoot();

also doesn't it need a return before the execute command? I understand "If Then" statements from other code, not sure if it similar to that.

I did finally got the Plugin to show in Bot list, but atm it doesn't do anything. will keep working ion it. I realize its a simple plugin, but we all have to start somewhere.
 
Last edited:
Notice the !, which means 'not'.

GameManager.LocalPlayer.IsInCombat = true if you are in combat, false if you are not in combat.
!GameManager.LocalPlayer.IsInCombat = false if you are in combat, true if you are not in combat.


Code:
// Your suggested implementation.
if (!GameManager.CanVacuum)
    CommonBehaviors.VacuumLoot();

// will vacuum loot any time it's unable to vacuum loot. Not very effective.
Code:
// Without the NOT
if (GameManager.CanVacuum)
    CommonBehaviors.VacuumLoot();

// will vacuum loot any time it can vacuum loot, including in combat.
Code:
// Without the NOT AND with a NOT in combat.
if (GameManager.CanVacuum && !GameManager.LocalPlayer.IsInCombat)
    CommonBehaviors.VacuumLoot();

// will vacuum loot any time it can vacuum loot, and only if it's NOT in combat.

as for 'return' keywords, they are used to pass a variable back up one level, or to break out of a void method. Since the plugin Pulse() is a void method itself, any 'return;' used will simply stop execution of the method at that point, and return to the pulsator to move onto the next pulse.

It's good for things like:

Code:
if (GameManager.Me.IsInCombat)
    return;

Because it'll effectively stop the plugin from acting any time it's in combat, as it'll be returned through that block of code.

Placing a return keyword before the 'execute command' which I assume you mean as 'VacuumLoot() would simply and effectively stop it from vacuum looting in all cases.
 
Back
Top