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

[Plugin] IDK sorry

HB0916H38

Member
Joined
May 15, 2011
Messages
95
Reaction score
0
PHP:
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Threading;
using System.Windows;
using System.Windows.Forms;
using System.Xml;
using System.Xml.Linq;
using System.Xml.XPath;
using Zeta;
using Zeta.Common;
using Zeta.CommonBot;
using Zeta.Common.Plugins;
using Zeta.Internals;
using Zeta.Internals.Actors;
using Zeta.Internals.Service;
using Action = System.Action;

//Created by: w3eZle
//Credit to: eax (http://www.thebuddyforum.com/members/144149-eax.html) No1KnowsY (http://www.thebuddyforum.com/members/11607-no1knowsy.html)
//Based script on these guys work
//Created Date: 12June2012

namespace Sarkoth
{
    public class Sarkoth : IPlugin
    {
        private bool IsRestarting { get; set; }
        private List<Vector3> LoggedPositions { get; set; }

        public Version Version { get { return new Version(0, 1); } }
        public string Author { get { return "Mduhb"; } }
        public string Description { get { return "Disable KillMonsters unless in DankCellar."; } }
        public string Name { get { return "Sarkoth Kill Wait v" + Version; } }
        public Window DisplayWindow
        {
            get
            {
                return null;
            }
        }

        private void Log(string message)
        {
            Logging.Write(string.Format("[{0}] {1}", Name, message));
        }


        public void OnInitialize()
        {
            LoggedPositions = new List<Vector3>();
            IsRestarting = false;
        }


        public void OnPulse()
        {
            /*
            var porra = ZetaDia.Actors.GetActorsOfType<DiaObject>().Where(u => u.ActorSNO == 112245);
            
            foreach (var a in ZetaDia.Actors.GetActorsOfType<DiaObject>())
            {
               //Log(a.Distance.ToString());
            }
            */
            // if we're not in game and not in the process of restarting, do nothing
            if (!ZetaDia.IsInGame || !ZetaDia.Me.IsValid || IsRestarting)
            {
                LoggedPositions.Clear();
                return;
            }

            //Logging.Write("Checando Tempo: {0}", LoggedPositions.Count());
            /*
            if (LoggedPositions.Count > 20)
            {
                if (porra.Count() == 0)
                {
                    //ZetaDia.Me.UseTownPortal();
                    //Thread.Sleep(7000);
                    //Zeta.CommonBot.Profile.Common.LeaveGameTag;
                }
            }
            */

               if (ZetaDia.Actors.Me.HitpointsCurrentPct < 0.60 && ProfileManager.CurrentProfile.KillMonsters == false)
            {
                Log("Turning on KillMonsters -Health to low");
                ProfileManager.CurrentProfile.KillMonsters = true;
                return;
            }
    
            //Outside of DankC ellar, Diable Kill Monsters

            if (ZetaDia.Actors.Me.HitpointsCurrentPct > 0.60 && ProfileManager.CurrentProfile.KillMonsters == true && ZetaDia.CurrentWorldDynamicId == 1999503360)
            {
                Log("Disabeling KillMonsters & PickupLoot");
                ProfileManager.CurrentProfile.KillMonsters = false;
                ProfileManager.CurrentProfile.PickupLoot = false;
                return;
            }



            //Inside of Dank Cellar, Enable Kill Monsters
            if (ProfileManager.CurrentProfile.KillMonsters == false && ZetaDia.CurrentWorldDynamicId == 1999568897)
            {
                Verificando();
                Log("Enabeling KillMonsters & PickupLoot");
                ProfileManager.CurrentProfile.KillMonsters = true;
                ProfileManager.CurrentProfile.PickupLoot = true;
                return;
            }
        }

        public void Verificando()
        {
            var mobs = ZetaDia.Actors.GetActorsOfType<DiaUnit>().Where(u => u.IsAttackable);
            var items = ZetaDia.Actors.GetActorsOfType<DiaItem>().Where(u => u.IsValid);

            Logging.Write("Mobs: {0}", mobs.Count());
            Logging.Write("Item: {0}", items.Count());

            if (mobs.Count() == 0)
            {
                if (items.Count() <= 3)
                {
                    ZetaDia.Me.UseTownPortal();
                }
            }
        }


        public void OnShutdown()
        {
        }

        public void OnEnabled()
        {
            Logging.Write("Enabled.");
        }

        public void OnDisabled()
        {
            Logging.Write("Disabled.");
        }

        public bool Equals(IPlugin other)
        {
            return (other.Name == Name) && (other.Version == Version);
        }

    }

}
 
Where do people find the Libraries with functions/parameters etc like
ProfileManager.CurrentProfile.PickupLoot, ProfileManager.CurrentProfile.KillMonsters
I can't seem to find any information about it :S
 
Lol, you didn't need to credit me.
I don't see anything in there that is "mine"...

But hey, at least you put in credits :)
 
Where do people find the Libraries with functions/parameters etc like
ProfileManager.CurrentProfile.PickupLoot, ProfileManager.CurrentProfile.KillMonsters
I can't seem to find any information about it :S
Or you can just use Visual Studio and add Demonbuddy.exe as a reference :/
Works a lot better that way.

haha - I don't think he follows ya :P
Meh, not my cup o' tea.
 
1. in visual studio open up a class project
2. right click on references
3. click add reference
4. navigate to the demonbuddy exe
5. click demonbuddy.exe
6. click add
7. right click the added reference
8. click view in object explorer
9. RTFM and profit

That is all
 
1. in visual studio open up a class project
2. right click on references
3. click add reference
4. navigate to the demonbuddy exe
5. click demonbuddy.exe
6. click add
7. right click the added reference
8. click view in object explorer
9. RTFM and profit

That is all


Thanks! ... Think this is not common knowledge so ty for explaining. I'm not that experienced with C#, but I even asked some of my friends that were and they did not think you could use .exe files as reference ;> ..
 
Thanks! ... Think this is not common knowledge so ty for explaining. I'm not that experienced with C#, but I even asked some of my friends that were and they did not think you could use .exe files as reference ;> ..
You can if it's been coded to allow it :)
Welcome to the Buddy Products
 
Back
Top