|
brianz19 Newbie
Joined: 24 Apr 2013 Posts: 8 Location: las vegas
|
Posted: Wed Apr 24, 2013 11:24 pm
Targetting script/alias |
I tried to search through the forums here and couldn't figure anything out so I'm posting here, I'm sure there's already an answer so if anyone knows and just wants to link it I appreciate it!
I am new to zmud and have always been using mushclient, but have since transferred to zmud since I can use maps on it!!
There are two alias's/scripts I'd like to set up. A little foreword is that I use the keypad to move around and stuff- don't know if that affects anything with zmud.
1.
In mushclient I have an alias that is "k %1" "set alias 100 k %1" , pretty simple I know, but when I do the same thing in zmud it doesn't do anything for some reason.
2.
The second is I want to be able to type "j %1" and then have it set up a variable target to another key, and also have a world note be sent to myself saying that "target is %1"
Hope that all makes sense, and thank you in advance!! |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Thu Apr 25, 2013 2:53 am |
1)#alias name {stuff to do}
2)see #1. To make macros, use #KEY. To assign data to variables, use #VARIABLE. To print to the screen, use #SAY or #ECHO (#ECHO depends on window focus, so you might find that sometimes it'll go to the wrong window).
Take the time to read the helpfile. Arguments can be made as to the quality of it, but the basics are more than adequately covered. Also, don't be afraid to explore topics (tip: to get to a particular command's helpfile, type out the command, place the cursor anywhere in the command and press F1). |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
brianz19 Newbie
Joined: 24 Apr 2013 Posts: 8 Location: las vegas
|
Posted: Thu Apr 25, 2013 4:02 pm |
Cool thanks, I've pretty much figured it out, although I have a question about #say.
I wish to make it cleaner, so that only what I want to see echoed is echoed..
Currently when I do #say it messes up the variable so that once the target is set I can't change it..and also, it includes the entire text of the alias, instead of just what I want to see. |
|
|
|
hogarius Adept
Joined: 29 Jan 2003 Posts: 221 Location: islands.genesismuds.org
|
Posted: Thu Apr 25, 2013 7:30 pm |
The script for your j alias should read something like this:
target = %1
#KEY Alt-T {@target} {} {append|nosend}
#SAY "Target is " @target
Then, if you want to add in the target text at the end of the current command line, press ALT-T.
If you are still having trouble, please post the scripts for the aliases so we can see what you are trying to do. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Thu Apr 25, 2013 7:30 pm |
show us the code you are using and we can see if anything is wrong, also #PRINT is much the same as #SAY and #ECHO except it wont cause your triggers to fire
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
brianz19 Newbie
Joined: 24 Apr 2013 Posts: 8 Location: las vegas
|
Posted: Thu Apr 25, 2013 8:44 pm |
i just did a really basic one
#alias j {#variable "target1"} |
|
|
|
brianz19 Newbie
Joined: 24 Apr 2013 Posts: 8 Location: las vegas
|
Posted: Thu Apr 25, 2013 9:36 pm |
n if i add #say
i can no longer change the target variable, if that makes sense |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Thu Apr 25, 2013 10:18 pm |
the reason you can't change it is because you are setting the target1 variable to nothing.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
brianz19 Newbie
Joined: 24 Apr 2013 Posts: 8 Location: las vegas
|
Posted: Thu Apr 25, 2013 10:45 pm |
I don't understand what you mean, I can change it perfectly fine until I add the #say, #print, or #echo
|
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Fri Apr 26, 2013 2:10 am |
As Matt said, you're setting the target1 variable to nothing. You need to use #variable target1 {%1} if you want to set the value to the first parameter to the alias.
|
|
|
|
brianz19 Newbie
Joined: 24 Apr 2013 Posts: 8 Location: las vegas
|
Posted: Sat Apr 27, 2013 1:30 am |
I don't really understand what you guys are saying, because it works fine for me! although for some reason it doesn't work for me friend , it says variable not defined.
the only time it doesnt work for me is when I Add say print or echo.
so right now my alias is #alias o {#variable "target1"}
and you're saying it should be #alias o {#variable "target1"{%1}} ??? |
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Sat Apr 27, 2013 3:13 am |
Right, you need to provide a value to set the variable to. Check out the documentation on the #variable command :)
|
|
|
|
brianz19 Newbie
Joined: 24 Apr 2013 Posts: 8 Location: las vegas
|
Posted: Sat Apr 27, 2013 3:18 am |
I'm not smart enough to understand that stuff.
when i type in #alias o {#variable "target1"{%1}}
it doesnt work |
|
|
|
brianz19 Newbie
Joined: 24 Apr 2013 Posts: 8 Location: las vegas
|
Posted: Sat Apr 27, 2013 3:40 am |
Nvm I figured it out, but it still doesn't work when I add in #say
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Apr 27, 2013 7:11 pm |
character 32 (the space) is what ZMud uses to separate arguments and commands from each other. You don't have a space between target1 (by the way, you don't need quotes around the variable name unless it's multi-word or is itself a variable reference) and {%1}, so you basically have a more complicated version of your original issue.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Sat Apr 27, 2013 7:17 pm |
Just copy/paste this in:
Code: |
#alias o {#variable target1 {%1};#say "Target is now "%1} |
|
|
|
|
|
|