The Pillory is a random event during which you are teleported you to one of three cages in Yanille, Varrock (located behind the General Store), or Seers' Village. The host, a tramp, throws rotten tomatoes at you while you solve the puzzle to escape.
Traditionally, this random event only appeared while Thieving. However, with the update that made random events optional, the Pillory Guard will now appear at any time and you may choose to be arrested by him and taken to the pillory. The Pillory Guard will even appear on F2P worlds, where players do not have access to the Thieving skill, but players on these worlds can only be teleported to the pillory in Varrock.
Click on the lock to the cage that you are in. A screen will appear with a large lock on the left of the screen, three small locks at the top, and three keys swinging at the bottom. Click on the key that matches the large lock on the left. You must correctly unlock three locks, shown by the three locks at the top, to escape. Upon escaping, you will be teleported to where you were when you were arrested and given a reward.
Item Quantity Rarity GE market price Coins 20–640 Common Not sold Uncut sapphire 1 Common 511 Uncut emerald 1 Uncommon 688 Uncut ruby 1 Rare 1,342 Uncut diamond 1 Very rare 2,811