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

Hexing Pants Working! Need help for Log Errors for Perfection. Plz Advice

rimmi2002

New Member
Joined
Apr 28, 2014
Messages
138
Reaction score
2
Hi I am trying to write something for my WD, can be used for other classes as well...that keeps my WD in constant motion for Hexing pants. I have actually accomplished this in game...in that my WD moves back as forth from the target with the code below towards the end of witchdoctorcombat.cs.

Code:
[COLOR="#FF0000"]			if(CurrentTarget.RadiusDistance > 10f)			
			{
				return new TrinityPower(SNOPower.Walk, 10f, CurrentTarget.Position);
			}
			
			if(CurrentTarget.RadiusDistance < 10f)			
			{
				Vector3 vNewTarget = MathEx.CalculatePointFrom(CurrentTarget.Position, Player.Position, -10f);
				return new TrinityPower(SNOPower.Walk, 10f, vNewTarget);
			}[/COLOR]
				

            // Default Attacks
            if (IsNull(power))
                power = CombatBase.DefaultPower;
				//return new TrinityPower(SNOPower.None);

            return power;


The code works in game just fine...My WD is constantly moving and using all other skills. The issue is that I am constantly getting the error below in DB.

Any insight into the errors below? Am I calling SNOpower.walk with the wrong parameters? Any help would be great. The Hexing pants constant movement is working really well...just need the errors to go away. Thanks!



Code:
Exception during bot tick.System.NullReferenceException: Object reference not set to an instance of an object.
   at Trinity.Combat.Abilities.WitchDoctorCombat.GetPower() in c:\Users\Rominder Momi\Documents\01. DB Main\01. Riftbot - Orig\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs:line 518
   at Trinity.Trinity.AbilitySelector(Boolean IsCurrentlyAvoiding, Boolean UseOOCBuff, Boolean UseDestructiblePower) in c:\Users\Rominder Momi\Documents\01. DB Main\01. Riftbot - Orig\Plugins\Trinity\Combat\AbilitySelector.cs:line 110
   at Trinity.Trinity.TargetCheck(Object ret) in c:\Users\Rominder Momi\Documents\01. DB Main\01. Riftbot - Orig\Plugins\Trinity\Combat\TargetCheck.cs:line 164
   at Zeta.TreeSharp.Decorator.CanRun(Object context)
   at Zeta.TreeSharp.Decorator..()
   at Zeta.TreeSharp.Composite.Tick(Object context)
   at Zeta.TreeSharp.PrioritySelector..()
   at Zeta.TreeSharp.Composite.Tick(Object context)
   at Zeta.Common.HookExecutor.Run(Object context)
   at Zeta.TreeSharp.Action.RunAction(Object context)
   at Zeta.TreeSharp.Action..()
   at Zeta.TreeSharp.Composite.Tick(Object context)
   at Zeta.TreeSharp.PrioritySelector..()
   at Zeta.TreeSharp.Composite.Tick(Object context)
   at Zeta.Bot.BotMain.()

Working Version of Files here
 
Last edited:
From a quick look, I'm guessing you're getting that exception when the bot doesn't have a target. If there's no target then CurrentTarget.RadiusDistance will throw a null reference exception.

If that is the case then you could try moving a short distance in a random direction when CurrentTarget is null.


The exception is being triggered at line 518 in WitchDoctorCombat.cs, so you'd need to look at the code on that line. I don't think Notepad offers an easy way of finding a line number, but it's easy in Visual Studio and some other text editors out there.
 
Last edited:
[
From a quick look, I'm guessing you're getting that exception when the bot doesn't have a target. If there's no target then CurrentTarget.RadiusDistance will throw a null reference exception.

If that is the case then you could try moving a short distance in a random direction when CurrentTarget is null.


The exception is being triggered at line 518 in WitchDoctorCombat.cs, so you'd need to look at the code on that line. I don't think Notepad offers an easy way of finding a line number, but it's easy in Visual Studio and some other text editors out there.

Thanks for the input. Works like a Charm now!
I moved the code into the section of the file where all the skills are placed. Placed it at the bottom. No more errors in the log! Problem was I wasn't checking for
Code:
if (!UseOOCBuff && !IsCurrentlyAvoiding && CurrentTarget != null)

Toon in moving around at all time and getting +Dam from hexing Pants.


Here is the Final code. Place it at the bottom of your skills in combat.cs file. Should work for all characters!! Also will need legendary.cs file to recognize the hexing pants.

Code:
if(Legendary.HexingPantsofMrYan.IsEquipped && CurrentTarget.IsUnit && CurrentTarget.RadiusDistance > 10f)			
		{
		return new TrinityPower(SNOPower.Walk, 10f, CurrentTarget.Position);			
}
			
if(Legendary.HexingPantsofMrYan.IsEquipped && CurrentTarget.IsUnit && CurrentTarget.RadiusDistance < 10f)			
		{
		Vector3 vNewTarget = MathEx.CalculatePointFrom(CurrentTarget.Position, Player.Position, -10f);
		return new TrinityPower(SNOPower.Walk, 10f, vNewTarget);
		}
 
Last edited:
Could u post a complete Wdcombat.cs file ? mine fucking up after adding thoose lines
 
Added the file to the 3rd post and also I have my kiting distance at 15. I did the distance for movement based on that. MAke sure u have that also.
 
Still getting this :


Attached to Diablo III with pid: 8644
Flashing window
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(9,15) : error CS1518: Expected class, delegate, enum, interface, or struct
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(9,44) : error CS1518: Expected class, delegate, enum, interface, or struct
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(482,18) : error CS1513: } expected
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(486,5) : error CS1519: Invalid token 'if' in class, struct, or interface member declaration
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(486,48) : error CS1519: Invalid token '&&' in class, struct, or interface member declaration
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(486,72) : error CS1519: Invalid token '&&' in class, struct, or interface member declaration
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(488,34) : error CS1519: Invalid token '>' in class, struct, or interface member declaration
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(490,17) : error CS1520: Method must have a return type
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(490,43) : error CS1001: Identifier expected
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(490,45) : error CS1031: Type expected
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(490,72) : error CS1519: Invalid token ')' in class, struct, or interface member declaration
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(493,5) : error CS0116: A namespace cannot directly contain members such as fields or methods
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(498,17) : error CS1518: Expected class, delegate, enum, interface, or struct
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(501,4) : error CS1022: Type or namespace definition, or end-of-file expected
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(504,13) : error CS0116: A namespace cannot directly contain members such as fields or methods
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(509,32) : error CS1518: Expected class, delegate, enum, interface, or struct
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(510,17) : error CS1022: Type or namespace definition, or end-of-file expected

When using your file
 
Still getting this :


Attached to Diablo III with pid: 8644
Flashing window
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(9,15) : error CS1518: Expected class, delegate, enum, interface, or struct
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(9,44) : error CS1518: Expected class, delegate, enum, interface, or struct
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(482,18) : error CS1513: } expected
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(486,5) : error CS1519: Invalid token 'if' in class, struct, or interface member declaration
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(486,48) : error CS1519: Invalid token '&&' in class, struct, or interface member declaration
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(486,72) : error CS1519: Invalid token '&&' in class, struct, or interface member declaration
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(488,34) : error CS1519: Invalid token '>' in class, struct, or interface member declaration
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(490,17) : error CS1520: Method must have a return type
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(490,43) : error CS1001: Identifier expected
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(490,45) : error CS1031: Type expected
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(490,72) : error CS1519: Invalid token ')' in class, struct, or interface member declaration
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(493,5) : error CS0116: A namespace cannot directly contain members such as fields or methods
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(498,17) : error CS1518: Expected class, delegate, enum, interface, or struct
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(501,4) : error CS1022: Type or namespace definition, or end-of-file expected
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(504,13) : error CS0116: A namespace cannot directly contain members such as fields or methods
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(509,32) : error CS1518: Expected class, delegate, enum, interface, or struct
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(510,17) : error CS1022: Type or namespace definition, or end-of-file expected

When using your file

He added something extra by mistake. Delete line 9: public static Item TheTallMansFinger = new Item(298088, "The Tall Man's Finger", ItemType.Ring);
 
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(482,18) : error CS1513: } expected
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(486,5) : error CS1519: Invalid token 'if' in class, struct, or interface member declaration
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(486,48) : error CS1519: Invalid token '&&' in class, struct, or interface member declaration
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(486,72) : error CS1519: Invalid token '&&' in class, struct, or interface member declaration
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(490,17) : error CS1520: Method must have a return type
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(488,34) : error CS1519: Invalid token '>' in class, struct, or interface member declaration
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(490,43) : error CS1001: Identifier expected
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(490,45) : error CS1031: Type expected
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(490,72) : error CS1519: Invalid token ')' in class, struct, or interface member declaration
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(493,5) : error CS0116: A namespace cannot directly contain members such as fields or methods
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(498,17) : error CS1518: Expected class, delegate, enum, interface, or struct
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(501,4) : error CS1022: Type or namespace definition, or end-of-file expected
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(504,13) : error CS0116: A namespace cannot directly contain members such as fields or methods
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(509,32) : error CS1518: Expected class, delegate, enum, interface, or struct
Compiler Error: c:\Users\pandur\Desktop\DB-Beta\Plugins\Trinity\Combat\Abilities\WitchDoctorCombat.cs(510,17) : error CS1022: Type or namespace definition, or end-of-file expected


Now this instead :)
 
Now this instead :)

public static Item HexingPantsofMrYan = new Item(332204, "Hexing Pants of Mr. Yan", ItemType.Legs);

He has that inside of an if() statement body, which isn't a valid place for a definition like that. I think he meant to put that in Legendary.cs and accidentally pasted it into the wrong file.

(I haven't actually tried his file, I'm just looking through the file itself)


My guess is that he was testing it as a local variable first (which would be valid), then decided to make it global. If he didn't restart DemonBuddy then he likely wouldn't get the error since it wouldn't recompile until a fresh start (as far as I know).
 
Last edited:
My Bad on the confusion. I added those in for you to avoid attaching another file to keep it from being complicated.

In that case you could declare them right before they're used and remove the public static from the declarations.


Item TheTallMansFinger = new Item(298088, "The Tall Man's Finger", ItemType.Ring);


From there you would call the variable as TheTallMansFinger rather than Legendary.TheTallMansFinger.
 
Last edited:
Yup its out. Was never in it. Alot of people don't have legendaries.cs in their trinity folder. So i added the statement to the original file, but doesn't seem it can be declared that way. I Will remove it from the orignial page.

Been watching my bot right now for 2 straight posts and it seems to be working very well. Not only does it kill faster but for the most part it keeps far away from all monsters. Once its fully tested I can make a new post with complete info.

the clusterexists for Piranha's was not working well when constantly moving so I changed it to anymobsexist and it actually works much better than before.
 
Question,
I have some modification on my WitchDoctorCombat.CS and would like to keep it, so i would just like to confirm if is these are the only coding you added:

//Hexing Pants Mod
if(Legendary.HexingPantsofMrYan.IsEquipped && CurrentTarget.IsUnit &&
//!CanCast(SNOPower.Witchdoctor_Piranhas) &&
CurrentTarget.RadiusDistance > 10f)
{
return new TrinityPower(SNOPower.Walk, 10f, CurrentTarget.Position);
}

if(Legendary.HexingPantsofMrYan.IsEquipped && CurrentTarget.IsUnit &&
//!CanCast(SNOPower.Witchdoctor_Piranhas) &&
CurrentTarget.RadiusDistance < 10f)
{
Vector3 vNewTarget = MathEx.CalculatePointFrom(CurrentTarget.Position, Player.Position, -10f);
return new TrinityPower(SNOPower.Walk, 10f, vNewTarget);
 
Question,
I have some modification on my WitchDoctorCombat.CS and would like to keep it, so i would just like to confirm if is these are the only coding you added:

//Hexing Pants Mod
if(Legendary.HexingPantsofMrYan.IsEquipped && CurrentTarget.IsUnit &&
//!CanCast(SNOPower.Witchdoctor_Piranhas) &&
CurrentTarget.RadiusDistance > 10f)
{
return new TrinityPower(SNOPower.Walk, 10f, CurrentTarget.Position);
}

if(Legendary.HexingPantsofMrYan.IsEquipped && CurrentTarget.IsUnit &&
//!CanCast(SNOPower.Witchdoctor_Piranhas) &&
CurrentTarget.RadiusDistance < 10f)
{
Vector3 vNewTarget = MathEx.CalculatePointFrom(CurrentTarget.Position, Player.Position, -10f);
return new TrinityPower(SNOPower.Walk, 10f, vNewTarget);

This plus you need the legendary.cs file in your folder you it can recognize the legendary item hexing pants.

How can i adapt those two files for my DH? :)



Try copying the code below near above default power around line 386 of the demonhunter.cs file. This will only work if you are using no primary skills for DH. Basically it will move when there are no other skills to be used (ie sentry DH). I didn't test it but it should work in theory. Let me know how it goes.



Code:
if(!UseOOCBuff && !IsCurrentlyAvoiding && CurrentTarget != null && Legendary.HexingPantsofMrYan.IsEquipped && CurrentTarget.IsUnit && CurrentTarget.RadiusDistance > 10f)			
		{
		return new TrinityPower(SNOPower.Walk, 10f, CurrentTarget.Position);			
}
			
if(!UseOOCBuff && !IsCurrentlyAvoiding && CurrentTarget != null && Legendary.HexingPantsofMrYan.IsEquipped && CurrentTarget.IsUnit && CurrentTarget.RadiusDistance < 10f)			
		{
		Vector3 vNewTarget = MathEx.CalculatePointFrom(CurrentTarget.Position, Player.Position, -10f);
		return new TrinityPower(SNOPower.Walk, 10f, vNewTarget);
		}
 
Last edited:
I did copy legendary.cs but when i reopen db and start a profile, nothing happens.
very weird, ill try again another time. lol
 
I downloaded the two files, put them where you said, but see no change in behavior. Thoughts?
 
Back
Top