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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Somarc
Newbie


Joined: 19 May 2006
Posts: 6
Location: Kansas

PostPosted: Sun Sep 06, 2009 11:42 pm   

Why don't this work?
 
I'm not a coder so I keep my stuff pretty simple, I play Duris and I have a problem with getting a var to assign. I have an alias for a spell lets say "ab" for "cast 'acid blast' " so the alias reads ab %1;%1 = @tar ; then i have buttons for my attack spells using that variable so on the command line I should be able to put "ab mob" then all my subsequent attacks using buttons, the buttons work but the variable has nothing in it. The part that really baffles me is it worked for awhile now it don't work at all. So, whats wrong?
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Mon Sep 07, 2009 12:37 am   
 
First of all, when assigning variables, the sytanx is:

variable=value

Second, when assigning variables, you never use the @ symbol, so...

tar=%1

instead of

%1=@tar.

That should fix your problems. If not, you'll need to post more on what's happening.

Charneus
Reply with quote
Somarc
Newbie


Joined: 19 May 2006
Posts: 6
Location: Kansas

PostPosted: Mon Sep 07, 2009 2:29 am   
 
ok so i wrote it wrong this is actually whats in my settings "cast 'bigby' %1;tar = %1" and just after I posted this I logged on and it worked exactly the way it should... logged off and back on and it don't work again... oh btw this is my button setting " b @tar "
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Tue Sep 08, 2009 2:31 am   
 
Can you post the actual code from your button? Best is to copy the XML version of the button and post it here, within code markers, like this:
Code:
[code]
your xml code here
[/code]
Reply with quote
Somarc
Newbie


Joined: 19 May 2006
Posts: 6
Location: Kansas

PostPosted: Wed Sep 09, 2009 11:52 am   
 
Code:
<button autosize="false" width="36" height="23" color="#8000FF" textcolor="silver" priority="4" id="1052">
  <caption>Bigby</caption>
  <value>b @tar</value>
</button>
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Wed Sep 09, 2009 2:22 pm   
 
I just tried the code and it worked fine for me, so me guess is that the @tar variable is no longer visible to the button or is no longer defined.

The easiest way to tell this is to look at the code for the button. If the variable shows up as red, it's not visible/accessible.

Here's the code I had
Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <alias name="cb" copy="yes">
    <value>cast 'bigby' %1;tar = %1</value>
  </alias>
  <button autosize="false" width="36" height="23" textcolor="silver" priority="4" copy="yes">
    <caption>Bigby</caption>
    <value>b @tar</value>
  </button>
</cmud>
_________________
Asati di tempari!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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