Jump to content

Recommended Posts

Posted

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?

 

Posted

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.

Posted
  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.

Posted
  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 ๐Ÿ˜†

  • Recently Browsing   0 members

    • No registered users viewing this page.
ร—
ร—
  • Create New...