Jump to content

Recommended Posts

Hello,

i`ve never done anything related to programming and after hours of Reading i`ve managed to put something together. The purpose: Combat Rezz Tanks before Healers and Healers before DD`s.


Can anybody look over it and tell me, what is wrong and what is not wrong, please?

 

char rd = 'raid'; 
char tmp = ''; 
char tmpRole = '';
bool tmpTanks = true;
bool tmpHeals = true;

for (int i = 1; i <= 20; i++) 
{
	tmp = rd + i;
	tmpRole = UnitGroupRolesAssigned(tmp);
	
	if (tmpRole == 'TANK') {
		if (UnitIsDead(tmp)) {
			tmpTanks = false;
			local name = GetItemInfo(61999);
			RunMacroText('/use ' .. name);
			break;
		};
	} else if (tmpRole == 'HEALER') {
		if (UnitIsDead(tmp)) {
			tmpHeals = false;
			local name = GetItemInfo(61999);
			RunMacroText('/use ' .. name);
			break;
		};
	} else {
		if (tmpTanks && tmpHeals) {
			local name = GetItemInfo(61999);
			RunMacroText('/use ' .. name);
			break;
		};
	};
};

 

Link to comment
https://wrobot.eu/forums/topic/3457-combat-rezz-on-tanks-healers-before-dds/
Share on other sites

3 minutes ago, BetterSister said:

my eyes hurt... Could be because i've been awake 30 hours+ but back to topic...

i don't see how you tell the bot to decide whose role is what

 

With

tmpRole = UnitGroupRolesAssigned(tmp);

here is example what proper code looks like

        bool Rebirth()
        {
            if (!_rebirth.KnownSpell) return false;
            if (!_rebirth.IsSpellUsable) return false;
            if (RestoDruidSettings.CurrentSetting.PercentNaturesSwiftnessHealth == 0) return false;
            if (RestoDruidSettings.CurrentSetting.TargetsToRes == RestoDruidSettings.ResTargets.None) return false;

            if (RestoDruidSettings.CurrentSetting.TargetsToRes == RestoDruidSettings.ResTargets.Tanks)
            {
                needRes = "tank";
            }
            if (RestoDruidSettings.CurrentSetting.TargetsToRes == RestoDruidSettings.ResTargets.Tanks_and_Healers)
            {
                needRes = "tankheal";
            }
            if (RestoDruidSettings.CurrentSetting.TargetsToRes == RestoDruidSettings.ResTargets.All)
            {
                needRes = "all";
            }
            if (needRes == string.Empty) return false;

            bool resUsed = false;

            if (needRes == "tanks")
            {
                var resTanks = GetTankPlayerName();
                WoWPlayer tank = new WoWPlayer(GetTankPlayerName().GetBaseAddress);
                if (!TraceLine.TraceLineGo(tank.Position) && tank.IsDead)
                {
                     {
                        Interact.InteractGameObject(tank.GetBaseAddress, false);
                        _rebirth.Launch();
                        resUsed = true;
                        return true;
                    }
                }
                return false;
            }
            if (needRes == "tankheal" && !resUsed)
            {
                var resTanks = GetTankPlayerName();
                WoWPlayer tank = new WoWPlayer(resTanks.GetBaseAddress);
                if (!TraceLine.TraceLineGo(tank.Position) && tank.IsDead)
                {
                    {
                        Interact.InteractGameObject(tank.GetBaseAddress, false);
                        _rebirth.Launch();
                        resUsed = true;
                        return true;
                    }
                }

Problem with your code you're mixing java, C#, lua :D Bot supports lua but you must tell the bot to use lua then

(note this isn't complete code just example)

I think you better watch these vids. I used stanford java programming videos for java base knowledge. This is about C/C++ base knowledge

You can start from Lecture 3 if you don't want to listen about extremely basic things 0s and 1s

 

The thing is i`m not really interested in Programming, all i want to do is battle rezz the healers and tanks before the dd`s :wub:

 

Basically: I want to run around and dodge stuff myself, but can`t be bothered hitting all the buttons hehe :biggrin: But then again i think nobody here can, since this is a Forum for Bots, hm? :)

i personally think these java vids are better for these who have none knowledge about programming. Java is so similar so after all you probably could start with this

 

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...