File size: 1,521 Bytes
9f49446
d2af10e
 
9f49446
d2af10e
9f49446
945076a
c4e7664
9f49446
 
d2af10e
 
9f49446
 
d2af10e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
title: PSCT to Lua
emoji: πŸƒ
colorFrom: purple
colorTo: blue
sdk: gradio
sdk_version: 5.6.0
python_version: 3.11
app_file: app.py
pinned: false
license: apache-2.0
short_description: Generate YGOPro Lua card scripts from English PSCT
---

# PSCT β†’ Lua

Generate working YGOPro Lua card scripts from English PSCT (Problem-Solving
Card Text).

Backed by **Qwen2.5-Coder-7B-Instruct** fine-tuned (LoRA) on ~13,000 real
card scripts from the `ygopro-scripts-master` repo, paired with their
English text from `cards_en.cdb`. Scripts in the cookbook section of the
[YGOPro Scripting Guide](https://github.com/ygopro/scripts) were
oversampled (5Γ—) so the model has strong priors for canonical patterns.

## How it works

1. You paste a card's English text into the textarea
2. The model produces a complete `cXXXX.initial_effect(c)` Lua script
3. You copy the script into your YGOPro `script/` folder

## Caveats

- Runs on the free 2-vCPU CPU tier β†’ **60-120 seconds per card**.
- Output is a starting point β€” review before using in production. The model
  is ~85-95% accurate on simple cards (draw, destroy, search), ~60-75% on
  multi-clause cards. Boss monsters with archetype-specific bookkeeping are
  largely out of distribution.
- Always verify by loading the generated script into YGOPro and probing
  the actual behavior in a duel.

## Reproducing

The training pipeline lives at
[github.com/serenade87/psct_to_lua](https://github.com/serenade87/psct_to_lua)
(`extract.py` β†’ `train.py` β†’ `infer.py`).