I'll give you an example of what I'm trying to accomplish.
Using twine2 (where I started) I could programmatically set and manipulate variables by directly referencing other variables as such (I'll explain the syntax a bit for anyone unfamiliar with twine).
Initialize and set my variables
// data map is equivalent to dict
$Inv = (dm: potion, 0, bomb, 0, gold, 0);
// array
$PossibleRewards =(a: potion, bomb, gold);
// string
$Reward "";
Then
set $Reward to (shuffled... $PossibleReward's 1st);
set $Inv's $Reward to it +1;
So what it does is simply shuffle the PossibleRewards array, choses the first entry then sets the Reward string to what was chosen, then automatically increases the Inv data maps appropriate entry by one.
Of course you could skip the string and just go
set $Inv's (shuffled... $PossibleReward's 1st to ot +1
I know it can be done, but need some help with the syntax, any input is appreciated