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


Joined: 04 Jan 2009
Posts: 20

PostPosted: Wed Jan 14, 2009 5:50 am   

[2.37] Alias Question [Solved]
 
Hello.

Since I am not familar with scripting and coding I'd need your help solving the following problem:

I created a status window, displaying all the information I need. It also contains a friend and enemylist.

The problem I have is creating an alias that refers to my enemy-variables, names and "nothing".
I set variables for my friends and enemies, f1 - f4 / e1 - e4. I have an alias 'fk' {fkick}. What I want now is that 'fk' can be {fkick,fkick %0 and fkick e1,e2,etc}

I hope anyone here can help me. Thanks in advance.


Last edited by miischi on Wed Jan 14, 2009 10:14 pm; edited 1 time in total
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed Jan 14, 2009 2:06 pm   
 
Let me see if I understand you. You have variables, @f1, @f2, @f3, @f4, @e1, @e2, @e3, @e4. You want to have an alias such that you can type 'fk e1' to do an fkick on everyone in the list e1, and can also do 'fk rahab' to do an fkick on the specific character rahab? One question I have is whether fkick can operate on an entire list at once, or whether you need to do it separately for each one? It might be useful to actually show your current alias.

That said, here's some partial code that might get you started.
Code:
#if (%0 = "e1" or %0 = "e2" or %0 = "e3" or %0 = "e4") {
  fkick @{%0}
} {
  fkick %0
}

If you have to do a separate fkick for each name in the list, then replace 'fkick @{%0}' with:
Code:
forall @{%0} {fkick %i}
Reply with quote
miischi
Beginner


Joined: 04 Jan 2009
Posts: 20

PostPosted: Wed Jan 14, 2009 4:39 pm   
 
Thanks a lot :) The code you provided did exactly solve my problem.
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