Language Reference

Syntax Dictionary.

A searchable reference for InfiniteScript commands, structures and language keywords.

Output

Say Output
Outputs a value or message.
Say "Hello World"
Say Money

Variables & Values

Local Storage Variable
Creates a locally stored variable.
Local Storage Money = 100
Local Storage PlayerName = "Adan"
Local Storage IsAdmin = true
Set Variable
Assigns a new value to a variable.
Set Money = 500
Change Variable
Changes a variable by an amount.
Change Money by 100

Control Flow

If Control
Runs code when a condition is true.
If Money > 100
    Say "Rich!"
End
Else Control
Runs when the preceding condition is false.
If Money > 100
    Say "Rich!"
Else
    Say "Keep earning."
End
For Loop
Repeats a block across a numeric range.
For i = 1 to 5
    Say i
End
While Loop
Repeats a block while a condition remains true.
While Money < 500
    Change Money by 50
End
Break Loop
Stops the current loop.
Break
Continue Loop
Skips to the next loop iteration.
Continue

Functions

Function Function
Declares reusable behaviour.
Function GiveMoney Amount
    Change Money by Amount
End
Return Function
Returns a value from a function.
Return Money

Input & Random

Input Input
Requests information from the user.
Input PlayerName
Input Number Age
Input Boolean IsAdmin
Random Built-in
Generates a random number within a range.
Random Number Roll = 1 to 6

Storage

Local Storage Storage
Stores values accessible to the program.
Local Storage PlayerName = "Adan"

Infinite UI

UI UI
Starts a native Infinite UI program.
UI
    Window Main
        Title "My App"
    End
End
Window UI
Creates a native application window.
Window Main
    Title "Infinite App"
End
Title UI
Sets a window title.
Title "InfiniteScript"
Size UI
Sets the requested window size.
Size 800, 600
Text UI
Creates text content.
Text Welcome
    Content "Hello!"
End
Button UI
Creates an interactive button.
Button Start
    Text "Get Started"
End
On Click Event
Runs code when a UI button is clicked.
On Click
    Say "Clicked!"
End

Animation

Animate Animation
Describes an animation applied to an object or UI element.
Animate DemoButton
    Property Scale
    From 1
    To 1.1
    Duration 150
    Easing EaseOut
End

Backend

Backend Backend
Defines backend functionality.
Backend
    Route GET "/api/hello"
        Return {
            message: "Hello from InfiniteScript!"
        }
    End
End
Route Backend
Defines an API endpoint.
Route GET "/api/hello"

3D

Scene 3D
Defines a 3D scene.
Scene Main
    Camera MainCamera
    End
End
Camera 3D
Defines a 3D camera.
Camera MainCamera
    Position 0, 2, 8
End
Model 3D
Defines a 3D model.
Model Robot
    File "robot.obj"
    Position 0, 0, 0
End
Light 3D
Defines lighting for a scene.
Light Sun
    Type Directional
    Intensity 2
End