Jump to content
Heavy Traffic ×

Trying to create a BAT to either verify a mod trait is set, or if not, set it.


Recommended Posts

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

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

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

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...