
import json

original = [
    (0,10),(1500,20),(3000,10),(4500,30),
    (6000,15),(7500,35),(9000,10),(11000,40),
    (12500,20),(14000,45),(15500,10),(17500,50),
    (19000,25),(20500,55),(22000,15),(24000,40),
    (25500,60),(27000,20),(28500,50),(30000,10),
    (32000,65),(33500,30),(35000,55),(36500,15),
    (38000,70),(40000,20),(41500,60),(43000,25),
    (44500,75),(46000,10),(48000,50),(49500,70),
    (51000,30),(52500,65),(54000,15),(56000,75),
    (57500,35),(59000,60),(60500,20),(62000,80),
    (64000,25),(65500,65),(67000,35),(68500,75),
    (70000,15),(72000,60),(73500,80),(75000,30),
    (76500,65),(78000,20),(80000,75),(81500,40),
    (83000,60),(84500,25),(86000,45),(88000,20),
    (90000,0)
]

cycle = 90000
duration = 7200000

actions = []
for offset in range(0, duration, cycle):
    for t, pos in original:
        if offset + t <= duration:
            actions.append({
                "at": offset + t,
                "pos": pos
            })

script = {
    "version": "1.0",
    "inverted": False,
    "range": 100,
    "actions": actions
}

with open("Diamo_Original_2_Hour.funscript", "w") as f:
    json.dump(script, f)

print("Created Diamo_Original_2_Hour.funscript")
