Examples
Practical SoulFire scripting examples built with the current node set.
These examples are written against the current SoulFire scripting implementation. They focus on the shape of the graph and the reason each node is there.
1. Greet on join
Goal: Send a message once a bot is fully ready in the world.
Use this when: You want startup behavior and do not need early connection hooks.
Nodes
On JoinSend Chat
How to build it
- Add
On Join. - Add
Send Chat. - Connect
On Join.exectoSend Chat.exec. - Connect
On Join.bottoSend Chat.bot. - Set the message, for example
hello from SoulFire.
This is the simplest useful script in SoulFire, and it teaches the basic trigger -> action pattern.
2. Simple chat command
Goal: Reply with pong when chat contains !ping.
Nodes
On ChatString ContainsBranchSend Chat
How to build it
- Add
On Chat. - Add
String Contains. - Connect
On Chat.messagePlainTextto the string input onString Contains. - Set the search text on
String Containsto!ping. - Add
Branchand connect the boolean result fromString Containsto its condition. - Connect
On Chat.exectoBranch.exec. - Add
Send Chaton thetruepath. - Connect
On Chat.bottoSend Chat.bot. - Set the message to
pong.
This pattern scales well. Add more checks or route into Switch if you want more commands.
3. Poll all bots every few seconds
Goal: Run the same check for every connected bot on a timer.
This example exists because On Interval does not give you a bot directly.
Nodes
On IntervalGet BotsFor Each BotGet HealthPrint
How to build it
- Add
On Intervaland setintervalMsto something reasonable like5000. - Add
Get Bots. - Add
For Each Bot. - Connect
On Interval.exectoFor Each Bot.exec. - Connect
Get Bots.botsto the bot list input onFor Each Bot. - Inside the loop body, add
Get Health. - Connect the current bot from
For Each BottoGet Health.bot. - Add
Printto log the result if you want quick feedback while testing.
Use this pattern any time you want periodic work across the whole instance.
4. Auto-respawn and notify Discord
Goal: Recover from death and send a webhook notification.
Nodes
On DeathRespawnDiscord Webhook- Optional:
Format
How to build it
- Add
On Death. - Add
Respawnand connectOn Death.exectoRespawn.exec. - Connect
On Death.bottoRespawn.bot. - Add
Discord Webhook. - Connect
On Death.exectoDiscord Webhook.exec. - If you want a richer message, use
Formatto include values such asshouldRespawn.
If the server or game mode already handles respawns the way you want, you can drop the Respawn node and keep only the notification branch.
5. Flee when hurt
Goal: Move away from danger when a bot takes damage.
Nodes
On DamageGet PositionPathfind Away From- Optional:
Branch
How to build it
- Add
On Damage. - Add
Get Positionand connectOn Damage.botto it. - Add
Pathfind Away From. - Connect
On Damage.exectoPathfind Away From.exec. - Connect
On Damage.bottoPathfind Away From.bot. - Feed the current position into
Pathfind Away Fromas the point to move away from, or use another danger position if you already have one. - Optionally gate the behavior behind a
Branchthat checksnewHealth.
This is a good first example of mixing a trigger, a data query, and an action.
6. Mine a nearby target block
Goal: Search for a block, walk to it, and break it.
Nodes
On JoinFind BlockBranchPathfind ToBreak BlockWait
How to build it
- Add
On Join. - Add
Find Blockand connect the joining bot to it. - Configure the block ID and search range.
- Add
Branchto check whetherFind Blockproduced a valid result. - On the success path, use
Pathfind Towith the target coordinates. - Follow it with
Break Block. - Add
Waitif you plan to loop or repeat this pattern.
This is safer than putting a mining loop straight on a tick trigger.
7. Build a small AI responder
Goal: Send a chat message to an LLM and post the answer back in-game.
Nodes
On ChatString ContainsBranchLLM ChatSend ChatPrint
How to build it
- Use
String Containsto decide which messages should reach the model. - Connect the plain-text message to
LLM Chat.prompt. - Set a short system prompt.
- Connect
LLM Chat.responsetoSend Chat.message. - Connect the success path to
Send Chat. - Connect the error path to
Printso failures are visible while testing.
LLM Chat uses the bot's AI settings. It also supports a per-node model override. If no override is set, the current implementation falls back to gpt-4o-mini.
Debugging advice
- Use
Printoften while building a script. - Keep your first version linear. Add loops and branches only after the happy path works.
- Prefer
On JoinorOn Intervalwhile prototyping. They are easier to reason about than tick triggers. - Add
Wait,Debounce, orRate Limitbefore any repeated web or AI call.
How is this page?
Last updated on