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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
adamwalker
Apprentice


Joined: 12 Mar 2005
Posts: 195

PostPosted: Sun Aug 06, 2006 3:30 am   

[103] The use of @var #var and sending to mud
 
1. Will the @variable = 1 syntax be reintroduced into cmud, i use this in a lot of my code as opposed to #var variable 1. Mainly because im lazy and @variable keeps giving me syntax errors.

2. When running a simple script. eg.

Code:
#if (!@mist) {outp arkasu;fill @arkasupipe with arkasu;#if (@equilibrium) {light @arkasupipe};#var pipeempty  0}


It dumps the entire code to the mud. Rather then

outp arkasu;fill pipe5242 with arkasu;light pipe5242


chears guys
Reply with quote
edb6377
Magician


Joined: 29 Nov 2005
Posts: 482

PostPosted: Sun Aug 06, 2006 5:15 am   
 
Using an alias called test I get this output. I did notice you have an extra space between pipeempty and 0 although this wont cause it to spit out the code. I didnt create and test with values in @MIST or @arkasupipe or @equilibrium. The test alias fired perfectly fine according to what variables I had set. This leads me to believe it could be a variable TYPE conflict.

Code:

outp arkasu
fill  with arkasu


ALIAS :
TEST

SCRIPT :
#if (!@mist) {outp arkasu;fill @arkasupipe with arkasu
#if (@equilibrium) {light @arkasupipe}
#var pipeempty 0}

Compiled Script (hmm didnt copy the whole thing) make sure it compiles.
Code:

0000   LINE   2   ; #if (!@mist) {outp arkasu;fill @arkasupipe with arkasu
0012   PUSHEXP   0028
0020   JUMP   0056
0028   VARREF   @mist <?>   (class materiamagica_def)   
0052   NOT   
0056   ARGSTR   !@mist
0072   PUSHLOC   0088
0080   JUMP   0508
0088   STR   'arkasu'
0112   ALIAS   outp (1) <?>   (class materiamagica_def)   
0136   VARREF   @arkasupipe <?>   (class materiamagica_def)   
0164   STR   'with'
0184   STR   'arkasu'
0208   ALIAS   fill (3) <?>   (class materiamagica_def)   
0232   LINE   0   ;
_________________
Confucious say "Bugs in Programs need Hammer"
Reply with quote
adamwalker
Apprentice


Joined: 12 Mar 2005
Posts: 195

PostPosted: Sun Aug 06, 2006 10:31 am   hmmm
 
ok i remade the alias. and now it seems to work. but im not sure why.

heres another example of the same problem

Code:
#if ((@autopointhealth) and (@equilibrium) and (@healthpercent < 40) and (!@dohh)) {
  @dohh = 1
  point pipes507 me
  #alarm +6 {@dohh = 0}
  }


now this one does come with syntax errors. ive followed what the parser says is 'wrong' but i still cant figure it out.

a lot of my scripts are dumping to the mud regardless of syntax errors or otherwise
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Sun Aug 06, 2006 11:41 am   
 
The syntax of @var = value has always been incorrect, but zMUD lets it slide. Don't do this. Leave off the @ when you use = this way.
Reply with quote
adamwalker
Apprentice


Joined: 12 Mar 2005
Posts: 195

PostPosted: Sun Aug 06, 2006 12:08 pm   
 
thats great thanks. looks like my problems are solved. now i just have the issue of alias's having to be remade for them to work properly even tho they have no syntax errors. i think ive read someone reporting this before so fingers crossed about it being fixed!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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