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
Winslow
Novice


Joined: 17 Feb 2007
Posts: 48

PostPosted: Wed Apr 23, 2008 3:12 am   

Script Problem I can't figure out.
 
I have an ID trigger that will basically imports into veriables all the data when you ID something to then say or acution off later. One section of this, I cannot fix for the life of me. It looks as follows:
Quote:

You feel informed:
Object: the Ethereal Plate of Divine Protection Worn: Body
Item is: Not Rentable, An Artifact
Weight: 1 Value: 3,900 Level: 1 Size: Universal
Durability: 100% Condition: 100%
Can affect you as :
Affects: Hit Points by 55
Affects: Mana by 44
Affects: Save vs Spell by -10
Affects: Armor Class by -10
Grants: Permanent sanctuary
Grants: Permanent invisibility

That's an IDed item. Then when I want to say it, the problem is as follows:
Quote:

You say, 'the Ethereal Plate of Divine Protection: Worn(Body) Hit Points(55) Mana(44) Save vs Spell(-10) Armor Class(-10) Permanent() Permanent() Specs(Not Rentable, An Artifact) Dur 100% Con 100% '

The trigger that's messing up the Permanent varable is as follows:
Code:

^    Grants: Permanent (*)


#var permtemp {%1}
#math ItemAffectCount @ItemAffectCount+1
#var %concat( ItemAffect, %concat( @ItemAffectCount, Stat)) {Permanent}
#if (%WORDCOUNT( @permtemp) >= 1) {
  #var tempword1 {%word( @permtemp, 1)}
  #var templen1 {%len( @tempword1)}
  #var templeft1 {%left( @tempword1, 1)}
  #var templeft1 {%UPPER( @templeft1)}
  #math templenright1 @templen1-1
  #var tempright1 {%right( @tempword1, @templenright1)}
  #var temp1 {%concat( @templeft1, @tempright1)}
  }
#if (%WORDCOUNT( @permtemp) >= 2) {
  #var tempword2 {%word( @permtemp, 2)}
  #var templen2 {%len( @tempword2)}
  #var templeft2 {%left( @tempword2, 1)}
  #var templeft2 {%UPPER( @templeft2)}
  #math templenright2 @templen2-1
  #var tempright2 {%right( @tempword2, @templenright2)}
  #var temp2 {%concat( @templeft2, @tempright2)}
  }
#if (%WORDCOUNT( @permtemp) >= 3) {
  #var tempword3 {%word( @permtemp, 3)}
  #var templen3 {%len( @tempword3)}
  #var templeft3 {%left( @tempword3, 1)}
  #var templeft3 {%UPPER( @templeft3)}
  #math templenright3 @templen3-1
  #var tempright3 {%right( @tempword3, @templenright3)}
  #var temp3 {%concat( @templeft3, @tempright3)}
  }
#if (%WORDCOUNT( @permtemp) = 4) {
  #var tempword4 {%word( @permtemp, 4)}
  #var templen4 {%len( @tempword4)}
  #var templeft4 {%left( @tempword4, 1)}
  #var templeft4 {%UPPER( @templeft4)}
  #math templenright4 @templen4-1
  #var tempright4 {%right( @tempword4, @templenright4)}
  #var temp4 {%concat( @templeft4, @tempright4)}
  }
#var tempy ""
#if (%WORDCOUNT( @permtemp) >= 1) {#var tempy {%concat( @tempy, @temp1)}}
#if (%WORDCOUNT( @permtemp) >= 2) {#var tempy {%concat( @tempy, @temp2)}}
#if (%WORDCOUNT( @permtemp) >= 3) {#var tempy {%concat( @tempy, @temp3)}}
#if (%WORDCOUNT( @permtemp) = 4) {#var tempy {%concat( @tempy, @temp4)}}
#var %concat( ItemAffect, %concat( @ItemAffectCount, Num)) {@tempy}


Now where did I go wrong? It will not capture one veriable, let alone two...
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Wed Apr 23, 2008 4:36 am   
 
Welll you should put "quotes around strings" in your %concat.

%wordcount does not exist, you want %numwords

Also, take a look at %proper
_________________
Discord: Shalimarwildcat
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Wed Apr 23, 2008 5:10 am   
 
Is this what you are trying to do?

#VAR tobeProper {%replace(@permtemp, " ", "|")}
#LOOP %numitems(@tobeProper) {#VAR allProper {%additem(%proper(%pop(tobeProper)), @allproper)}}
#VAR tempy {%replace(@allProper, "|", " ")}
_________________
Discord: Shalimarwildcat
Reply with quote
Winslow
Novice


Joined: 17 Feb 2007
Posts: 48

PostPosted: Fri Apr 25, 2008 1:08 am   
 
Hay, got this resolved with the above. Thanks a load.
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