|
oxseyn Wanderer
Joined: 26 Nov 2011 Posts: 71 Location: Colorado Springs
|
Posted: Sat Mar 24, 2012 2:19 pm
Nonpersistent Scripts & Grouping Code |
So far, I've been trying to configure everything in the GUI. I come from a tintin background where typically you create script files and then load/unload them on demand. They are not persistent between sessions.
Is there a way to have a similar setup in cmud?
I.E. I would bundle all my variables & triggers that do prompt detection into a single class that is defined in a single text file. Then the only persistent configuration in my character file would be like:
#FILE 1 scripts/prompt-detection.zscript
Then when I closed the session, everything loaded via that file would be removed.
The reason I ask, is because it's easier for me to visualize how something like this works:
Code: |
#VAR prompt.command $$name [$hsat $tox $soak $full] [$exp $qp $gold] $ral:$space
#VAR prompt.regex ^\%\w+ \[\d+\% \d+\% \d+\% \d+\%\] \[\d+ \d+ \d+\] \w+\:\s+
#TRIGGER "Capture Prompt" {@prompt.regex} {
#VAR prompt.name %1
#VAR prompt.hsat %2
#VAR prompt.tox %3
#VAR prompt.soak %4
#VAR prompt.exp %5
#VAR prompt.qp %6
#VAR prompt.gold %7
#VAR prompt.align %8
}
|
Yes, I know that doesn't actually work - I'm still working on it. But storing all the individual bits of code in different windows around the GUI is rather obnoxious. If I can't store it in an external script as I asked above - is there a way to store it all in a single script in the GUI (in a way that won't behave strangely? |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Mar 24, 2012 5:11 pm |
Doing what you want involves the use of #READ/%read() and the various #UNsetting commands (#UNTRIGGER, #UNVAR, #UNMENU, etc). In some cases, you may even be able to use #KILLALL. Keep in mind that this process is very much slower and inefficient than #T+/#T-.
Beyond this, you can do xml imports (CMud no longer imports from text except as explained above), but there is no way to script this. There is no way to set scripts to automatically delete themselves after use, so removal is also only as described above. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|