Magi
New Member
- Joined
- Oct 12, 2012
- Messages
- 1,242
- Reaction score
- 7
Not real familiar with C so any help would be appreciated. Should be a quick answer for those who know the syntax better than I.
I've got this function to get an actor based on it's ActorSNO (not mine, someone else's):
Works fine, but I want to now get an actor if the Name of the actor contains certain strings (keys yippie!) Trying to detect Uber Key/Organ drops
Now the key check currently should be looking for an identical match, but I want to check if it "StartsWith" those names provided in the _keyNames string array. How would I write that DiaObject keyObject call?
Thank you in advance!
I've got this function to get an actor based on it's ActorSNO (not mine, someone else's):
Code:
int[] _keywardenSNOs = { 255996, 256000, 256015 };
// set object
DiaObject wardenObject = ZetaDia.Actors.RActorList.OfType<DiaObject>().FirstOrDefault(r => _keywardenSNOs.Any(k => k == r.ActorSNO));
Works fine, but I want to now get an actor if the Name of the actor contains certain strings (keys yippie!) Trying to detect Uber Key/Organ drops
Code:
string[] _keyNames = { "demonkey_", "demontrebuchetkey", "_quest" };
// set key object
DiaObject keyObject = ZetaDia.Actors.RActorList.OfType<DiaObject>().FirstOrDefault(r => keySNOs.Any(k => k == r.Name));
//if (sThisInternalName.StartsWith("demonkey_") || sThisInternalName.StartsWith("demontrebuchetkey"))
Now the key check currently should be looking for an identical match, but I want to check if it "StartsWith" those names provided in the _keyNames string array. How would I write that DiaObject keyObject call?
Thank you in advance!






