 |
JWhitney Wanderer
Joined: 20 Oct 2006 Posts: 51
|
Posted: Wed Jan 12, 2011 4:13 am
[3.33a] Some Scripts Not Working After Upgrading CMUD 2.37 -> 3.33a |
Although I had purchased CMUD over 2 years ago, and had upgrades up to 2.37, I was using zMUD up until 2 weeks ago when I finally decided to port over my entire .MUD file and make the necessary adjustments. I installed CMUD 2.37 and imported my massive settings file nearly line-by-line, due to most of it being badly written over 13 years ago and incompatible. It took about 3 days, but I got just about everything up and running (much faster and more effectively than it ever had in zMUD) and decided to go ahead and buy the upgrade from 2.37 to 3.33a. I didn't expect there would be much further rewriting necessary, but evidently there were some scripting changes I am unaware of. I've located and fixed some of them, but there is a major one that is eluding me, and it just happens to be a game-breaking bug.
I use a very complex system of string list variables, triggers and aliases to take me from one mob to the next. I got them working normally after the move from zMUD 7.21 to CMUD 2.37, but I can't seem to find the wrench in the works in CMUD 3.33a. Were there any significant scripting changes that I should be looking for? I'll post the example code, but it is massive and I don't expect anyone to pore over it bit by bit.
What seems to be happening is that instead of loading line 1 from the string list variable, it skips a few lines in and I can't seem to place where or why.
Thank you for your time.
Variable String List containing paths to each 'room'. I've cut it much shorter, but basically it is a list of 95+ lines (rooms).
| Code: |
- <cmud>
- <var name="script_money" type="StringList">
<value>#VAR script_room_name {Eoman};9 s;20 w;w;2 s;climb;d;w;sw;2 s;e;s;2 ne;plains;whistle;ride horse to revelstone;n;w;u;w;n;#VAR lock {eoman};#VAR script_next_room {Eoman};where|#VAR script_next_cs {10};w;2 n;where|2 s;W;S;where|4 e;where|2 e;where|4 e;where|2 n;w;2 n;where|3 s;where|n;w;#VAR script_next_room {CS};where|#VAR script_room_name {CS};s;w;d;w;s;ride horse to plains;watch;climb;ne;20 e;10 n
</var>
</cmud>
|
Alias 'go' which #pick's which script I want to run, then loads the necessary string lists in to the variables that will later be expanded and sent to the MUD.
| Code: |
<cmud>
- <alias name="go">
<value>#VAR script_area_name {None} #VAR script_current_area {None} #VAR script_current_room {1} #VAR script_area_list {} #PICK {p:Which areas would you like to run?} {Money Areas:#ADDITEM script_area_list {money}} #VAR script_area_name {%item( @script_area_list, 1)} #VAR script_current_area {"@script_"%pop(script_area_list)} #VAR script_current_area {%expand(@script_current_area)} #VAR script_next_area {1} recap_start_script #ADDITEM script_area_list {END}</value>
</alias>
</cmud>
|
Alias 'next' which sends the commands loaded from the script_money variable, by %pop'ing off the next line, sending that to the MUD, and so on.
| Code: |
- <cmud>
- <alias name="next">
<value>#IF (@script_area_list != END AND @script_current_room = %numitems( @script_current_area)) { #SAY - CS - #VAR script_area_name {%item( @script_area_list, 1)} #VAR script_current_area {"@script_"%pop( script_area_list)} #VAR script_current_area {%expand( @script_current_area)} #VAR script_current_room {1} #VAR script_next_area {1} #VAR room_player_count {0} #VAR room_mob_count {0} } #IF (@script_area_list = END AND @script_current_room = %numitems( @script_current_area)) { #EXEC %item( @script_current_area, @script_current_room) #VAR script_current_room {1} room_change #WINDOW {Messages} {%time( "ddd hh:nnam/pm") ---- Script End} reset_script } { #EXEC %item( @script_current_area, @script_current_room) #VAR script_current_room {%eval( @script_current_room + 1)} room_change #IF (%class( Auto_Script) = 1) {auto_command} {manual_command} #IF (@script_next_area = 1) { #WINDOW {Messages} {%time( "ddd hh:nnam/pm") ---- Area: %replace( %upper( @script_area_name), _, " ") | Rooms: %numitems( @script_current_area) | Remaining: %upper( %replace( @script_area_list, _, " "))} #VAR script_next_area {0} } }</value>
</alias>
</cmud>
|
|
|
|
|
 |
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Wed Jan 12, 2011 4:31 pm |
There is something odd about your aliases. All of your commands are on a single line--no carriage returns or semicolons to separate them. It won't work that way.
|
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Jan 12, 2011 5:28 pm |
I recommend using the Reformat Script option in the CMUD settings editor to convert your script to a proper multi-line script and then use the Check Syntax to make sure there are no syntax errors.
My guess is that the script originally came from zMUD which is why it's all in one line. |
|
|
|
 |
JWhitney Wanderer
Joined: 20 Oct 2006 Posts: 51
|
Posted: Wed Jan 12, 2011 5:37 pm |
They aren't all on one line actually. Not sure if that is just how the XML exporting makes them look, but Reformat Script and Check Syntax features were the first things I used after noticing they didn't work in 3.33a. In CMUD, they actually look like:
| Code: |
#IF (@script_area_list != END AND @script_current_room = %numitems( @script_current_area)) {
#SAY - CS -
#VAR script_area_name {%item( @script_area_list, 1)} #VAR script_current_area {"@script_"%pop( script_area_list)}
#VAR script_current_area {%expand( @script_current_area)}
#VAR script_current_room {1}
#VAR script_next_area {1}
#VAR room_player_count {0}
#VAR room_mob_count {0}
}
#IF (@script_area_list = END AND @script_current_room = %numitems( @script_current_area)) {
#EXEC %item( @script_current_area, @script_current_room)
#VAR script_current_room {1}
room_change
#WINDOW {Messages} {%time( "ddd hh:nnam/pm") ---- Script End}
reset_script
} {
#EXEC %item( @script_current_area, @script_current_room)
#VAR script_current_room {%eval( @script_current_room + 1)}
room_change
#IF (%class( Auto_Script) = 1) {auto_command} {manual_command}
#IF (@script_next_area = 1) {
#WINDOW {Messages} {%time( "ddd hh:nnam/pm") ---- Area: %replace( %upper( @script_area_name), _, " ") | Rooms: %numitems( @script_current_area) | Remaining: %upper( %replace( @script_area_list, _, " "))}
#VAR script_next_area {0}
}
}
|
With the proper arrows on the left side, showing relationship to nested #IF's. |
|
|
|
 |
shalimar GURU

Joined: 04 Aug 2002 Posts: 4797 Location: Pensacola, FL, USA
|
Posted: Wed Jan 12, 2011 8:32 pm |
i see two #VAR statements on one line (3), for one thing
|
|
|
|
 |
Progonoi Magician
Joined: 28 Jan 2007 Posts: 430
|
Posted: Wed Jan 12, 2011 9:05 pm Re: [3.33a] Some Scripts Not Working After Upgrading CMUD 2.37 -> 3.33a |
| JWhitney wrote: |
Variable String List containing paths to each 'room'. I've cut it much shorter, but basically it is a list of 95+ lines (rooms).
| Code: |
- <cmud>
- <var name="script_money" type="StringList">
<value>#VAR script_room_name {Eoman};9 s;20 w;w;2 s;climb;d;w;sw;2 s;e;s;2 ne;plains;whistle;ride horse to revelstone;n;w;u;w;n;#VAR lock {eoman};#VAR script_next_room {Eoman};where|#VAR script_next_cs {10};w;2 n;where|2 s;W;S;where|4 e;where|2 e;where|4 e;where|2 n;w;2 n;where|3 s;where|n;w;#VAR script_next_room {CS};where|#VAR script_room_name {CS};s;w;d;w;s;ride horse to plains;watch;climb;ne;20 e;10 n
</var>
</cmud>
|
|
How can you have #VAR calls within the Variable value. At the very least You should perhaps turn all this into a DB Variable, but I'm not even sure I understand what all is going on in the value bit quoted. You essentially have "#var variable_name value" inserted throughout ANOTHER variable's value.
Has been many, many months since I last scripted or mudded, but all this seems way too weird to me. |
|
_________________ The Proud new owner of CMud.
--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
-------------------------------- |
|
|
 |
JWhitney Wanderer
Joined: 20 Oct 2006 Posts: 51
|
Posted: Wed Jan 12, 2011 9:11 pm |
Woops, cut & paste error or something I guess. Just to be safe, I went over each line of the string list and the aliases, none have multiple commands on one line. Still at a loss as for what changed between 2.37 and 3.33a that would cause this to break. :/
|
|
|
|
 |
JWhitney Wanderer
Joined: 20 Oct 2006 Posts: 51
|
Posted: Wed Jan 12, 2011 9:14 pm |
| Quote: |
"How can you have #VAR calls within the Variable value. At the very least You should perhaps turn all this into a DB Variable, but I'm not even sure I understand what all is going on in the value bit quoted. You essentially have "#var variable_name value" inserted throughout ANOTHER variable's value.
Has been many, many months since I last scripted or mudded, but all this seems way too weird to me." |
The #EXEC commands in the 'next' alias expand the commands to define the nested variables inside the string list. It has worked since zMUD ~6 or so, up through 2.37 at least. It still works in 3.33a, as far as defining the nested variables. |
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu Jan 13, 2011 5:33 pm |
String Lists and Database Variables changed significantly internally to CMUD in the v3.x series. When exporting a String List, there should be a "JSON" section in the XML that will show the actual internal structure. I'm not sure why your posted XML doesn't contain that. Can you be sure you are posting the XML output from CMUD v3.33 and not v2.37?
|
|
|
|
 |
JWhitney Wanderer
Joined: 20 Oct 2006 Posts: 51
|
Posted: Fri Jan 14, 2011 3:16 am |
Hmm that is strange. Before I even installed 3.33a, I backed up my settings folder and uninstalled 2.37, so it couldn't have been exported from that, but the JSON line wasn't in the original export. Anyways, just exported it again to verify and the JSON line is there. Last time I posted the XML of the string list, I cut the length of the string list down drastically - just in case it is relevant, I am leaving it intact here.
As a side-note - thank you for personally taking the time to look at these forums, Zugg. For 13+ years, I have used your products, and have checked these forums regularly. Your name has always showed up on at least every third or fourth thread. There aren't many business owners who take customer service so seriously. Your hard work is sincerely appreciated.
| Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<var name="script_money" type="StringList">
<value>#VAR script_room_name {Eoman};#WINDOW {Messages} {%time( "ddd hh:nnam/pm") ---- Money Script Started};9 s;20 w;w;2 s;climb;d;w;sw;2 s;e;s;2 ne;plains;whistle;ride horse to revelstone;n;w;u;w;n;#VAR lock {eoman};#VAR script_next_room {Eoman};where|#VAR script_next_cs {10};w;2 n;where|2 s;W;S;where|4 e;where|2 e;where|4 e;where|2 n;w;2 n;where|3 s;where|n;w;#VAR script_next_room {CS};where|#VAR script_room_name {CS};s;w;d;w;s;ride horse to plains;watch;climb;ne;20 e;10 n;#VAR script_next_room {Woodhelven}|#VAR script_next_cs {23};#VAR script_room_name {Woodhelven};9 s;20 w;w;2 s;climb;d;w;sw;2 s;e;s;2 ne;plains;whistle;ride horse to woodhelven;se;2 u;2 s;#VAR lock {woodhelven};where|2 n;E;where|W;where|3 e;enter;where|out;u;NW;where|SE;where|nw;enter;where|out;2 w;where|2 e;u;W;where|E;w;where|w;enter;where|out;u;#VAR script_next_room {CS};where|#VAR script_room_name {CS};5 d;nw;ride horse to plains;watch;climb;ne;20 e;10 n;#VAR script_next_room {Hobgoblins}|#VAR script_next_cs {30};#VAR script_room_name {Hobgoblins};16 e;3 s;12 se;path;3 s;e;#VAR lock {goblin};where|s;where|s;where|S;2 e;where|e;n;where|n;#VAR script_next_room {CS};where|#VAR script_room_name {CS};S;W;N;W;N;path;12 nw;3 n;16 w;#VAR script_next_room {Dryads}|#VAR script_next_cs {33};#VAR script_room_name {Dryads};16 e;3 s;12 se;path;S;E;n;E;#VAR lock {dryad};where|s;#VAR script_next_room {CS};where|#VAR script_room_name {CS};N;W;S;W;N;path;12 nw;3 n;16 w;#VAR script_next_room {Stout Goblins x2}|#VAR script_next_cs {41};#VAR script_room_name {Stout Goblins x2};11 n;8 ne;path;3 w;n;#VAR lock {goblin};where;#VAR script_next_room {Stout Goblins x4}|#VAR script_room_name {Stout Goblins x4};2 n;where;#VAR script_next_room {Stout Goblins x2}|#VAR script_room_name {Stout Goblins x2};w;s;where|n;3 e;where|e;3 n;where|2 e;2 s;e;where|w;2 n;2 w;3 s;2 w;s;#VAR script_next_room {CS};where|#VAR script_room_name {CS};E;S;e;path;8 sw;11 s;#VAR script_next_room {Cleaners x3}|#VAR script_next_cs {48};#VAR script_room_name {Cleaners x3};15 n;2 ne;5 n;forest;4 n;E;#VAR lock {cleaner};where|#VAR script_room_name {Cleaners x3};N;#VAR script_next_room {Cleaners x1};where|#VAR script_room_name {Cleaners x1};2 s;#VAR script_next_room {Cleaners x3};where|#VAR script_room_name {Cleaners x3};N;W;#VAR script_next_room {Cleaners x1};where|#VAR script_room_name {Cleaners x1};3 s;#VAR script_next_room {Cleaners x3};where|#VAR script_room_name {Cleaners x3};S;#VAR script_next_room {CS};where|#VAR script_room_name {CS};2 e;4 s;out;5 s;2 sw;15 s;#VAR script_next_room {Old Elves}|#VAR script_next_cs {53};#VAR script_room_name {Old Elves};15 n;2 ne;5 n;forest;4 s;sw;se;w;#VAR lock {elf};where|2 e;where|w;s;w;where|2 e;#VAR script_next_room {CS};where|#VAR script_room_name {CS};w;n;nw;ne;4 n;out;8 s;2 w;14 s;#VAR script_next_room {Broxima}|#VAR script_next_cs {57};#VAR script_room_name {Broxima};16 n;gateway;#VAR lock {samurai};where|n;where|s;e;#VAR script_next_room {CS};where|#VAR script_room_name {CS};w;17 s;#VAR script_next_room {Sirros}|#VAR script_next_cs {62};#VAR script_room_name {Sirros};10 s;20 w;20 w;18 n;trail;#VAR lock {human};3 s;where|2 s;where|2 e;where|n;#VAR script_next_room {CS};where|#VAR script_room_name {CS};s;2 w;N;path;18 s;20 e;20 e;10 n;#VAR script_next_room {Greyhawk - Giants}|#VAR script_next_cs {70};#VAR script_room_name {Greyhawk - Giants};12 n;12 w;6 s;enter;d;w;se;ne;#VAR lock {giant};#VAR script_next_room {Greyhawk - Eye};where|#VAR script_room_name {Greyhawk - Eye};2 n;#VAR lock {eye};#VAR script_next_room {Greyhawk - Diamond};where|#VAR script_room_name {Greyhawk - Diamond};2 s;sw;nw;2 n;break sphere;#SAY WAIT FOR DIAMOND!;#VAR script_next_room {GryHk - Minitaurs x5};where|#VAR script_room_name {GryHk - Minitaurs x5};get diamond;n;#VAR lock {minitaur};#VAR script_next_room {Greyhawk - Burt};where|#VAR script_room_name {Greyhawk - Burt};3 s;W;n;d;#VAR lock {burt};#VAR script_next_room {Greyhawk - Zando};where|#VAR script_room_name {Greyhawk - Zando};n;open cage;#VAR lock {zando};#VAR script_next_room {Greyhawk - Gunter};where|#VAR script_room_name {Greyhawk - Gunter};s;u;search rug;se;#VAR lock {goblin};#VAR script_next_room {CS};where|#VAR script_room_name {CS};nw;s;E;u;out;6 n;12 e;12 s;#VAR script_next_room {Tyrir Forest}|#VAR script_next_cs {73};#VAR script_room_name {Tyrir Forest};9 w;20 sw;20 w;s;4 w;trail;n;2 w;n;#VAR lock {torturer};where;kill torturer;where|e;n;w;#VAR lock {leader};#VAR script_next_room {CS};where|#VAR script_room_name {CS};e;S;E;S;out;4 e;n;20 e;20 ne;9 e;#VAR script_next_room {Mithil Stonedown}|#VAR script_next_cs {83};#VAR script_room_name {Mithil Stonedown};9 s;20 w;w;2 s;climb;d;w;sw;6 s;sw;w;nw;sw;w;#VAR lock {stonedowner};where|N;where|S;where|2 n;W;where|E;where|2 w;SW;where|NE;where|sw;SE;where|NW;#VAR script_next_room {CS};where|#VAR script_room_name {CS};se;e;ne;se;e;ne;se;6 n;ne;e;u;climb;ne;20 e;10 n;#VAR script_next_room {Barracks}|#VAR script_next_cs {87};#VAR script_room_name {Barracks};13 s;2 sw;in;3 w;#VAR lock {recruit};where|e;n;w;where|e;s;2 e;u;2 w;n;w;#VAR script_next_room {CS};where|#VAR script_room_name {CS};e;s;2 e;d;out;2 ne;13 n;#VAR script_next_room {Gremlins x4}|#VAR script_next_cs {95};#VAR script_room_name {Gremlins x4};10 w;9 sw;20 w;forest;n;cave;e;#VAR lock {guard};where;#VAR script_next_room {Gremlins x2}|#VAR script_room_name {Gremlins x2};s;e;where;#VAR script_next_room {Gremlin x1}|#VAR script_room_name {Gremlins x1};n;where;#VAR script_next_room {Gremlins x2}|#VAR script_room_name {Gremlins x2};n;where;#VAR script_next_room {Slpng Grmlns x2}|#VAR script_room_name {Slpng Grmlns x2};n;where;#VAR script_next_room {Gremlin x1}|#VAR script_room_name {Gremlin x1};e;where;#VAR script_next_room {Gremlins x2}|#VAR script_room_name {Gremlins x2};e;where;#VAR script_next_room {CS}|#VAR script_room_name {CS};2 w;3 s;w;n;w;out;2 s;20 e;9 ne;10 e</value>
<json>["#VAR script_room_name {Eoman};#WINDOW {Messages} {%time( \"ddd hh:nnam\/pm\") ---- Money Script Started};9 s;20 w;w;2 s;climb;d;w;sw;2 s;e;s;2 ne;plains;whistle;ride horse to revelstone;n;w;u;w;n;#VAR lock {eoman};#VAR script_next_room {Eoman};where","#VAR script_next_cs {10};w;2 n;where","2 s;W;S;where","4 e;where","2 e;where","4 e;where","2 n;w;2 n;where","3 s;where","n;w;#VAR script_next_room {CS};where","#VAR script_room_name {CS};s;w;d;w;s;ride horse to plains;watch;climb;ne;20 e;10 n;#VAR script_next_room {Woodhelven}","#VAR script_next_cs {23};#VAR script_room_name {Woodhelven};9 s;20 w;w;2 s;climb;d;w;sw;2 s;e;s;2 ne;plains;whistle;ride horse to woodhelven;se;2 u;2 s;#VAR lock {woodhelven};where","2 n;E;where","W;where","3 e;enter;where","out;u;NW;where","SE;where","nw;enter;where","out;2 w;where","2 e;u;W;where","E;w;where","w;enter;where","out;u;#VAR script_next_room {CS};where","#VAR script_room_name {CS};5 d;nw;ride horse to plains;watch;climb;ne;20 e;10 n;#VAR script_next_room {Hobgoblins}","#VAR script_next_cs {30};#VAR script_room_name {Hobgoblins};16 e;3 s;12 se;path;3 s;e;#VAR lock {goblin};where","s;where","s;where","S;2 e;where","e;n;where","n;#VAR script_next_room {CS};where","#VAR script_room_name {CS};S;W;N;W;N;path;12 nw;3 n;16 w;#VAR script_next_room {Dryads}","#VAR script_next_cs {33};#VAR script_room_name {Dryads};16 e;3 s;12 se;path;S;E;n;E;#VAR lock {dryad};where","s;#VAR script_next_room {CS};where","#VAR script_room_name {CS};N;W;S;W;N;path;12 nw;3 n;16 w;#VAR script_next_room {Stout Goblins x2}","#VAR script_next_cs {41};#VAR script_room_name {Stout Goblins x2};11 n;8 ne;path;3 w;n;#VAR lock {goblin};where;#VAR script_next_room {Stout Goblins x4}","#VAR script_room_name {Stout Goblins x4};2 n;where;#VAR script_next_room {Stout Goblins x2}","#VAR script_room_name {Stout Goblins x2};w;s;where","n;3 e;where","e;3 n;where","2 e;2 s;e;where","w;2 n;2 w;3 s;2 w;s;#VAR script_next_room {CS};where","#VAR script_room_name {CS};E;S;e;path;8 sw;11 s;#VAR script_next_room {Cleaners x3}","#VAR script_next_cs {48};#VAR script_room_name {Cleaners x3};15 n;2 ne;5 n;forest;4 n;E;#VAR lock {cleaner};where","#VAR script_room_name {Cleaners x3};N;#VAR script_next_room {Cleaners x1};where","#VAR script_room_name {Cleaners x1};2 s;#VAR script_next_room {Cleaners x3};where","#VAR script_room_name {Cleaners x3};N;W;#VAR script_next_room {Cleaners x1};where","#VAR script_room_name {Cleaners x1};3 s;#VAR script_next_room {Cleaners x3};where","#VAR script_room_name {Cleaners x3};S;#VAR script_next_room {CS};where","#VAR script_room_name {CS};2 e;4 s;out;5 s;2 sw;15 s;#VAR script_next_room {Old Elves}","#VAR script_next_cs {53};#VAR script_room_name {Old Elves};15 n;2 ne;5 n;forest;4 s;sw;se;w;#VAR lock {elf};where","2 e;where","w;s;w;where","2 e;#VAR script_next_room {CS};where","#VAR script_room_name {CS};w;n;nw;ne;4 n;out;8 s;2 w;14 s;#VAR script_next_room {Broxima}","#VAR script_next_cs {57};#VAR script_room_name {Broxima};16 n;gateway;#VAR lock {samurai};where","n;where","s;e;#VAR script_next_room {CS};where","#VAR script_room_name {CS};w;17 s;#VAR script_next_room {Sirros}","#VAR script_next_cs {62};#VAR script_room_name {Sirros};10 s;20 w;20 w;18 n;trail;#VAR lock {human};3 s;where","2 s;where","2 e;where","n;#VAR script_next_room {CS};where","#VAR script_room_name {CS};s;2 w;N;path;18 s;20 e;20 e;10 n;#VAR script_next_room {Greyhawk - Giants}","#VAR script_next_cs {70};#VAR script_room_name {Greyhawk - Giants};12 n;12 w;6 s;enter;d;w;se;ne;#VAR lock {giant};#VAR script_next_room {Greyhawk - Eye};where","#VAR script_room_name {Greyhawk - Eye};2 n;#VAR lock {eye};#VAR script_next_room {Greyhawk - Diamond};where","#VAR script_room_name {Greyhawk - Diamond};2 s;sw;nw;2 n;break sphere;#SAY WAIT FOR DIAMOND!;#VAR script_next_room {GryHk - Minitaurs x5};where","#VAR script_room_name {GryHk - Minitaurs x5};get diamond;n;#VAR lock {minitaur};#VAR script_next_room {Greyhawk - Burt};where","#VAR script_room_name {Greyhawk - Burt};3 s;W;n;d;#VAR lock {burt};#VAR script_next_room {Greyhawk - Zando};where","#VAR script_room_name {Greyhawk - Zando};n;open cage;#VAR lock {zando};#VAR script_next_room {Greyhawk - Gunter};where","#VAR script_room_name {Greyhawk - Gunter};s;u;search rug;se;#VAR lock {goblin};#VAR script_next_room {CS};where","#VAR script_room_name {CS};nw;s;E;u;out;6 n;12 e;12 s;#VAR script_next_room {Tyrir Forest}","#VAR script_next_cs {73};#VAR script_room_name {Tyrir Forest};9 w;20 sw;20 w;s;4 w;trail;n;2 w;n;#VAR lock {torturer};where;kill torturer;where","e;n;w;#VAR lock {leader};#VAR script_next_room {CS};where","#VAR script_room_name {CS};e;S;E;S;out;4 e;n;20 e;20 ne;9 e;#VAR script_next_room {Mithil Stonedown}","#VAR script_next_cs {83};#VAR script_room_name {Mithil Stonedown};9 s;20 w;w;2 s;climb;d;w;sw;6 s;sw;w;nw;sw;w;#VAR lock {stonedowner};where","N;where","S;where","2 n;W;where","E;where","2 w;SW;where","NE;where","sw;SE;where","NW;#VAR script_next_room {CS};where","#VAR script_room_name {CS};se;e;ne;se;e;ne;se;6 n;ne;e;u;climb;ne;20 e;10 n;#VAR script_next_room {Barracks}","#VAR script_next_cs {87};#VAR script_room_name {Barracks};13 s;2 sw;in;3 w;#VAR lock {recruit};where","e;n;w;where","e;s;2 e;u;2 w;n;w;#VAR script_next_room {CS};where","#VAR script_room_name {CS};e;s;2 e;d;out;2 ne;13 n;#VAR script_next_room {Gremlins x4}","#VAR script_next_cs {95};#VAR script_room_name {Gremlins x4};10 w;9 sw;20 w;forest;n;cave;e;#VAR lock {guard};where;#VAR script_next_room {Gremlins x2}","#VAR script_room_name {Gremlins x2};s;e;where;#VAR script_next_room {Gremlin x1}","#VAR script_room_name {Gremlins x1};n;where;#VAR script_next_room {Gremlins x2}","#VAR script_room_name {Gremlins x2};n;where;#VAR script_next_room {Slpng Grmlns x2}","#VAR script_room_name {Slpng Grmlns x2};n;where;#VAR script_next_room {Gremlin x1}","#VAR script_room_name {Gremlin x1};e;where;#VAR script_next_room {Gremlins x2}","#VAR script_room_name {Gremlins x2};e;where;#VAR script_next_room {CS}","#VAR script_room_name {CS};2 w;3 s;w;n;w;out;2 s;20 e;9 ne;10 e"]</json>
</var>
</cmud>
|
|
|
|
|
 |
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Fri Jan 14, 2011 3:23 pm |
Did you also edit the XML of the alias? If you did, please post the full XML. The XML you posted simply cannot work.
|
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Jan 14, 2011 5:31 pm |
The JSON export looks fine. The variable is a proper stringlist/array. So using %item(@script_money,@somenumber) should work fine. But I don't actually see where you use the @script_money variable in your alias above, so yes, we also need your alias XML.
|
|
|
|
 |
JWhitney Wanderer
Joined: 20 Oct 2006 Posts: 51
|
Posted: Sat Jan 15, 2011 4:29 am |
Just in case, here's a new export of both aliases.
The 'go' alias, used to #pick which script to run and load the necessary variables in to the string list (@script_money, for example).
| Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<alias name="go">
<value>#VAR script_area_name {None}
#VAR script_current_area {None}
#VAR script_current_room {1}
#VAR script_area_list {}
#PICK {p:Which areas would you like to run?} {Money Areas:#ADDITEM script_area_list {money}} {50K Mobs:#ADDITEM script_area_list {50k}} {Death Knight Bot:#ADDITEM script_area_list {dk100k}} {Death Knight:#ADDITEM script_area_list {dk}} {Hor:#ADDITEM script_area_list {hor}} {Greyhawk:#ADDITEM script_area_list {greyhawk}} {Sirros:#ADDITEM script_area_list {sirros}} {Revelstone:#ADDITEM script_area_list {revelstone}} {Mithil Stonedown:#ADDITEM script_area_list {mithil_stonedown}} {Soaring Woodhelven:#ADDITEM script_area_list {soaring_woodhelven}} {Stargrove Cave:#ADDITEM script_area_list {stargrove}} {Damora:#ADDITEM script_area_list {damora}} {Vargan Kenders:#ADDITEM script_area_list {vargan_kenders}} {Vargan Cleaners:#ADDITEM script_area_list {vargan_cleaners}} {Frozen Forest:#ADDITEM script_area_list {frozen_forest}} {Druid Tower:#ADDITEM script_area_list {druid_tower}} {Valric Mines:#ADDITEM script_area_list {valric_mines}} {Frogmen Cave:#ADDITEM script_area_list {frogmen_cave}} {Mansion Of Horrors:#ADDITEM script_area_list {mansion_of_horrors}}
#VAR script_area_name {%item( @script_area_list, 1)}
#VAR script_current_area {"@script_"%pop(script_area_list)}
#VAR script_current_area {%expand(@script_current_area)}
#VAR script_next_area {1}
recap_start_script
#ADDITEM script_area_list {END}</value>
</alias>
</cmud>
|
In CMUD's Package Editor, it looks like:
| Code: |
#VAR script_area_name {None}
#VAR script_current_area {None}
#VAR script_current_room {1}
#VAR script_area_list {}
#PICK {p:Which areas would you like to run?} {Money Areas:#ADDITEM script_area_list {money}} {50K Mobs:#ADDITEM script_area_list {50k}} {Death Knight Bot:#ADDITEM script_area_list {dk100k}} {Death Knight:#ADDITEM script_area_list {dk}} {Hor:#ADDITEM script_area_list {hor}} {Greyhawk:#ADDITEM script_area_list {greyhawk}} {Sirros:#ADDITEM script_area_list {sirros}} {Revelstone:#ADDITEM script_area_list {revelstone}} {Mithil Stonedown:#ADDITEM script_area_list {mithil_stonedown}} {Soaring Woodhelven:#ADDITEM script_area_list {soaring_woodhelven}} {Stargrove Cave:#ADDITEM script_area_list {stargrove}} {Damora:#ADDITEM script_area_list {damora}} {Vargan Kenders:#ADDITEM script_area_list {vargan_kenders}} {Vargan Cleaners:#ADDITEM script_area_list {vargan_cleaners}} {Frozen Forest:#ADDITEM script_area_list {frozen_forest}} {Druid Tower:#ADDITEM script_area_list {druid_tower}} {Valric Mines:#ADDITEM script_area_list {valric_mines}} {Frogmen Cave:#ADDITEM script_area_list {frogmen_cave}} {Mansion Of Horrors:#ADDITEM script_area_list {mansion_of_horrors}}
#VAR script_area_name {%item( @script_area_list, 1)}
#VAR script_current_area {"@script_"%pop(script_area_list)}
#VAR script_current_area {%expand(@script_current_area)}
#VAR script_next_area {1}
recap_start_script
#ADDITEM script_area_list {END}
|
----------------
The 'next' alias, which executes the commands of the string list line-by-line, one at a time, each time the alias is entered.
| Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<alias name="next">
<value>#IF (@script_area_list != END AND @script_current_room = %numitems( @script_current_area)) {
#SAY - CS -
#VAR script_area_name {%item( @script_area_list, 1)}
#VAR script_current_area {"@script_"%pop( script_area_list)}
#VAR script_current_area {%expand( @script_current_area)}
#VAR script_current_room {1}
#VAR script_next_area {1}
#VAR room_player_count {0}
#VAR room_mob_count {0}
}
#IF (@script_area_list = END AND @script_current_room = %numitems( @script_current_area)) {
#EXEC %item( @script_current_area, @script_current_room)
#VAR script_current_room {1}
room_change
#WINDOW {Messages} {%time( "ddd hh:nnam/pm") ---- Script End}
reset_script
} {
#EXEC %item( @script_current_area, @script_current_room)
#VAR script_current_room {%eval( @script_current_room + 1)}
room_change
#IF (%class( Auto_Script) = 1) {auto_command} {manual_command}
#IF (@script_next_area = 1) {
#WINDOW {Messages} {%time( "ddd hh:nnam/pm") ---- Area: %replace( %upper( @script_area_name), _, " ") | Rooms: %numitems( @script_current_area) | Remaining: %upper( %replace( @script_area_list, _, " "))}
#VAR script_next_area {0}
}
}</value>
</alias>
</cmud>
|
In CMUD's Package Editor, it looks like:
| Code: |
#IF (@script_area_list != END AND @script_current_room = %numitems( @script_current_area)) {
#SAY - CS -
#VAR script_area_name {%item( @script_area_list, 1)}
#VAR script_current_area {"@script_"%pop( script_area_list)}
#VAR script_current_area {%expand( @script_current_area)}
#VAR script_current_room {1}
#VAR script_next_area {1}
#VAR room_player_count {0}
#VAR room_mob_count {0}
}
#IF (@script_area_list = END AND @script_current_room = %numitems( @script_current_area)) {
#EXEC %item( @script_current_area, @script_current_room)
#VAR script_current_room {1}
room_change
#WINDOW {Messages} {%time( "ddd hh:nnam/pm") ---- Script End}
reset_script
} {
#EXEC %item( @script_current_area, @script_current_room)
#VAR script_current_room {%eval( @script_current_room + 1)}
room_change
#IF (%class( Auto_Script) = 1) {auto_command} {manual_command}
#IF (@script_next_area = 1) {
#WINDOW {Messages} {%time( "ddd hh:nnam/pm") ---- Area: %replace( %upper( @script_area_name), _, " ") | Rooms: %numitems( @script_current_area) | Remaining: %upper( %replace( @script_area_list, _, " "))}
#VAR script_next_area {0}
}
}
|
I know they are overly complex, this was the best and most customizable and adjustable system I could come up with. Any suggestions on improving efficiency without sacrificing function would certainly be appreciated as well. [/code] |
|
|
|
 |
|
|
|
|
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
|
|