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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Tahlmorrah
Newbie


Joined: 18 Aug 2002
Posts: 9
Location: USA

PostPosted: Fri Aug 13, 2004 12:43 am   

Trigger question: Getting duplicate entries
 
Trigger is listed as Pattern: Choose a group <1-5>
Vaule:
check
#if (@keeper>0) {@keeper} {inconsistant data}

Check is a alias that checks for specific data, if the data is there it sets keeper to value 0-5

What is happening is that when conditions of (@keeper>0) is met it returns keeper twice with a Carriage return (CR) in between. The CR is causing the trigger to happen again before returning the keeper value twice. This is causing a twofold problem, first the wrong data is being selected and two since the next value it is looking for is a numeric value it selects something incorrect there as well.

I believe the extra CR is due to the check and if statement being seperated by a CR, but unable to prove this.

Willing to export entire script for someone willing to help me, but I have thrown every thing I can think of at this and it is still not working.
Reply with quote
Dumas
Enchanter


Joined: 11 Feb 2003
Posts: 511
Location: USA

PostPosted: Fri Aug 13, 2004 3:46 am   
 
Posting the check alias on here, along with this inconsistant data, will help with assistance.
Reply with quote
mr_kent
Enchanter


Joined: 10 Oct 2000
Posts: 698

PostPosted: Fri Aug 13, 2004 2:42 pm   
 
I would first look for a duplicate trigger. This may be hidden in your inherited settings.

If this isn't the cause, then try duplicating your check alias under another name and move your #IF statement into this second alias after it sets/modifies the @keeper variable.

Without more information, I'm afraid we won't be able to help you if that doesn't help.
Reply with quote
Tahlmorrah
Newbie


Joined: 18 Aug 2002
Posts: 9
Location: USA

PostPosted: Fri Aug 13, 2004 3:30 pm   
 
Here we go
#ALIAS check {check1;check2;check3;check4;check5}
#ALIAS check1 {#if (@tarstr<=@strone & @tarint<=@intone & @tarwis<=@wisone & @tardex<=@dexone & @tarcon<=@conone) {#var keeper 1}}
#ALIAS check2 {#if (@tarstr<=@strtwo & @tarint<=@inttwo & @tarwis<=@wistwo & @tardex<=@dextwo & @tarcon<=@contwo) {#var keeper 2}}
#ALIAS check3 {#if (@tarstr<=@strthree & @tarint<=@intthree & @tarwis<=@wisthree & @tardex<=@dexthree & @tarcon<=@conthree) {#var keeper 3}}
#ALIAS check4 {#if (@tarstr<=@strfour & @tarint<=@intfour & @tarwis<=@wisfour & @tardex<=@dexfour & @tarcon<=@confour) {#var keeper 4}}
#ALIAS check5 {#if (@tarstr<=@strfive & @tarint<=@intfive & @tarwis<=@wisfive & @tardex<=@dexfive & @tarcon<=@confive) {#var keeper 5}}
#ALIAS helpme {#say Type the 3 letter abbeviation for a stat followed by a target score to change}
#ALIAS str {#var tarstr %0}
#ALIAS int {#var tarint %0}
#ALIAS wis {#var tarwis %0}
#ALIAS dex {#var tardex %0}
#ALIAS con {#var tarcon %0}
#ALIAS stop {#var keeper 6;quit}
#ALIAS go {#var keeper 0;okletsbegin}
#ALIAS atconnect {Incubus;y;freejack;freejack;m;go}
#VAR keeper {0}
#VAR tarstr {10}
#VAR tarint {10}
#VAR tarwis {10}
#VAR tardex {10}
#VAR tarcon {10}
#TRIGGER {Str: %1 %2 %3 %4 %5} {#var strone %1;#var strtwo %2;#var strthree %3;#var strfour %4;#var strfive %5}
#TRIGGER {Int: %1 %2 %3 %4 %5} {#var intone %1;#var inttwo %2;#var intthree %3;#var intfour %4;#var intfive %5}
#TRIGGER {Wis: %1 %2 %3 %4 %5} {#var wisone %1;#var wistwo %2;#var wisthree %3;#var wisfour %4;#var wisfive %5}
#TRIGGER {Dex: %1 %2 %3 %4 %5} {#var dexone %1;#var dextwo %2;#var dexthree %3;#var dexfour %4;#var dexfive %5}
#TRIGGER {Con: %1 %2 %3 %4 %5} {#var conone %1;#var contwo %2;#var conthree %3;#var confour %4;#var confive %5}
#TRIGGER {Choose a group <1-5>, } {check;#if (@keeper>0) {@keeper} {inconsistant data}}
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Aug 13, 2004 7:13 pm   
 
#ALIAS atconnect {Incubus;y;freejack;freejack;m;go}
I hope that's not your actual password. If it is, you should change it immediately.

Your final trigger (Choose a group) probably has both the Newline and Prompt options enabled. One of them needs to be disabled, probably Newline.

You don't need all the check aliases, you could simply move their scripts to the final trigger. You especially don't need the 'check' alias. A multistate trigger might be even better.
Code:

#TR {Str:   (*)    (*)    (*)    (*)    (*)} {#VAR keeper 0}
#COND {Int:   (*)    (*)    (*)    (*)    (*)} {}
#COND {Wis:   (*)    (*)    (*)    (*)    (*)} {}
#COND {Dex:   (*)    (*)    (*)    (*)    (*)} {}
#COND {Con:   (*)    (*)    (*)    (*)    (*)} {}
#COND {Choose a group} {
#IF ((@tarstr <= %t1) AND (@tarint <= %t6) AND (@tarwis <= %t11) AND (@tardex <= %t16) AND (@tarcon <= %t21)) {#VAR keeper 1}
#IF ((@tarstr <= %t2) AND (@tarint <= %t7) AND (@tarwis <= %t12) AND (@tardex <= %t17) AND (@tarcon <= %t22)) {#VAR keeper 2}
#IF ((@tarstr <= %t3) AND (@tarint <= %t8) AND (@tarwis <= %t13) AND (@tardex <= %t18) AND (@tarcon <= %t23)) {#VAR keeper 3}
#IF ((@tarstr <= %t4) AND (@tarint <= %t9) AND (@tarwis <= %t14) AND (@tardex <= %t19) AND (@tarcon <= %t24)) {#VAR keeper 4}
#IF ((@tarstr <= %t5) AND (@tarint <= %t10) AND (@tarwis <= %t15) AND (@tardex <= %t20) AND (@tarcon <= %t25)) {#VAR keeper 5}
#IF (@keeper > 0) {@keeper} {inconsistant data}
} {prompt|nocr}


Untested.
_________________
LightBulb
Senior member

Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious.
Reply with quote
Tahlmorrah
Newbie


Joined: 18 Aug 2002
Posts: 9
Location: USA

PostPosted: Fri Aug 13, 2004 9:46 pm   
 
No that is not the real password, but it gives the idea

Receive following error now after removing all check alias and removing the Choose a group trigger

Access violation at address 004B188C0 in module 'Zmud.exe'. Read of address 0000000C

..and thanks very much, much cleaner coding. I like that.
Reply with quote
Tahlmorrah
Newbie


Joined: 18 Aug 2002
Posts: 9
Location: USA

PostPosted: Mon Aug 16, 2004 5:06 pm   
 
Anyone have a suggestion about the new error?
Reply with quote
Tahlmorrah
Newbie


Joined: 18 Aug 2002
Posts: 9
Location: USA

PostPosted: Tue Aug 17, 2004 5:23 pm   New information
 
Missed the actual error. Getting an Error in Parsing Command:

#VAR keeper 0
#COND {Int: (*) (*) (*) (*) (*)} {}
#COND {Wis: (*) (*) (*) (*) (*)} {}
#COND {Dex: (*) (*) (*) (*) (*)} {}
#COND {Con: (*) (*) (*) (*) (*)} {}
#COND {Choose a group} {
#IF ((@tarstr <= 15) AND (@tarint <= ) AND (@tarwis <= ) AND (@tardex <= ) AND (@tarcon <= )) {#VAR keeper 1}
#IF ((@tarstr <= 14) AND (@tarint <= ) AND (@tarwis <= ) AND (@tardex <= ) AND (@tarcon <= )) {#VAR keeper 2}
#IF ((@tarstr <= 14) AND (@tarint <= ) AND (@tarwis <= ) AND (@tardex <= ) AND (@tarcon <= )) {#VAR keeper 3}
#IF ((@tarstr <= 12) AND (@tarint <= ) AND (@tarwis <= ) AND (@tardex <= ) AND (@tarcon <= )) {#VAR keeper 4}
#IF ((@tarstr <= 11) AND (@tarint <= ) AND (@tarwis <= ) AND (@tardex <= ) AND (@tarcon <= )) {#VAR keeper 5}
#IF (@keeper > 0) {@keeper} {inconsistant data}
} {prompt|nocr}
Reply with quote
Falan
Wanderer


Joined: 17 Aug 2004
Posts: 98
Location: OK, USA

PostPosted: Wed Aug 18, 2004 8:28 am   
 
I don't see the STR #TR, so I'm guessing you just forgot to post it. Some of your operators in the #IF expressions are missing the v2 value. Would that cause a problem? How are your #VAR values being set/updated?

You can always copy and paste Lightbulb's script into your command line and press <Enter>.
_________________
zMUD 7.05a
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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