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
PrestoPimp
Apprentice


Joined: 18 Sep 2001
Posts: 175
Location: USA

PostPosted: Sat Feb 22, 2003 5:40 pm   

Spaces in script editor
 
In my script editor whenever i enter a line like:
quote:

Antimagic 29 1000
it changes it to
Antimagic 29 1000


how can i get it to keep the spaces in between the values?


Edited: Put in the quote to see the spaces.

Edited by - tondiening on 02/22/2003 11:40:00
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Sat Feb 22, 2003 6:44 pm   
 
What is the goal to keep the spaces?

Are you trying to #SH, say it, assign it to a variable?

Ton Diening
Reply with quote
PrestoPimp
Apprentice


Joined: 18 Sep 2001
Posts: 175
Location: USA

PostPosted: Sun Feb 23, 2003 3:13 am   
 
i want to put it in my bio as part of a bot. so when i enter the command: dobio
I have a heading like
Name Qty Price
<name> <qtyvar> <price>

so I need the spaces in there to keep it somewhat organized so it doesnt all run together depending on the different names and quantities and such. Do you know what I mean?

-Prestopimp

Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Sun Feb 23, 2003 3:44 am   
 
If you have all your data in a database variable or in separate variables
you could do a loop to cycle through them all as they change and use
%format() to output it pretty.

Would that work for you? Something akin to:
%format("&15s",Name)%format("&15s",Qty)%format("&15s",Price)
%format("&15s",@name)%format("&15.0n",@Qtyvar)%format("&15.0n",@Price)



Ton Diening
Reply with quote
PrestoPimp
Apprentice


Joined: 18 Sep 2001
Posts: 175
Location: USA

PostPosted: Sun Feb 23, 2003 4:14 am   
 
This is what I have in that instance, and it just feeds the first word of each line to the mud, omitting the quantity in the variables and the price.

bio
/c
%format( "&6s", Potion Name) %format( "&6s", Qty) %format( "&6s", Price)
#WAIT 1200
---------------------------------------------------------
#WAIT 1200
%format( "&6s", Antimagic Shell) %format( "&6s", @antimagic) %format( "&6s", 15000)
%format( "&6s", Shadowform) %format( "&6s", @shadowform) %format( "&6s", 16100)
%format( "&6s", Inner Warmth) %format( "&6s", @innerwarmth) %format( "&6s", 15900)
%format( "&6s", Blazeward) %format( "&6s", @blazeward) %format( "&6s", 15100)
#WAIT 1200
%format( "&6s", Demonskin) %format( "&6s", @demonskin) %format( "&6s", 15400)
%format( "&6s", Dragonskin) %format( "&6s", @dragonskin) %format( "&6s", 15500)
%format( "&6s", Shield) %format( "&6s", @shield) %format( "&6s", 14000)
%format( "&6s", Valiance) %format( "&6s", @valiance) %format( "&6s", 16000)
#WAIT 1200
%format( "&6s", Slink) %format( "&6s", @slink) %format( "&6s", 14000)
%format( "&6s", Dragon Wit) %format( "&6s", @dragonwit) %format( "&6s", 14000)
%format( "&6s", Ethereal Shield) %format( "&6s", @etherealshield) %format( "&6s", 15700)
%format( "&6s", Dispel Magic) %format( "&6s", @dispelmagic) %format( "&6s", 15300)
#WAIT 1200
%format( "&6s", Ethereal Web) %format( "&6s", @etherealweb) %format( "&6s", 15800)
%format( "&6s", TrueSight) %format( "&6s", @truesight) %format( "&6s", 16200)
%format( "&6s", Eldritch Sphere) %format( "&6s", @eldritchsphere) %format( "&6s", 15600)
%format( "&6s", Protection) %format( "&6s", @protection) %format( "&6s", 14000)
#WAIT 1200
%format( "&6s", Grounding) %format( "&6s", @grounding) %format( "&6s", 15900)
%format( "&6s", Sanctuary) %format( "&6s", @sanctuary) %format( "&6s", 16000)
/s

-Prestopimp

Reply with quote
Darker
GURU


Joined: 24 Sep 2000
Posts: 1237
Location: USA

PostPosted: Sun Feb 23, 2003 5:12 am   
 
This is entirely unrelated, I just have to ask. Are you the same PrestoPimp from Tribes?



zMUD 6 Online Help: All the power you'll ever need.
Reply with quote
PrestoPimp
Apprentice


Joined: 18 Sep 2001
Posts: 175
Location: USA

PostPosted: Sun Feb 23, 2003 5:23 am   
 
I used to play tribes like a year ago or so, but not currently. Anyone else using my name is a fake.. because I have it registered with anything important.

-Prestopimp

Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Feb 23, 2003 2:18 pm   
 
You should not rely on the output of functions to be sent to the MUD correctly. For this purpose, you should pass this output to commands like #EXEC or #SEND. What I mean is that instead of doing something like:
%format( "&6s", Antimagic Shell) %format( "&6s", @antimagic) %format( "&6s", 15000)

you should do:
#EXEC {%concat(%format( "&6s", Antimagic Shell), %format( "&6s", @antimagic), %format( "&6n", 15000))}

or with #SEND if you don't want to see the command sent to the MUD.

By the way, I changed the last %format from "&6s" to "&6n", because 15000 is a number not a string.

Kjata
Reply with quote
PrestoPimp
Apprentice


Joined: 18 Sep 2001
Posts: 175
Location: USA

PostPosted: Sun Feb 23, 2003 8:19 pm   
 
All I need to know, is if there is anyway for the script editor not to take away the spaces that I want to enter so that they will send to the mud the exact way I want them.

-Prestopimp

Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Feb 23, 2003 8:28 pm   
 
Enclose the command in double-quotes.

Kjata
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