Simple Batch Programming
Test for making a simple programming language based on assembly and batch files.
Quick Start Guide
- Download and activate the mod.
- Open the SimplePlanes directory at
C:\Users\%USERNAME%\AppData\LocalLow\Jundroo\SimplePlanes
. - Open
\NACHSAVE\SBAT
directory. A file calledHELLO.SB
will be available. - In SimplePlanes, run the command ExecuteSB hello
- This runs
HELLO.SB
which prints "Hello, World!" to the dev console.
- This runs
- 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.
- 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)
my brain already died upon reading the first bit of the description
@Kwoshent Creates doom in SP
C# coding in a game made in C# when
@hpgbproductions ha ha nice
@OrderlyHippo for fun and to experience the pain of assembly programming
Why did you create this? It’s cool don’t get me wrong
I hereby conclude that I'm a smoothbrain
I noob on programming
i cant use this
I totally understand this