|
DefinNormal Beginner
Joined: 24 May 2012 Posts: 12 Location: United States
|
Posted: Thu Jul 26, 2012 12:36 am
Multiple Issues |
Running: Windows 7
cMUD 3.34 (as Admin)
I have been running into multiple issues lately. I write all my scripts in Notepad and paste them into the command line. Relying on the package editor for complex and evolving scripts is a little less than ideal, and so it is easier to maintain my scripts in this way.
I have noticed that cMUD likes to add spaces when pasting scripts in via the command line. For example, in an #IF statement, when using OR, it adds two spaces after OR when there was only one originally. The same happens when using %ismember(), between the comma and the stringlist you are matching.
I've also had some scripts that would not work properly for inexplicable reasons, which have required me to use the #KILLALL command to re-paste my scripts into cMUD in order to get them to work. I'm beginning to wonder if cMUD simply has a lot of issues with pasting scripts from the command line.
I've become terrified to use the package editor at times, because twice now it has caused cMUD to crash and corrupt whatever packages I have loaded currently. This is yet another reason why I save my scripts to text files and paste them in via the command line.
Below, I have a script right now that simply will not function and I have no idea why. Maybe someone could give me some insight or advice? I appreciate it.
Code: |
#TRIGGER {^H:%d M:%d} {cur_Health=%gmcp.Char.Vitals.hp;max_Health=%gmcp.Char.Vitals.maxhp;cur_Mana=%gmcp.Char.Vitals.mp;max_Mana=%gmcp.Char.Vitals.maxmp;cur_Bleeding=%gmcp.Char.Vitals.bleeding;Prone=%gmcp.Char.Vitals.prone;#IF (@gmcp_herb_check) {HBal=%gmcp.Char.Vitals.herb};#IF (@gmcp_salve_check) {SBal=%gmcp.Char.Vitals.salve};#IF (@gmcp_pipe_check) {PBal=%gmcp.Char.Vitals.pipe};#IF (@gmcp_xbal_check) {XBal=%gmcp.Char.Vitals.elixir};#IF (@gmcp_heal_check) {SipBal=%gmcp.Char.Vitals.elixir};#IF (@gmcp_moss_check) {MossBal=%gmcp.Char.Vitals.moss};#IF (@gmcp_tree_check) {Tree_Bal=%gmcp.Char.Vitals.tree};#IF (@gmcp_renew_check) {Renew_Bal=%gmcp.Char.Vitals.renew};#IF (@gmcp_focus_check) {Focus_Bal=%gmcp.Char.Vitals.focus};BL=%gmcp.Char.Vitals.balance;EQ=%gmcp.Char.Vitals.equilibrium;Charge=%gmcp.Char.Vitals.energy;vitals}
#ALIAS vitals {#IF (@SipBal) {heal_eval};#IF (@MossBal) {moss_eval};bleeding;Equilibrium;Balance;BalEQ}
#ALIAS bleeding {#IF (@cur_Bleeding > 100) {#IF (%ismember(aeon,@aff_list) OR %ismember(unconscious,@aff_list)) {} {#IF (@cur_Mana > %eval(%eval(@max_mana/100)*65)) {#LOOP %eval(@cur_Bleeding/50) {clot}}}}}
|
Now.. pertinent parts are:
Code: |
cur_Bleeding=%gmcp.Char.Vitals.bleeding
|
This works as it should. At the end of the trigger, it calls on the "vitals" alias, which then calls on the "bleeding" alias.
Code: |
#IF (@cur_Bleeding > 100) {#IF (%ismember(aeon,@aff_list) OR %ismember(unconscious,@aff_list)) {} {#IF (@cur_Mana > %eval(%eval(@max_mana/100)*65)) {#LOOP %eval(@cur_Bleeding/50) {clot}}}}
|
Just for simplicity's sake, I'll echo that line in cMUD and paste the results here.
Quote: |
#IF (300 > 100) {#IF (0 OR 0) {} {#IF (5745 > 3705) {#LOOP 6 {clot}}}}
|
So, the trigger above fires from the prompt, setting the "cur_Bleeding" variable, then calling the alias "vitals" which in turns calls the alias "bleeding" of which the results are quoted above. Any idea why it's not sending the clot command? By the way, "clot" is not an alias in my system. I can manually use the "vitals" or "bleeding" alias while bleeding and it works just fine. The trigger properly sets the "cur_Bleeding" variable. In fact, the trigger above properly calls both the "vitals" and therefore, the "bleeding" alias - but still, it will not send the clot command. Ideas?[/quote][/code] |
|
|
|
DefinNormal Beginner
Joined: 24 May 2012 Posts: 12 Location: United States
|
Posted: Thu Jul 26, 2012 12:39 am |
By the way, even if I skip the "vitals" alias all together it will will not fire the "bleeding" alias properly. I've added echoes to various parts of the alias, and the trigger simply will not fire. I have even simplified the "bleeding" alias to be the following, and still it will not work.
#ALIAS bleeding {#IF (@cur_Bleeding > 100) {clot}} |
|
|
|
DefinNormal Beginner
Joined: 24 May 2012 Posts: 12 Location: United States
|
Posted: Thu Jul 26, 2012 12:41 am |
Ugh.. I did not mean that the trigger will not fire. It does fire.
What I meant was, the "bleeding" alias will not work through to the end where it sends the "clot" command.
And no, #EXEC {clot} will not work either. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Thu Jul 26, 2012 3:20 am |
You've got corruption. Package files (all of them), layouts, mapfiles, and the session database. Use the appropriate methods on all of those (including anything created by CMud) and your problems will likely disappear overnight (or at least however long it takes you to do all the files).
Users such as yourself tend to only fix one set of corruptible data and ignore the rest, which sometimes leads to them thinking the problem is fixed only to have it reappear soon after. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
DefinNormal Beginner
Joined: 24 May 2012 Posts: 12 Location: United States
|
Posted: Thu Jul 26, 2012 7:17 am |
What do you mean by appropriate methods? I recently uninstalled and reinstalled cMUD in order to, hopefully, correct some of these issues but to no avail.
I did not however remove all cMUD registry settings, nor did I remove the cMUD directories after uninstalling. I'll try that now, and start fresh using my text files.
Is this what you mean? I appreciate the prompt response. |
|
|
|
DefinNormal Beginner
Joined: 24 May 2012 Posts: 12 Location: United States
|
Posted: Thu Jul 26, 2012 7:43 am |
I uninstalled / re-installed cMUD - but did not delete registry information yet. The main cMUD directory was deleted, as well as the session directory or whatever it is, before re-installing cMUD.
I'll have to look into this further tomorrow, but the above script still will not run unless I input the "bleeding" alias directly. Below is the echo, once again, from the alias.
Quote: |
#IF (291 > 100) {#IF (0 OR 0) {} {#IF (5500 > 3575) {#LOOP 5 {clot}}}}
|
The clot command is still not being sent. |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Thu Jul 26, 2012 1:41 pm |
Reinstalling Cmud won't get rid of corruption. Corruption takes place in the files in your home directory, not in the Program Files. Cmud does not overwrite the customizable files in your home directory.
Deleting the entire Cmud folder in your My Games folder would certainly be one way to be sure of getting rid of corruption, but rather extreme. The XML export/import procedure is used for your session folders. For a lot of the other files, such as layout and default layout, the usual method is to delete them and let Cmud recreate them from scratch, then customize again.
Matt, I think we really need a sticky on the forum giving the complete detailed procedure for getting rid of corruption. It keeps coming up over and over, and I don't think there is actually a complete procedure currently on the first two pages of discussion here. I don't know the procedure well enough to write it, though. |
|
|
|
DefinNormal Beginner
Joined: 24 May 2012 Posts: 12 Location: United States
|
Posted: Thu Jul 26, 2012 4:09 pm |
I deleted the cMUD folder in My Games, as well as the folder in Program Files. I haven't used cMUD enough since to see if the other issues have cleared up, but I'm baffled as to why the above script will not work properly still.
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Thu Jul 26, 2012 8:36 pm |
Try testing this alias by itself:
Code: |
#ALIAS bleeding {#SAY bleeding value: @curBleeding; #IF (@cur_Bleeding > 100) {#SAY TEST SUCCESSFUL;clot}} |
Now type bleeding in the command line. Does it print "TEST SUCCESSFUL"? What does it give for the bleeding value? |
|
|
|
DefinNormal Beginner
Joined: 24 May 2012 Posts: 12 Location: United States
|
Posted: Fri Jul 27, 2012 1:34 am |
I had to edit your code to match the variable properly, but this is the edited alias and the results..
Code: |
#ALIAS bleeding {#SAY bleeding value: @cur_Bleeding;#IF (@cur_Bleeding > 100) {#SAY TEST SUCCESSFUL;clot}}
|
Quote: |
H:4900 M:5500 E:100% W:100% XP:76% [db eb]--
You draw the sharp edge of a jewel-encrusted sacrificial dagger across your palm, blood beginning to trickle from your new wound.
Balance Used: 0.50 seconds
H:4900 M:5500 E:100% W:100% XP:76% [db e-]--
You have recovered balance on all limbs.
H:4900 M:5500 E:100% W:100% XP:76% [db eb]--
H:4900 M:5500 E:100% W:100% XP:76% [db eb]--
You bleed 300 health.
H:4600 M:5500 E:100% W:100% XP:76% [db eb]--
bleeding value: 292
TEST SUCCESSFUL
You exert your superior mental control over your body and will your wounds to clot before your eyes.
H:4600 M:5420 E:100% W:99% XP:76% [db eb]--
You bleed 197 health.
H:4403 M:5420 E:100% W:100% XP:76% [db eb]--
You take a drink of an elixir of health from a slender white birch vial.
The elixir heals and soothes you.
H:4900 M:5420 E:100% W:100% XP:76% [db eb]--
You may drink another health or mana elixir.
H:4900 M:5420 E:100% W:100% XP:76% [db eb]--
You bleed 138 health.
H:4762 M:5420 E:100% W:100% XP:76% [db eb]--
You bleed 55 health.
H:4805 M:5420 E:100% W:100% XP:76% [db eb]--
|
I've already tried something similar, but I'll similarly add some echoes to my current bleeding alias and show the results below.
Code: |
#ALIAS bleeding {#SAY Bleeding: Part 1 Check;#IF (@cur_Bleeding > 100) {#SAY Bleeding: Part 2 Check;#IF (%ismember(aeon,@aff_list) OR %ismember(unconscious,@aff_list)) {#SAY Bleeding: Part 3 Check} {#SAY Bleeding: Part 4 Check;#IF (@cur_Mana > %eval(%eval(@max_mana/100)*65)) {#SAY Bleeding: Part 5 Check;#LOOP %eval(@cur_Bleeding/50) {clot}}}}}
|
Here are the results, as they should be.
Quote: |
H:4900 M:5420 E:100% W:100% XP:76% [db eb]--
You draw the sharp edge of a jewel-encrusted sacrificial dagger across your palm, blood beginning to trickle from your new wound.
Balance Used: 0.50 seconds
H:4900 M:5420 E:100% W:100% XP:76% [db e-]--
You have recovered balance on all limbs.
H:4900 M:5420 E:100% W:100% XP:76% [db eb]--
H:4900 M:5420 E:100% W:100% XP:76% [db eb]--
Bleeding: Part 1 Check
Bleeding: Part 2 Check
Bleeding: Part 4 Check
Bleeding: Part 5 Check
You exert your superior mental control over your body and will your wounds to clot before your eyes.
H:4900 M:5340 E:100% W:99% XP:76% [db eb]--
You exert your superior mental control over your body and will your wounds to clot before your eyes.
H:4900 M:5260 E:100% W:99% XP:76% [db eb]--
You exert your superior mental control over your body and will your wounds to clot before your eyes.
H:4900 M:5180 E:100% W:99% XP:76% [db eb]--
You exert your superior mental control over your body and will your wounds to clot before your eyes.
H:4900 M:5100 E:100% W:99% XP:76% [db eb]--
You exert your superior mental control over your body and will your wounds to clot before your eyes.
H:4900 M:5020 E:100% W:99% XP:76% [db eb]--
You exert your superior mental control over your body and will your wounds to clot before your eyes.
H:4900 M:4940 E:100% W:99% XP:76% [db eb]--
You bleed 180 health.
H:4720 M:4940 E:100% W:99% XP:76% [db eb]--
You bleed 92 health.
H:4808 M:5044 E:100% W:100% XP:76% [db eb]--
You bleed 8 health.
H:4800 M:5044 E:100% W:100% XP:76% [db eb]--
|
After playing around with this, I did figure out a (rather ineffective) way to make this work.. If I add "#SAY @cur_Bleeding" to the beginning of the bleeding alias, it clots. So long as I use the @cur_Bleeding variable in some way before the end of the alias, it works. I made a variable named "bleed_dump" and added this (bleed_dump=@cur_Bleeding) to the beginning of the bleeding alias, and suddenly it works. Makes no sense to me. Any idea why it wont work otherwise? |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Jul 27, 2012 3:36 am |
Is your prompt trigger set to Trigger on Newline or Trigger on Prompt? Your original trigger code seems to indicate that it's set to Trigger on Newline, which means the execution waits until a newline is received or generated (Trigger on Prompt means the execution happens as soon as the pattern is matched.)
By the way, regardless of if you stick to a text editor or move back into the Package Editor, you really should write your scripts out in a multiline syntax. CMud doesn't care either way, so writing them in the old, run-on style of ZMud (everything separated by semicolons) is just making it harder for the human to read. CMud will ignore any superfluous/gratuitous whitespace, though you will need to especially mind the formatting of #SWITCH. Also, if you are not using the built-in text editor instead of the command line, you should look into that as well (it's basically a window-sized command line, and is intended for the larger scripts). |
|
_________________ 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
|
|