Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
SteveThing
Beginner


Joined: 29 Aug 2010
Posts: 12

PostPosted: 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...
Reply with quote
hadar
Apprentice


Joined: 30 Aug 2009
Posts: 198
Location: my apt, in california

PostPosted: 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
_________________
if you build it they will come, assuming that they have not already come to build it
Aardwolf Bootcamp
My youtube channel
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: 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.
Reply with quote
SteveThing
Beginner


Joined: 29 Aug 2010
Posts: 12

PostPosted: 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.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: 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.
Reply with quote
SteveThing
Beginner


Joined: 29 Aug 2010
Posts: 12

PostPosted: 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.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net