Topic: [SUGGESTION]def,undef,undefall,dump_defs commands in console
Hi all! I've written 4 new commands for tee console:
def ssr
undef s
undefall
dump_all
command def allows you define a new command for console.
Syntax:
def command_name "Help message" "action"
Example:
def hook_fire "Hooks and fires at one time" "+hook;+fire"
then you can use them just like any command:
bind p hook_fire
Defined commands are saved to config file on exit and aer loaded on console init.
They are showed in command list with help just like any other command.
You can undefine defined commands using undef command:
undef hook_fire
Or undefine all commands using
undefall
You can watch list of defines:
dump_defs
Defined commands are protected from recursive calls:
def recurse "Trying to raise an error" recurse
recurse
will not raise an error. It'll write:
Recursive calls are prohibited!
I suggest to include this function in new version.
P.S. Have I got rights to upload files to svn of Teeworlds?
P.P.S. In archive there is a patch to 0.5.x version and 2 new files, please check if all is ok(it's my first patch)