Moradinsoulforger Posted January 21 Share Posted January 21 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? Link to comment Share on other sites More sharing options...
aurreth Posted January 21 Share Posted January 21 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. Link to comment Share on other sites More sharing options...
LarannKiar Posted January 21 Share Posted January 21 2 hours ago, 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? 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. Link to comment Share on other sites More sharing options...
aurreth Posted January 21 Share Posted January 21 1 hour ago, 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. I knew there should probably be quotes in there someplace Link to comment Share on other sites More sharing options...
Moradinsoulforger Posted January 22 Author Share Posted January 22 This compiles when run in console, but not as a BAT. Link to comment Share on other sites More sharing options...
Recommended Posts