115 lines
3.5 KiB
Plaintext
115 lines
3.5 KiB
Plaintext
#alias filehandler {
|
|
|
|
#if {%pos(/,%1)=1} {
|
|
#var devpath %homefolder;
|
|
} {
|
|
#var devpath @scpath
|
|
};
|
|
|
|
#if {%1="" or %2="" or %IfWord(%2,create|delete|edit|load|unload|reload,"|")=0} {
|
|
#say {
|
|
Syntax:
|
|
filehandler <path> <action>.
|
|
If the path is proceeded by a slash it will be automaticly switched to the user data of vip mud for this particular action.
|
|
the available actions are:
|
|
Create: create an empty file (note, works only in the vip mud data location);
|
|
Delete: delete a file (Note, works only in the vip mud data location.);
|
|
edit: edit a file.
|
|
load or unload: load or unload a file respectively;
|
|
Reload: Reloads a file.
|
|
The aliases have been provided for one's convenience and they include:
|
|
devo: Open a file;
|
|
Devr: reload a file;
|
|
Devc: create a file;
|
|
Devd: Delete a file;
|
|
Devl and devu: Load and unload a file respectively;
|
|
github1: Load files from your remote repositery if you use any;
|
|
github 0: to switch back to your local copy;
|
|
github h: To display help for github;
|
|
Github r: to reload everything in case everything breaks.
|
|
Enjoy!};
|
|
#abort;
|
|
};
|
|
|
|
#if {%2="load"} {
|
|
#load {@devpath/%1.set};
|
|
devannounce %1 %2
|
|
};
|
|
|
|
#if {%2="unload"} {
|
|
#unload {@devpath/%1.set};
|
|
devannounce %1 %2
|
|
};
|
|
|
|
#if {%2="edit"} {
|
|
#edit {@devpath/%1.set};
|
|
devannounce %1 %2
|
|
};
|
|
|
|
#if {%2="reload"} {
|
|
#unload {@devpath/%1.set};
|
|
#load @devpath/%1.set;
|
|
devannounce %1 %2
|
|
};
|
|
|
|
#if {%2="delete" or %2="create"} {
|
|
#if {%pos(%homefolder,@devpath)=0} {
|
|
#say {this function can work only with the home folder of vip mud: %homefolder, and you used @devpath}
|
|
} {
|
|
#if {%2="create"} {
|
|
#file 9 {%replace(%1,/,).set};
|
|
#write 9 { } 1;
|
|
#close 9;
|
|
devannounce %1 %2;
|
|
};
|
|
#if {%2="delete"} {
|
|
devannounce %1 %2;
|
|
#var devfilename %1;
|
|
#alarm 0.20 {
|
|
#say {Are you sure that you would like to delete @devpath/@devfilename.set?} VoiceOnly
|
|
};
|
|
#pick {P:Are you sure|yes:#DelFile %1.set|*No:#abort all};
|
|
};
|
|
};
|
|
};
|
|
#unvar devpath
|
|
}
|
|
|
|
#alias devannounce {
|
|
#if {%pos(/,%1)=1} {
|
|
#say {Initiated %2 at @devpath/%replace(%1,/,).set}
|
|
} {
|
|
#say {Initiated %2 at @devpath/%1.set}
|
|
};
|
|
#play {@sppath/general/misc/loadingfile.wav} @vol;
|
|
}
|
|
|
|
#alias devo {filehandler %1 edit}
|
|
#alias devr {filehandler %1 reload}
|
|
#alias devd {filehandler %1 delete}
|
|
#alias devl {filehandler %1 load}
|
|
#alias devu {filehandler %1 unload}
|
|
#alias devc {filehandler %1 create}
|
|
#alias dev {filehandler help}
|
|
|
|
#alias github {
|
|
#if {%1=1} {#if {%defined(githubpath)=0} {#say {Couldn't find path to your github repo, please define the githubpath variable first}} {
|
|
#if {@scpath = @githubpath} {#say {You are switched to github already}} {
|
|
#say {switching to github};
|
|
#unload {@scpath/main.set};#ForAll @loadtask {#unload {@scpath/%i.set}};
|
|
#var oldscpath @scpath; #var scpath @githubpath;
|
|
#load {@scpath/main.set};
|
|
#say {Loaded script files from @scpath}}}};
|
|
#if {%1=0} {#if {%defined(oldscpath)=0} {#say {No Old Script Path Found, probably because you have not loaded yet}} {
|
|
#unload {@scpath/main.set};#ForAll @loadtask {#unload @scpath/%i.set};
|
|
#var scpath @oldscpath; #unvar oldscpath;
|
|
#load {@scpath/main.set};
|
|
#say {Loaded script files from @scpath}}};
|
|
#if {%1="h"} {#say {
|
|
Define the variable githubpath somewhere, preferebly in cosmic rage.set. Githubpath should be a list containing path to your github repo scripts folder.
|
|
Then type github 1 to switch to github, and github 0 to return to your local copy.
|
|
If things break, type github r and it will reload your session.
|
|
Have fun!}};
|
|
#if {%1="r"} {#reload}}
|
|
|
|
#var githubpath {D:\my files\repos\VIPMudCosmicRageScripts\scripts} |