Replay: If you have the code, just pick up decoder strips and skip all way to unlock treasure room safe - the code will be in chat box. If you didn't save the strips and can't remember the combination, follow the steps.
Enter the red barrier just north, and directly west of the armoured zombie room.
Head west, passing through 2 additional red barriers.
Inspect the tin soldier on the operating table in the south-western room.
Exit the castle.
Talk to the Trial Announcer at the east Varrock bank to get tin soldier head. (3•1•3)…
Can I have a tin soldier head?
I'd like to get ahead of competition.
I have to go.
Get 3 tin ores, 4 fire runes, and 1 nature rune.
Return to the tin soldier.
Inspect him thrice to activate him. (1)…
Use a vial of red mist on the tin soldier if it has not automatically been applied.
Getting the code
Return to the far eastern room.
Search the crate in the armoured zombie room for some decoder strips.
Kill another armoured zombie if you need to refill empty vial with red mist.
Enter the red barrier to the far north-western room.
Scry the scrying pool in the north-eastern corner. Select (1•2•3•4•5•6)…
New Varrock square
Throne room balcony
Garden of Hostility
(need to re-click on the scrying pool after each one) to unlock the medium New Varrock achievement Scrying Game, then (7)…
Control the tin soldier
to continue the quest.
As the tin soldier, enter the room north and search Zemouregal's lab desk for the code.
Unlock the treasure room safe (north-west corner of the north-west room) using the code you were given. Drag the red sliders over the numbers.