So far: these are the three buttons which control the actual game. The outputs will need more functions I guess.

function tactic (bowmod bowrating perception range mentality resistance) {if tacticprompt=magic false bowmod=bowrating; if perception function fight (handweapon tactic physiquereservoir agilityreservoir monsterrisk) { if tactic+handweapon+physiquerervoir+agilityreservoir-random-monsterrisk < 0 true link="/YOUDIED.html"; physiquereservoir=tactic+handweapon+physiquereservoir+agilityr eservoir-random-monsterrisk; agilityreservoir=tactic+handweapon+agilityreservoir-random-monsterrisk; if agilityreservoir<0 true agilityreservoir=0}

function heal(groupsize sofar agilityreservoir agility physiquereservoir physique) {if groupsize>=sofar true healagilityreservoir=agility: if groupsize>=sofar and locale=city true physiquereservoir=physique}