-
Contributor
Need few tips about IF conditions
Hi,
I need few tips about if conditions:
if(specific number of normal monsters in specific range from me) {}
if(elite in specific range) {}
Thx
-
First Dev On The Internet
Originally Posted by
MrOne
Hi,
I need few tips about if conditions:
if(specific number of normal monsters in specific range from me) {}
Not sure i understand and not tested but :
23 Monsters within 10 yards :
PHP Code:
var Monsters = Hud.Game.Monsters.Where(a => a.NormalizedXyDistanceToMe <= 10 && a.Rarity == 0);
if (Monsters.Count == 23) {}
(not sure about the Count thing though, I'm shattered...)
Originally Posted by
MrOne
if(elite in specific range) {}
Thx
Elite within 10 yards
PHP Code:
var Elite = Hud.Game.Monsters.Where(a => a.IsElite);
if (Elite.NormalizedXyDistanceToMe <= 10) {}
-
Post Thanks / Like - 2 Thanks
johnbl,
MrOne (2 members gave Thanks to User5981 for this useful post)
-
Contributor
This is what i need but it does not work, got exception:
Code:
The "==" operator can not be used for "method group" or "int" operation arguments
EDIT
first now its work after add ()
PHP Code:
if (Monsters.Count() == 23) {}
but elite condition still dont work
Last edited by MrOne; 02-10-2018 at 03:12 AM.
-
First Dev On The Internet
Originally Posted by
MrOne
This is what i need but it does not work, got exception:
Code:
The "==" operator can not be used for "method group" or "int" operation arguments
EDIT
first now its work after add ()
PHP Code:
if (Monsters.Count() == 23) {}
but elite condition still dont work
Sorry I forgot to add a foreach loop between the two elite lines!
PHP Code:
var Elites = Hud.Game.Monsters.Where(a => a.IsElite);
foreach(Elite in Elites) {
if (Elite.NormalizedXyDistanceToMe <= 10) {}
}
Last edited by User5981; 02-10-2018 at 03:36 AM.