1. I know it's easy but it seems im doing it wrong. I have a itemname in a data file with _bp at the end of the name. I need my script to identify the _bp at the end and remove it from the name. I tried the Puts to show me the result but nothing appears. What's the best way? thank you

    Code:
    if (itemName.Contains("_bp"))
                                {
                                    itemName = itemName.Substring(0, itemName.Length - 3);
                                    Puts(itemName);
    }
     
  2. Not much to go on with this, but if I were you, I'd be Puts'ing the itemName even before the if statement... Sounds like it isn't triggering at all if "nothing appears"
     
  3. ok so the line with the substring is correct to remove the 3 last characters of itemname? the problem may be before that part then
     
  4. Why don't you use Split instead of substring ?
     
  5. upload_2018-4-17_17-0-12.png

    In RUST, use Puts, instead of ConsoleWriteLine.
    If we are talking about reasons, why you do not see it in console
    1) Your checks doesnot work (maybe because of case, so _BP instead of _bp in your data)
    2) You have exception in Console that say where is trouble

    If u will give more code, i will able to see where can be trouble.
     
  6. @FireBurst

    Code:
    if (itemName.ToLower().EndsWith("_bp"))
    {
        itemName = itemName.Replace("_bp","").Replace("_BP","");
        Puts(itemName);
    }