Arqade is a question and answer site for passionate videogamers on all platforms. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to create and store a function in skyrim for future use? I don't like having to re-enter codes all the time of what I commonly use, so I'd rather I be able to just call a function like function items() and it it activates something like

function items() {
  player.additem xxxxxx;
  player.additem xxxxxx;
  player.additem xxxxxx;

Or even just be able to store and call a variable via command line like:

$gem=player.additem 2E504 10;
share|improve this question

I'm not aware of a way to use variables, but it is possible to create function-like batch scripts.

This can be done by creating an ordinary text file containing the commands you wish to run together (one per line, CRLF, no other delimiters). Save this file as e.g. myscript.txt in your Skyrim folder (in the same location as TESV.exe). In-game, you can then run this script via the bat console command:

bat myscript

Unfortunately, this does not appear to support arguments, so cannot be parameterized.

share|improve this answer
nice. gonna leave the question open for a couple of days to see if anyone has anything else. – Mechaflash Nov 23 '11 at 8:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.