Jump to content

Recommended Posts

Do use 1 script with many args or 2 script with small args? Example: CSharp condition 

A big script:

(ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(-3908,1130,0)) < 5 || 
ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(-6790, -2891, 9)) < 5 || 
ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(2892,-811,199)) < 5 || 
ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(6708,-4654, 0)) < 5 || 
ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(1211, -4868, 188)) < 5 || 
ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(3865, 6983, 0)) < 5 || 
ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(3641,2032,0)) < 5 || 
ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(-4459, -1660, 127)) < 5 || 
ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(3392,-3378,134)) < 5 || 
ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(-3520,1065,0)) < 50 || 
ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(-6060, -2955, 434)) < 5) && ObjectManager.Me.IsDead

1st small script:

(ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(-3908,1130,0)) < 5 || 
ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(-6790, -2891, 9)) < 5 || 
ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(2892,-811,199)) < 5 || 
ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(6708,-4654, 0)) < 5 || 
ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(1211, -4868, 188)) < 5) && ObjectManager.Me.IsDead 

2nd small script:

(ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(3865, 6983, 0)) < 5 || 
ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(3641,2032,0)) < 5 || 
ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(-4459, -1660, 127)) < 5 || 
ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(3392,-3378,134)) < 5 || 
ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(-3520,1065,0)) < 50 || 
ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(-6060, -2955, 434)) < 5) && ObjectManager.Me.IsDead

Hello, I am not sure to understand, but you can add code like in "Additional C# code" 

static bool Condi1 
{
  get
  {
      return (ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(-3908,1130,0)) < 5 || 
              ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(-6790, -2891, 9)) < 5 || 
              ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(2892,-811,199)) < 5 || 
              ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(6708,-4654, 0)) < 5 || 
              ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(1211, -4868, 188)) < 5 || 
              ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(3865, 6983, 0)) < 5 || 
              ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(3641,2032,0)) < 5 || 
              ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(-4459, -1660, 127)) < 5 || 
              ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(3392,-3378,134)) < 5 || 
              ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(-3520,1065,0)) < 50 || 
              ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(-6060, -2955, 434)) < 5) && ObjectManager.Me.IsDead;
  }
}

and in "Csharp conditon" use code like " Condi1  "

15 hours ago, Mykoplazma said:

You should write the variables to array and create the function that iterates thru the array and check each condition one after another. And what is the reason to check that madness anyway? ;D

It is points for start event if char die in the specific place

16 hours ago, Droidz said:

Hello, I am not sure to understand, but you can add code like in "Additional C# code" 


static bool Condi1 
{
  get
  {
      return (ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(-3908,1130,0)) < 5 || 
              ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(-6790, -2891, 9)) < 5 || 
              ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(2892,-811,199)) < 5 || 
              ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(6708,-4654, 0)) < 5 || 
              ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(1211, -4868, 188)) < 5 || 
              ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(3865, 6983, 0)) < 5 || 
              ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(3641,2032,0)) < 5 || 
              ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(-4459, -1660, 127)) < 5 || 
              ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(3392,-3378,134)) < 5 || 
              ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(-3520,1065,0)) < 50 || 
              ObjectManager.Me.PositionCorpse.DistanceTo2D(new Vector3(-6060, -2955, 434)) < 5) && ObjectManager.Me.IsDead;
  }
}

and in "Csharp conditon" use code like " Condi1  "

I mean which is less costly in using computer resources 1 spells with a large condition or 2 spells with a small condition. In fight class editor.

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...