Official Nodeka Board  

Go Back   Official Nodeka Board > Nodeka > Scripting > UMC

Reply
 
Thread Tools Display Modes
  #1  
Old 06-26-2008, 05:16 AM
Xabren Xabren is offline
Novice
 
Join Date: Apr 2008
Posts: 25
Default #alias and new UMC

So in an older version of UMC (1.14.3 I think) I could use a line to kill things based on variables such as this:

Code:
#alias {kill}{#if {$psychic=1}{cast 'lightning' $0};#if {$psychic=0}{psy $0}}
My $psychic variable is 0 for up and 1 for down. Therefore when I would type "kill centaur" it would output "psy centaur" to the mud if $psychic is 0. Likewise, "cast 'lightning' centaur" would be the output if $psychic was 1.


With the newer versions post what I had before (including the latest 1.15.8) this no longer works.

With the above code if $psychic was 0 it would output "psy $0" instead of "psy centaur"


I have tried the following with no success:
Code:
#alias {kill %0}{#if {$psychic=1}{cast 'lightning' $0};#if {$psychic=0}{psy $0}}
#alias {kill %0}{#if {$psychic=1}{cast 'lightning' %0};#if {$psychic=0}{psy %0}}
Any suggestions? Thank you in advance,

- Xabren
Reply With Quote
  #2  
Old 06-26-2008, 08:37 AM
Nemesis's Avatar
Nemesis Nemesis is offline
Administrator
 
Join Date: Apr 2008
Posts: 48
Default

Try:
Code:
#alias {kill}{#if {$psychic=1}{cast 'lightning' $$0};#if {$psychic=0}{psy $$0}}
For each parentheses you have the variable embedded in, you'll need to add another $ to the beginning to read the outside variable in. It's a form of scoping.
__________________

Nodeka411.net Administrator
Reply With Quote
  #3  
Old 06-28-2008, 11:45 AM
Xabren Xabren is offline
Novice
 
Join Date: Apr 2008
Posts: 25
Default

Makes sense. Best thing is it worked too

Thanks.

- Xab
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:24 PM.


Design By: Miner Skinz.com
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.