Chat AI Player - Autonomous Character Controller

by sumfeng

Creates and controls AI character entities directly via LuaControl API. Autonomous character controller with built-in behavior engine. AI characters can patrol-collect resources, build ghosts, auto-craft items, follow the player in combat mode, and execute one-shot movement or crafting commands - all without external dependencies.

Utilities
5 days ago
2.1
21
Character Cheats
Owner:
sumfeng
Source:
N/A
Homepage:
https://github.com/chat-ai-player
License:
MIT
Created:
8 days ago
Latest Version:
0.1.2 (5 days ago)
Factorio version:
2.1
Downloaded by:
21 users

Features:
- AI Character lifecycle (spawn, respawn on death, cleanup)
- Built-in A* pathfinding with collision avoidance
- 4 behavior modes: patrol_collect, build_patrol, auto_craft, combat_follow
- Dual-mode command parsing: keyword matching + LLM fallback
- In-game GUI panel with toolbar button and shortcut keys
- Real-time logging to script-output

Supports both keyword-only mode (no LLM required) and optional LLM integration for natural language understanding.

Requirements

  • Factorio >= 2.0.0
  • No external mod dependencies (pure base mod)

Quick Start

  1. Launch Factorio with the mod enabled
  2. Open chat and type !ai 创建AI (Chinese) or !ai spawn (English) to spawn an AI character
  3. Try these commands:

English Commands

Command What it does
!ai spawn Spawn a new AI character
!ai mine Collect all nearby resources
!ai mine iron Collect iron ore only
!ai mine iron copper Collect iron and copper
!ai build patrol Auto-build ghosts in the area
!ai auto craft Auto-craft materials from ghosts
!ai follow Follow player, auto-attack enemies
!ai stop Stop all AI behavior
!ai status Show AI status
!ai craft transport-belt 10 Craft 10 belts immediately
!ai goto 50,50 Move to coordinates (50,50)

Chinese Commands

Command What it does
!ai 创建AI Spawn a new AI character
!ai 采矿铁 Start patrol-collecting iron ore
!ai 采矿铁铜煤 Collect iron, copper, coal
!ai 巡逻建造 Auto-build ghosts in the area
!ai 自动手搓 Auto-craft materials from ghosts
!ai 战斗跟随 Follow player, auto-attack enemies
!ai 停止 Stop all AI behavior
!ai 查询AI Show AI status
!ai 手搓传送带10 Craft 10 belts immediately
!ai 移动到50,50 Move to coordinates (50,50)

Console Commands

Command Description
/ai Toggle GUI panel
/ai <command> Same as !ai <command>
/ai-spawn Spawn AI character at player
/reload Hot-reload mod code

Shortcuts

  • Ctrl+Alt+P — Toggle GUI panel
  • Ctrl+Shift+P — Confirm AI character selection

Behavior Modes

Mode Description
patrol_collect Cycle: scan resource patch → move → mine → return to depot → deposit
build_patrol Scan ghosts + deconstruction marks → fetch materials → move → build/deconstruct
auto_craft Scan ghosts → calculate material gaps → fetch ingredients → craft → store
combat_follow Follow player → detect enemies → auto-shoot → refill ammo from chests