I want to move all items in a room called Vault to the player, even though the player is not in that room. I cannot figure out the magic syntax to get past the Sphynx-like parser.
if Vault contains something:
say "Here are your assets....";
let L be the list of things in the Vault;
repeat with Item through L:
say "[Item]";
move Item to player;
The parser complains about let L be the list of things in the Vault.
I’ve tried so many combinations of words, including phrases that treat a room like a container (which I was told it was).
I’ve also tried to make the location the Vault, move the items, than reset the location back again. Didn’t work.
And apparently, try taking all] does not work in rules either.
How should I phrase it?
Your code seems to work fine for me except that repeat with Item through L should be repeat with Item running through L.
Full working code sample
Lab is a room.
Vault is a room.
A fish is in Vault. A rock is in Vault.
Instead of jumping:
if Vault contains something:
say "Here are your assets....";
let L be the list of things in the Vault;
repeat with Item running through L:
say "[Item]";
move Item to player;
Test me with "i / jump / i"
if the vault contains something:
say "Here are your assets... [a list of things in the Vault].";
repeat with Item running through things in the Vault:
move Item to player;
If your vault is just a vault, and won’t have scenery things in it, this should work. If you’re moving things to the player from a room with scenery, or people, this will also move the scenery and people to the player without complaining.
The lab is a room.
The vault is a room.
The rubber ball is in the vault.
The diamond ring is in the vault.
The gold tiara is in the vault.
The brown shoe is in the vault.
The desk is scenery in the vault.
Casper is a man in the vault.
The sun is a backdrop in the vault.
Instead of jumping:
if the vault contains something:
say "Here are your assets... [a list of things in the Vault].";
repeat with Item running through things in the Vault:
move Item to player.
Test me with "jump / i".