Skwizzy / SPT-LootingBots

AI Looting mod for Singleplayer Tarkov
https://hub.sp-tarkov.com/files/file/1096-looting-bots/#overview
29 stars 11 forks source link

Add Option to Only Allow Player Scavs to Loot #101

Closed dwesterwick closed 5 months ago

dwesterwick commented 6 months ago

Please add an additional option to only allow player Scavs to loot. When implemented, this means the existing "Scav" checkbox will allow all non-player Scavs to loot.

The code I'm using to check which Scavs are player Scavs is:


string pattern = "\\w+.[(]\\w+[)]";
Regex regex = new Regex(pattern);
if (regex.Matches(botOwner.Profile.Nickname).Count > 0)
{
    return BotType.PScav;
}
dwesterwick commented 6 months ago

@Skwizzy I messed up the Regex pattern because I forgot that bot names can have special characters in them. This should fix it: string pattern = ".+[(].+[)]";.

Skwizzy commented 6 months ago

Changes can be found here: 179f692

dwesterwick commented 6 months ago

Thank you!