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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Scuba82Steve
Newbie


Joined: 09 Aug 2004
Posts: 8
Location: Arkansas

PostPosted: Sun Dec 04, 2005 3:49 pm   

Simple Targeting Script Issue
 
Alright I've used the Script

Alias: t
Command: Target=%1

However, when I target say a rat ( t rat) and then type (dsl @target) it just says that there isn't one in the room. I may be doing something completely wrong as scripting isn't a strong feature of mine.

:) Any help is Appreciated
Thanks in Advance
Reply with quote
Pseudo
Wanderer


Joined: 25 Oct 2005
Posts: 99

PostPosted: Sun Dec 04, 2005 5:57 pm   
 
This will store the value in @target:
#ALIAS t {#var target %1}
Now you can target the rat using (t rat).
Assuming dsl is a command on your mud or another alias, the example you provided above will now work. (dsl @target)
Reply with quote
Scuba82Steve
Newbie


Joined: 09 Aug 2004
Posts: 8
Location: Arkansas

PostPosted: Sun Dec 04, 2005 11:39 pm   
 
That still didn't work. It still says that it can't find the target. I tried just copying the script you wrote and entering it into the text prompt but nothing happened.

So i went into the alias tag and put T for alias and then for the command I put #var target %1 but it still said it can't find the target when I dsl it.
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Sun Dec 04, 2005 11:41 pm   
 
what does it actually send?

If you type #show @target
Is it showing the correct thing?
_________________
CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;)
Reply with quote
Scuba82Steve
Newbie


Joined: 09 Aug 2004
Posts: 8
Location: Arkansas

PostPosted: Mon Dec 05, 2005 1:46 am   
 
Ohh, Well when I type #show @target and I had targeted a Rat it does say "rat" So i guess it is working.

Why then when I type DSL @target would it say "Nothing can be seen here by that name." I've been using DSL RAT the whole time and it worked fine. Do I need to set something else to tell it what DSL is?

Thanks a Bunch you guys, I really appreciate it.
Reply with quote
Scuba82Steve
Newbie


Joined: 09 Aug 2004
Posts: 8
Location: Arkansas

PostPosted: Mon Dec 05, 2005 1:53 am   
 
Ahh I figured it out now. I had to create a seperate alias named DSL the command to be ~DSL @TARGET. Wouldn't have done it without you all, I appreciate all the help.
Reply with quote
Slaem
Apprentice


Joined: 20 Sep 2005
Posts: 135

PostPosted: Mon Dec 05, 2005 8:07 am   
 
@variable in the command line isn't expanded unless the Expand Vars option is turned on in the General Preferences. To expand a variable in the command line you must surround it with angle brackets <>.
_________________
Show your love.
Support Zugg Software!
Donate to zugg@zuggsoft.com with PayPal Send Money.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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