ClassLuaSimulationchanged
Members
| create_test_player{name=…} | → LuaPlayer | |
| get_slot_position{inventory_index=…, slot_index=…, inventory?=…} changed | → MapPosition? | |
| get_widget_position{type=…} changed | → MapPosition? | |
| activate_rail_planner{position?=…, ghost_mode?=…, build_mode?=…} | Activate the rail planner at the given position. | |
Activate the rail planner at the given position. | ||
| deactivate_rail_planner() | Deactivate the rail planner. | |
Deactivate the rail planner. | ||
| move_cursor{position=…, speed?=…} | → boolean | Move the cursor towards the given position at the given speed. |
Move the cursor towards the given position at the given speed. | ||
| mouse_down() | Send a left mouse button-down event at its current position. | |
Send a left mouse button-down event at its current position. | ||
| mouse_up() | Send a left mouse button-up event at its current position. | |
Send a left mouse button-up event at its current position. | ||
| mouse_click() | Send a left mouse button click event at its current position. [...] | |
Send a left mouse button click event at its current position. [...] | ||
| control_down{control=…, notify=…} | Send a control press event at the current cursor position. | |
Send a control press event at the current cursor position. | ||
| control_up{control=…} | Send a control release event at the current cursor position. | |
Send a control release event at the current cursor position. | ||
| control_press{control=…, notify=…} | Send a control down and up event at the current cursor position. [...] | |
Send a control down and up event at the current cursor position. [...] | ||
| write{text?=…} | Write text as if it was typed by a player. [...] | |
Write text as if it was typed by a player. [...] | ||
| scroll_clipboard_forwards() | Scroll the clipboard forwards by one entry. | |
Scroll the clipboard forwards by one entry. | ||
| scroll_clipboard_backwards() | Scroll the clipboard backwards by one entry. | |
Scroll the clipboard backwards by one entry. | ||
| camera_player_cursor_position | :: RW MapPosition? | |
| camera_position | :: RW MapPosition? | |
| camera_surface_index | :: RW uint32? | |
| hide_cursor | :: W boolean | |
| camera_zoom | :: W double | |
| camera_player | :: W PlayerIdentification | |
| camera_player_cursor_direction | :: W defines.direction | |
| camera_alt_info | :: W boolean | |
| smart_belt_building | :: W boolean? | |
| gui_tooltip_interval | :: W double | |
| active_quickbars | :: W uint8 | |
| valid | :: R boolean | Is this object valid? [...] |
Is this object valid? [...] | ||
| object_name | :: R string | The class name of this object. [...] |
The class name of this object. [...] | ||
Methods
create_test_player{name=…} → LuaPlayer
get_slot_position{inventory_index=…, slot_index=…, inventory?=…} → MapPosition?changed
Parameters
| inventory_index | :: defines.inventory | |
| slot_index | :: ItemStackIndex | This index is 0-based, unlike other inventory indices. |
This index is 0-based, unlike other inventory indices. | ||
| inventory | :: "character" or "entity"? | Defaults to |
Defaults to | ||
Return values
| → MapPosition? | Position of the GUI slot on the screen, if successfully found. |
get_widget_position{type=…} → MapPosition?changed
Parameters
| type | :: SimulationWidgetType |
Other attributes may be specified depending on type:
signal-id-base
| id | :: SignalIDBase |
simple-slot
| item | :: ItemID |
simple-item-slot
| item | :: ItemID |
simple-item-with-quality-slot
| filter | :: ItemFilter |
recipe-slot
| recipe | :: RecipeID |
quickbar-slot
| filter | :: ItemFilter? | Note: since quickbar slots are also of type ItemFilter, filter is used as a value: it must be equal QuickBarSlot::filter. |
Note: since quickbar slots are also of type ItemFilter, filter is used as a value: it must be equal QuickBarSlot::filter. | ||
| page_index | :: uint8? | |
| slot_index | :: uint8? | |
logistics-button
| request_index | :: LogisticFilterIndex |
logistics-button-space
| request_index | :: LogisticFilterIndex | |
| section_index | :: LogisticSectionIndex |
text-button-localised-substring
| text | :: LocalisedString |
text-button
| text | :: string |
text-button-substring
| text | :: string |
textfield
| text | :: string |
item-group-tab
| group | :: ItemGroupID |
drop-down
| text | :: string? |
check-box
| text | :: LocalisedString |
label
| text | :: string? |
Return values
| → MapPosition? | Center of the GUI widget on the screen, if successfully found. |
activate_rail_planner{position?=…, ghost_mode?=…, build_mode?=…}
Parameters
| position | :: MapPosition? | |
| ghost_mode | :: boolean? | Defaults to |
Defaults to | ||
| build_mode | :: defines.build_mode? | Defaults to normal. |
Defaults to normal. | ||
move_cursor{position=…, speed?=…} → boolean
Parameters
| position | :: MapPosition | |
| speed | :: double? | Defaults to |
Defaults to | ||
Return values
| → boolean | Whether the cursor will reach the target position with this move. |
control_up{control=…}
Parameters
| control | :: string | The name of the control input to release. |
The name of the control input to release. | ||
write{text?=…}
Parameters
| text | :: string? | The text to write. Does nothing if no text is provided. |
The text to write. Does nothing if no text is provided. | ||

