Initial commit — Minecraft AI God plugin
- mc_aigod.py: main watcher script (log tail, RCON, two-call LLM) - Two-call LLM split: qwen3-coder:30b for commands, gemma3:12b for messages - Divine intervention timer (Poisson process, configurable avg/day) - Prayer memory (persistent, last 10 exchanges) - Rolling server log context (last 20 min events) - Live player context (inventory with rarity, health, food, pos, XP) - /pray and bible chat detection (no slash — vanilla 1.21 compatible) - Login notice, bible help system - debug_commands toggle (in-game command display via tellraw) - Auto-fix for transposed give command syntax - JSON repair fallback for truncated LLM responses - Sentence-aware message chunking for long responses - mc-aigod.service systemd unit - mc_aigod_shrink.json example config - README.md full implementation guide - Minecraft_Ai_God.md full design document
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Sets slingshooter08 to creative mode on server 1 (mc1).
|
||||
Called by mc_godmode_watch.sh whenever slingshooter08 joins.
|
||||
|
||||
Deployed to: /usr/local/bin/mc_godmode_rcon.py on CT 644
|
||||
"""
|
||||
import socket, struct, time, sys
|
||||
|
||||
PLAYER = 'slingshooter08'
|
||||
|
||||
def rcon(cmd, host='127.0.0.1', port=25575, password='REDACTED_RCON'):
|
||||
s = socket.socket()
|
||||
s.settimeout(5)
|
||||
s.connect((host, port))
|
||||
def pkt(i, t, p):
|
||||
p = p.encode() + b'\x00\x00'
|
||||
return struct.pack('<iii', len(p)+8, i, t) + p
|
||||
s.sendall(pkt(1, 3, password))
|
||||
time.sleep(0.2)
|
||||
s.recv(4096)
|
||||
s.sendall(pkt(2, 2, cmd))
|
||||
time.sleep(0.2)
|
||||
r = s.recv(4096)
|
||||
s.close()
|
||||
return r[12:-2].decode()
|
||||
|
||||
print(rcon(f'gamemode creative {PLAYER}'))
|
||||
Reference in New Issue
Block a user