A "write2cfg" command that would append .cfg files with the given string. The first argument could be the file to write to, if it already exists, just append, if it doesn't exist, create + write. This would open up a whole world of possibilities but one example would be self-installing scripts.
Pseudo-code:
arg1 = path/filename w/o extension
arg2 = string to write
And a few other idents to play along with it:
"strstrcfg" - searches entire .cfg files for x and returns 1 if it finds it, else returns 0.
"strcmpcfg" - searches entire .cfg files for an exact match of string y and returns 1 if it finds it, else returns 0.
More pseudo-code:
Pseudo-code:
[SELECT ALL] Code:
if (checkalias wrote2autoexec) [] [alias wrote2autoexec 0]
if $wrote2autoexec [] [alias wrote2autoexec 1; write2cfg config/autoexec [alias mapstartalways [echo Hello World!]]]
arg1 = path/filename w/o extension
arg2 = string to write
And a few other idents to play along with it:
"strstrcfg" - searches entire .cfg files for x and returns 1 if it finds it, else returns 0.
"strcmpcfg" - searches entire .cfg files for an exact match of string y and returns 1 if it finds it, else returns 0.
More pseudo-code:
[SELECT ALL] Code:
if (strstrcfg config/autoexec "countloop") [] [write2cfg config/autoexec [alias countloop [loop i 10 [echo (+ $i 1)]]]] // Writes the countloop script to the autoexec.cfg if the word "countloop" is nowhere to be found in the autoexec.cfg already
[SELECT ALL] Code:
if (strcmpcfg config/menus_settings.cfg "newmenu [My Custom Settings Menu]") [] [write2cfg config/menus_settings.cfg [newmenu [My Custom Settings Menu]; menuitemslider [Gun sway: ] 0 1 [$maxroll] 1 ["enabled" "disabled"] [nosway $arg1]]]// Writes the custom menu to menus_settings.cfg only if the exact string "newmenu [My Custom Settings Menu]" is nowhere to be found in menus_settings.cfg already