the Bruce was gradually getting possession of the
country, and driving out the English, Edinburgh, the principal town in Scotland,
with its strong castle, remained in possession of the invaders. Sir
Thomas Randolph was extremely desirous to gain this important place; but,
as you well know, the castle is situated on a very steep and lofty rock, so
that it is difficult or almost impossible even to get up to the foot of
the walls, much more to climb over them.
So while Randolph was considering what was to be done, there came to him a Scottish gentleman, named Francis, who had joined Bruce's standard, and asked to speak to him in private. He then told Randolph that in his youth he had lived in the castle of Edinburgh, and that his father had then been keeper of the fortress. It happened at that time that Francis had been much in love with a lady, who lived in the part of the town beneath the castle, which is called the Grassmarket.
Now, as he could not get out of the castle by day to see his mistress, he had practised a way by night of clambering down the castle rock on the south side, and returning at his pleasure; when he got to the foot of the wall, he made use of a ladder to get over it, as it was not very high at that point, those who built it having trusted to the steepness of the crag; and for the same reason, no watch was placed there. Francis had come and gone so frequently in this dangerous manner, that, though it was so long ago, he told Randolph he knew the road so well that he would undertake to guide a small party of men by night to the bottom of his wall; and as they might bring ladders with them, there would be no difficulty in scaling it. The great risk was that of being discovered by the watchmen while in the act of ascending the cliff, in which case every man of them would perish.
Nevertheless, Randolph did not hesitate to attempt the adventure. He took with him only thirty men and came one dark night to the foot of the rock, which they began to ascend under the guidance of Francis. The men were obliged to follow in a line a path fitter for a cat than a man. When they were far up the crag, near the foundation of the wall, one of the soldiers of the castle, willing to startle his comrades, suddenly threw a stone from the wall and cried out "Aha, I see you well." The stone came thundering down past the heads of Randolph and his men, who naturally thought themselves discovered. If they had stirred, or made the slightest noise, they would have been entirely destroyed; for the soldiers above might have killed every one of them, merely by rolling down stones... But the English passed on without further examination.
Then Randolph and his men got up, and came in haste to the foot of the wall. They planted the ladder which they had brought, and Francis mounted first to show them the way; Sir Andrew Grey, a brave knight, followed him, and Randolph himself was the third man to get over. Then the rest followed. When once they were within the walls, there was not much to be do, for the garrison were asleep and unarmed, excepting the watch, who were speedily destroyed. Thus was Edinburgh Castle taken in March 1313."
Sir Walter Scott in Tales of a Grandfather