Script to only run on first use?
#3
Gibstick is right - that'll probably be the way you want to go - but in case you actually mean doing stuff only if saved.cfg doesn't exist - which is what triggers that initial setup-menu you spoke of:
add2alias delayed_firstrun [ echo "I'm doing some stuff of my own here!" ]
Naturally you'd probably want to call your own CubeScript-block (read alias) from it - just replace the (bracketed) CubeScript-block by your alias name:
add2alias delayed_firstrun my_firstrun
Another good alias to hook into is the mapstartonce, do that from autoexec.cfg and you can then use Gibstick's snippet to check whether you need to run your script or not.
my_setup = [
    my_setupOK = 1
    my_var_001 = 1
    my_var_002 = 2
    echo "done MY setup"
]
check_my_setup = [
    if (checkalias my_setupOK) [ ] [ my_setup ]
]
// the following is a handy shortcut:
addOnLoadOnce check_my_setup
HTH
Thanks given by:


Messages In This Thread
Script to only run on first use? - by VenteX - 12 Feb 11, 10:42PM
RE: Script to only run on first use? - by flowtron - 13 Feb 11, 12:25PM