Profile image

Simple Batch Programming

110k hpgbproductions  2.2 years ago
498 downloads
Version 1.2 Tool

Test for making a simple programming language based on assembly and batch files.

Quick Start Guide

  1. Download and activate the mod.
  2. Open the SimplePlanes directory at C:\Users\%USERNAME%\AppData\LocalLow\Jundroo\SimplePlanes.
  3. Open \NACHSAVE\SBAT directory. A file called HELLO.SB will be available.
  4. In SimplePlanes, run the command ExecuteSB hello

    • This runs HELLO.SB which prints "Hello, World!" to the dev console.

  5. Run the command: ExecuteSB "hello,#(your name)#"

    • This passes a string argument to the SB program.

    • The double quotes surrounding the program name arguments are needed for the dev console to accept the entire string.

    • The hash # symbols lets the SB interpreter treat a string with spaces as a single argument.

  6. You are ready to start using Simple Batch Programming!

View a more complete guide and the commands reference here.

Get a syntax highlighter for Notepad++ here. This uses User-Defined Language 2.1.

White   Numeric literals, variables %0 to %9
Green   User-defined variables
Blue    Addresses of user-defined variables
Magenta Branching functions
Yellow  Other functions
Orange  Strings, invalid functions
Gray    Remarks (REM)

If you find any bugs with the functions of the mod, write them in the comments. I'd recommend providing a copy of your SB file as well.

Example Programs

HELLO.SB
The "Hello, World!" test program provided with the mod.
%1: [string] A name to display.

COPY.SB
Makes a copy of any file. Relative file paths will start at the SimplePlanes folder (try AircraftDesigns\\__editor__.xml). Due to the behavior of the WRITE command, existing files will not be overwritten.
%1: [string] Path to the file to make a copy of.
%2: [string] Destination to copy the file to.

FIB.SB
Prints Fibonacci numbers to the dev console.
%1: [int] The value n, where Fn is the last number to be printed and n >= 0.

WIND.SB
Sets the wind speed, given the wind speed and direction. Uses the SetWindSpeed command. Trigonometry is performed using a Taylor series.
%1: [float] Speed in m/s.
%2: [float] Heading to blow towards in degrees.

MATADD.SB
Port of Material Offset Tool for those who have too much time on their hands. It's probably very slow due to using string concatenation. Example timings on my PC:

  • New Aircraft (3 parts): 1,300 ms
  • Wasp (Simple) (85 parts): 70,000 ms
  • Naozumi (~900 parts): 5,000,000 ms

For comparison, all of the above can be copied by the original C# code in under a second.
Instead of defining a destination file, you copy the aircraft data from Player.log (this method makes the program run much faster)
%1: [string] Path of the aircraft or subassembly file.
%2: [int] Number of material slots to offset by.

More testing and example programs here.

Version History

1.2 (2302242200)

  • Fixed ISEQ command outputting System.Boolean instead of System.Int32
  • Fixed STRGET command outputting System.Char instead of System.Int32
  • Fixed STRGET command always selecting characters from the first argument

1.1 (2209151900)

  • Initial release
  • Added file access commands

1.0 (2209142330)

  • (none)

  • Log in to leave a comment
  • Profile image

    my brain already died upon reading the first bit of the description

    8 months ago
  • Profile image
    30.1k ALTMTR

    @Kwoshent Creates doom in SP

    +1 2.1 years ago
  • Profile image
    6,961 Kwoshent

    C# coding in a game made in C# when

    +1 2.2 years ago
  • Profile image
    2,790 OrderlyHippo

    @hpgbproductions ha ha nice

    +1 2.2 years ago
  • Profile image

    @OrderlyHippo for fun and to experience the pain of assembly programming

    +1 2.2 years ago
  • Profile image
    2,790 OrderlyHippo

    Why did you create this? It’s cool don’t get me wrong

    2.2 years ago
  • Profile image
    44.1k ShinyGemsBro

    I hereby conclude that I'm a smoothbrain

    +3 2.2 years ago
  • Profile image

    I noob on programming
    i cant use this

    +1 2.2 years ago
  • Profile image
    17.8k FlirBlitz

    I totally understand this

    +8 2.2 years ago