V14.2.0 Beta Preview Available - New Lua Features


We are preparing to release a new beta version of FarmBot OS. This release contains some Lua updates that were requested by forum users.

Here’s what’s new:

  • The variable() Lua helper is now available in the ASSERT block and in formulas.
  • Lua behavior has been unified across all three environments: The ASSERT block, the LUA block and the inline formula features now all execute Lua in the same way.
  • You can now view attributes beyond x,y and z. Available attributes: id, tool_id, gantry_mounted, meta, name, openfarm_slug, plant_stage, pointer_type, pullout_direction, resource_id, resource_type, radius, x, y, z
  • Routine dependency updates.

If you have never tried a beta version before, you can read more about how to install a beta version of FBOS here: Beta Updates | FarmBot Software Development Documentation

Please let us know if you hit any issues with the beta release. If no issues are noted we will release this version in the coming days.


I just applied the beta and will play with the features soon!


A new release candidate (14.2.0-rc4) is available. If you are already running a beta release, please be sure to update to the latest RC.

1 Like

Hi @RickCarlino

Looks like my bot is already on the latest beta! No issues so far.

Hey @RickCarlino

Am I able to somehow store the soil moisture value in a variable and use it in an LUA block now?

@stre1026 That has always been possible via env("name", value). If you need help, I can show you how in a new thread. Here’s a link to the docs: Lua | FarmBot Software Development Documentation

The big news with this release is that you can access the radius and other properties of a variable. It makes geometric operations much easier to perform.

Below is an example of circling the gantry around a point’s radius:

parent = variable()
radius = parent.radius
for radians = 0, 6.2, 0.1 do
    x = parent.x + (radius * math.cos(radians))
    y = parent.y + (radius * math.sin(radians))
    z = parent.z
    move_absolute(x, y, z, 50)

Notice how in the Lua code we’re calling variable().radius and then using the built in Lua trig functions to calculate an arc.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.