|
SteveThing Beginner
Joined: 29 Aug 2010 Posts: 12
|
Posted: Sat Jun 30, 2012 7:37 am
Wierd error with DB and alias |
Hi all,
So I'm trying out CMUDPro 3.34 (might buy it!) and I came across an odd error. When I use the alias below, I get the following error:
"Access violation at address 00404E9A in module 'cMUDPro.exe'. Read of address 70733BC5"
Using Win7Pro x64 with 8GB of ram with a Q9550 CPU.
Here is my alias:
Code: |
#IF (@Spellup_Started=0) {
#DBLOAD MageSpells
#DBFIRST
#SHOW *** Staring Spell-up! ***
Spellup_Started = 1
} {#DBNEXT}
#IF (!%null(%rec)) {
#IF (%ismember("self",&Target)) {
#TRIGGER {&Success} {#UNTRIGGER {&Success};spellup}
#SHOW cast '&Name'} {spellup}
} {#SHOW *** Spell-up Complete!;Spellup_Started = 0;#DBCLOSE MageSpells} |
The other issue is my use of the #TRIGGER command... not sure why it immediately deletes it after creation... |
|
|
|
hadar Apprentice
Joined: 30 Aug 2009 Posts: 198 Location: my apt, in california
|
Posted: Sat Jun 30, 2012 5:13 pm |
#TRIGGER {&Success} {#UNTRIGGER {&Success};spellup}
see the #untrigger, it deletes the trigger command, thats why its deleting right after it creates the deletion is the first thing that fires |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sat Jun 30, 2012 6:40 pm |
hadar wrote: |
#TRIGGER {&Success} {#UNTRIGGER {&Success};spellup}
see the #untrigger, it deletes the trigger command, thats why its deleting right after it creates the deletion is the first thing that fires |
Not quite true. He states it deletes it right after creation. I believe he's intending to delete it once the Success message fires, but not right after creation.
Steve, you might do well to do some debugging. Each place you expect results, put a #PRINT {what you expect}. For instance, comment out the #TRIGGER bit, and put #PRINT {&Success} to see if it is actually outputting anything.
Additionally, when creating triggers that have variables, you want to do:
Code: |
#EXEC %concat("#TRIGGER {", &Success, "} {#UNTRIGGER {", &Success, ";spellup}") |
That way, it expands the variables properly. |
|
|
|
SteveThing Beginner
Joined: 29 Aug 2010 Posts: 12
|
Posted: Sun Jul 01, 2012 4:52 am |
Thank you for the tip with #EXEC, it works now. Oddly, since I started CMUD tonight to work on this, I no longer get the access violation... Guess the DB or CMUD needed a fresh load.
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Sun Jul 01, 2012 9:10 pm |
As a side note, you should avoid situations where you need to use #EXEC as much as possible. #EXEC commands cannot be compiled, so the entire trigger cannot be compiled. This makes it run slower than other triggers. There are other potential problems with using #EXEC, too. In addition, it is a bad idea to be repeatedly creating and destroying the same setting. A much better solution would be to create a permanent trigger, and use #T+ and #T- to turn it on and off when you need to.
|
|
|
|
SteveThing Beginner
Joined: 29 Aug 2010 Posts: 12
|
Posted: Mon Jul 02, 2012 4:31 pm |
Good to know. I guess I'll create the triggers as I go.
On yet another segway, I'm experiencing a crash of cMUD randomly and any changes I've made to my settings are lost. I've been using it for 4 days now and had 15 crashes. I'm tempted to go back to WinTin/TinTin++ or Mudlet. I've tried running as admin and it still crashes. I am not sure why it crashes, but it appears to happen when the DB is loaded. |
|
|
|
|
|