|
Scuba82Steve Newbie
Joined: 09 Aug 2004 Posts: 8 Location: Arkansas
|
Posted: 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 |
|
|
|
Pseudo Wanderer
Joined: 25 Oct 2005 Posts: 99
|
Posted: 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) |
|
|
|
Scuba82Steve Newbie
Joined: 09 Aug 2004 Posts: 8 Location: Arkansas
|
Posted: 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. |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: 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... ;) |
|
|
|
Scuba82Steve Newbie
Joined: 09 Aug 2004 Posts: 8 Location: Arkansas
|
Posted: 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. |
|
|
|
Scuba82Steve Newbie
Joined: 09 Aug 2004 Posts: 8 Location: Arkansas
|
Posted: 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.
|
|
|
|
Slaem Apprentice
Joined: 20 Sep 2005 Posts: 135
|
Posted: 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 <>.
|
|
|
|
|
|