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


Joined: 01 Nov 2006
Posts: 114

PostPosted: Sat Mar 24, 2007 6:59 am   

Alias question
 
Ok, i'm sure this has been addressed, but how would i get it so that i have an alias for chatting, i want to guild chat,

so i have an alias in zmud that is

#alias {gt} {gcc (Mariul)}

in zmud it will spit out all info after i type gt

eg:

gt whats going on?

would look like

gcc (Mariul) whats going on?
Reply with quote
Tech
GURU


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

PostPosted: Sat Mar 24, 2007 7:10 am   
 
This should do what you want.
Code:

#alias gt {gcc ~(Mariul~) %params}
_________________
Asati di tempari!
Reply with quote
Ggoss
Apprentice


Joined: 01 Nov 2006
Posts: 114

PostPosted: Sat Mar 24, 2007 7:16 am   
 
Ohh another alias question, this is something you guys told me to do before, but doesn't seem to work right

#alias {ca} {cast 'arieks' @{target} %param(0)}

but when i type ca, it fails, an example from my mud

< 1418h/1418H 190v/190V Pos: standing >
<> cast 'arieks' (target)

You failed.


For some reason its not recognizing it as a target, even though its set as target. anyone one see whats wrong?

for completness sake here is my target alias value

#var target %1
#ECHO {---------- Your target is now %1 ----------}
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sat Mar 24, 2007 6:44 pm   
 
I'm quite surprised that %param(0) works. %params is the same thing now, anyway. You also don't need the braces around the variable name in @{target} since it's not a complex variable name.

Anyway, I used this test script to test your alias:

#var target blah
#alias ca {cast 'arieks' @{target} %param(0)} (#Alias doesn't like braces round the alias name)
ca dsjgjsk gjskhg

and the command sent was

cast 'arieks' blah dsjgjsk gjskhg

which seems to be working fine to me.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Ggoss
Apprentice


Joined: 01 Nov 2006
Posts: 114

PostPosted: Sun Mar 25, 2007 1:24 am   
 
yes it prompts correctly, but what i doesn't do is actually begin casting the spell. It says failed, for some reason its not seeing that target, it acts if its not in the room.

< 932h/1418H 176v/190V Pos: standing >
<> l

Just Inside the Goblin Livestock Caves
Obvious exits: -N -W
A goblin worker goes about its business in the livestock caves.(Red Aura)

< 932h/1418H 180v/190V Pos: standing >
<> ---------- Your target is now goblin ----------

< 933h/1418H 184v/190V Pos: standing >
<> l

cast 'arieks' goblin
Just Inside the Goblin Livestock Caves
Obvious exits: -N -W
A goblin worker goes about its business in the livestock caves.(Red Aura)

< 934h/1418H 188v/190V Pos: standing >
<>
You failed.

< 934h/1418H 188v/190V Pos: standing >
<> l goblin

This workers job is to carry the processed meats back to the goblin city.
He carries a fair amount of meat on his muscular shoulders. He is not a very
good looking goblin as he has quite a few facial scars. He often whines and
complains in a very shrill voice about the weight of his load.
A goblin worker appears to be Goblin and is in an excellent condition.
He's small in size.

<worn on back> a meat pack

< 934h/1418H 190v/190V Pos: standing

so you can see the target is in the room. so it should begin casting
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Sun Mar 25, 2007 1:49 am   
 
Very nice example thanks. Now could you do the exact same thing typing in "cast 'arieks' goblin" manually? Also, if it fails type in "cast arieks goblin" as well. leaving out the "".

If the second one works then use this alias.
Code:
#alias ca {cast arieks @target %params}
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Ggoss
Apprentice


Joined: 01 Nov 2006
Posts: 114

PostPosted: Mon Mar 26, 2007 7:48 pm   
 
Ok, here you go, new stuff

< 1344h/1630H 24v/256V Pos: standing >
<>
---------- Your target is now goblin ----------


< 1345h/1630H 28v/256V Pos: standing >
<> cast 'arieks' goblin

You failed.

< 1345h/1630H 32v/256V Pos: standing >
<> ---------- Your target is now ----------
cast 'arieks' goblin

You start chanting...

< 1347h/1630H 40v/256V Pos: standing >
<>
Casting: arieks shattering iceball

< 1347h/1630H 44v/256V Pos: standing >
<>
You complete your spell...
Your iceball shatters upon impacting a goblin worker, rending flesh and sending blood flying.
A goblin worker is incapacitated and will slowly die, if not aided.

< 1347h/1630H 44v/256V Pos: standing >
<> l

A Turn in the Gagga'Jobo Cave System
Obvious exits: -N -W
Shattered bits of ice are scattered about the area.
A goblin worker is lying here, incapacitated.(Red Aura)

As you can see without setting target it works great, and on my mud spells have to have cast 'name of spell'
Reply with quote
Ggoss
Apprentice


Joined: 01 Nov 2006
Posts: 114

PostPosted: Mon Mar 26, 2007 8:02 pm   
 
now if i use the help file and do

#alias ice($tar1) {cast 'arieks' $tar1}

it casts fine, but if i try to set an alias to set tar1 then it gets messed up
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Mon Mar 26, 2007 8:42 pm   
 
That's because $tar1 is a local variables and only exists within the scope of the alias ice. It is created and destroyed while ice is running, it is created by passing it as a parameter to ice like ice goblin so $tar1 becomes goblin and when the alias is complete $tar1 no longer exists.
_________________
Taz :)
Reply with quote
Ggoss
Apprentice


Joined: 01 Nov 2006
Posts: 114

PostPosted: Mon Mar 26, 2007 8:50 pm   
 
any idea how to get around my original problem with my target alias setup?
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Mon Mar 26, 2007 9:15 pm   
 
It sounds more like you have a trigger setting the variable for target rather than an alias. Anyway try what Arminas suggested but put your spell quotes back in so:

#alias ca {cast 'arieks' @target %params}
_________________
Taz :)
Reply with quote
Ggoss
Apprentice


Joined: 01 Nov 2006
Posts: 114

PostPosted: Mon Mar 26, 2007 9:17 pm   
 
thats what it is currently
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Mon Mar 26, 2007 9:23 pm   
 
Then try using the following:

#alias ca {#if (%numparam() = 0) {cast 'arieks' @target} {cast 'arieks' %params}}
_________________
Taz :)
Reply with quote
Ggoss
Apprentice


Joined: 01 Nov 2006
Posts: 114

PostPosted: Mon Mar 26, 2007 9:35 pm   
 
that works, but thats alot of work for something that should be much more simple. Thanks mano
Reply with quote
Wilhelm
Newbie


Joined: 28 Mar 2007
Posts: 3
Location: Bangor Washington

PostPosted: Wed Mar 28, 2007 6:13 pm   
 
Ok, i realize this is a probally a very simple question, but the problem i'm having is with a simple alias that works fine on zMud
I alias (aa) for <backstab>, so therefore i could enter "aa Zugg" and it would backstab zugg, however on cMud when i enter the same alias
I enter "aa Zugg' and i get "backstab what"? i have that problem with a few of my aliases.

here is the compiled code for the aa alias

0000 LINE 0 ; backstab
0012 ALIAS backstab (-1) <?> (class Kingsrook)

any suggestions? keep in mind i'm not a coder so answers in english would be appeciated Wink
Reply with quote
Tech
GURU


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

PostPosted: Wed Mar 28, 2007 7:58 pm   
 
In zMUD anything that followed the alias was automatically appended as alias input. In CMUD this isn't the case. There is an auto-append option you can assign for your alias. The alternative and preferred solution is to modify the alias.

Code:
#ALIAS aa {backstab %params}
_________________
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