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
meyn
Beginner


Joined: 06 Mar 2008
Posts: 27

PostPosted: Wed Apr 23, 2008 7:25 pm   

how to use " in a string in a %concat statement?
 
is there a way to use " within a %concat statment

this addenemy alias sets up a new enemy trigger in its class place, so i can add enemys as i come across them:


Code:
#ALIAS addenemy {
  #PR newtrig "Enter the enemy trigger"
  #PR newenemy "Enter the enemy kill name"
  #PR newfleename "Enter enemy flee name"
  #PR newkillvalue "Enter kill value for enemy"
  #PR newdangervalue "Enter danger value for ememy"
  #YESNO "Can the enemy be butchered?" {#VAR setbutcher 1}
  #YESNO "Can the enemy be scalped?" {#VAR setscalp 1}
  #YESNO "Can the enemy be looted?" {#VAR setlootable 1;#PR lootitems "Enter item to be looted seperated by a 'comma'"}
  #VAR lootitems %replace( @lootitems, ",", "|")
  setupnewtrig1=%concat( "#CLA {enemys", @newkillvalue, "}; #TR {", @newtrig, "} {#VAR temptgt {", @newenemy, "};#VAR tempfleename {")
  setupnewtrig2=%concat( @newfleename, "};#VAR dangervalue ", @newdangervalue, ";#VAR killvalue ", @newkillvalue, ";#VAR scalpable ", @setscalp)
  setupnewtrig3=%concat(";#VAR butcherable ", @setbutcher, ";#VAR lootable ", @setlootable, ";#VAR lootlist {", @lootitems, "}};#CLA 0")
  #EXEC {%concat( @setupnewtrig1, @setupnewtrig2, @setupnewtrig3)}
  }


if i input:

addenemy

A cute brown deer eyes you nervously
cute
deer
1
2
yes
yes
yes
feet,arms,ears

it outputs :

Code:
#CLASS {enemys2}
#TRIGGER {A cute brown deer eyes you nervously} {
  #VAR temptgt {cute}
  #VAR tempfleename {deer}
  #VAR dangervalue 1
  #VAR killvalue 2
  #VAR scalpable 1
  #VAR butcherable 1
  #VAR lootable 1
  #VAR lootlist {feet|arms|ears}
  }
#CLASS 0


I would like to give the trigger an ID

#TRIGGER "deer" {A cute brown deer eyes you nervously} {

The problem is how to add to concat statement

Code:

%conget( "#TR "", @newfleename , "" {", @newtrig)
                       
              ^                       ^
              this is the bit thats wrong
 



Thanks for any help given :)


Last edited by meyn on Wed Apr 23, 2008 7:32 pm; edited 2 times in total
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Wed Apr 23, 2008 7:31 pm   
 
replace #TR {", @newtrig, "} with #TR @newfleename {", @newtrig, "}

this assumes that the flee name will only ever be one word, if it isn't and can be two words a different method will be required so let me know.
_________________
Taz :)
Reply with quote
meyn
Beginner


Joined: 06 Mar 2008
Posts: 27

PostPosted: Wed Apr 23, 2008 7:34 pm   
 
yea it will only be one word thanks i'll give it a go

EDIT: work perfectly thankyou for helping
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