Moradinsoulforger Posted January 21, 2024 Posted January 21, 2024 My Bat file: IF Player.HasPerk 00227FDA > 0; THEN Print "Player has the Alien DNA Trait."; ELSE Player.AddPerk 00227FDA; ENDIF The result when run from console: Bat TraitsBack > IF Player.HasPerk 00227FDA > 0; THEN Print "Player has the Alien DNA Trait."; Mismatched if/else/endif block starting on line 1. Mismatched if/then/else block. > ELSE Player.AddPerk 00227FDA; Mismatched if/else/endif block starting on line 1. Mismatched if/then/else block. > ENDIF I know I'm close, but just not getting there. Also Print command does not appear to work, is there an alternative or am i just using it incorrectly?
aurreth Posted January 21, 2024 Posted January 21, 2024 Maybe it wants the conditions in either parentheses or quotes? IF (...) THEN (...) or IF "..." THEN "..." Also I don't think you need the semicolon at the end of the line. It's not a standard Windows batch file, that's just what we call it. It's a listing of single line commands for the console.
LarannKiar Posted January 21, 2024 Posted January 21, 2024 On 1/21/2024 at 7:50 PM, Moradinsoulforger said: My Bat file: IF Player.HasPerk 00227FDA > 0; THEN Print "Player has the Alien DNA Trait."; ELSE Player.AddPerk 00227FDA; ENDIF The result when run from console: Bat TraitsBack > IF Player.HasPerk 00227FDA > 0; THEN Print "Player has the Alien DNA Trait."; Mismatched if/else/endif block starting on line 1. Mismatched if/then/else block. > ELSE Player.AddPerk 00227FDA; Mismatched if/else/endif block starting on line 1. Mismatched if/then/else block. > ENDIF I know I'm close, but just not getting there. Also Print command does not appear to work, is there an alternative or am i just using it incorrectly? Expand You were close yes. This should compile: if "14".HasPerk 00227FDA; Print "Player has the Alien DNA Trait."; else; 14.AddPerk 00227FDA; endif But it can't clear the console log and print the quoted line instead.
aurreth Posted January 21, 2024 Posted January 21, 2024 On 1/21/2024 at 10:29 PM, LarannKiar said: You were close yes. This should compile: if "14".HasPerk 00227FDA; Print "Player has the Alien DNA Trait."; else; 14.AddPerk 00227FDA; endif But it can't clear the console log and print the quoted line instead. Expand I knew there should probably be quotes in there someplace
Moradinsoulforger Posted January 22, 2024 Author Posted January 22, 2024 This compiles when run in console, but not as a BAT.
Recommended Posts