Working bot code generator

Truncation is weird on it, but it works...