|
Amylon Novice
Joined: 31 Jan 2003 Posts: 49 Location: Australia
|
Posted: Fri Jun 25, 2004 11:02 am
Creating Macro's from a script |
I am at present writing a script and need to be able to give the user the ability to set the macros to what they desire. I tried like this but it failed, am I doing it wrong? (NOTE: If pasted into command line it works fine, if Brought in through settings/import/Ascii script it fails)
#CLASS WOOD
#PR woodkey "Set wood to which key? e.g F3 F4 etc"
#PR metalkey "Set metal to which key? e.g. F3, F4 etc"
#KEY @metalkey {mine metal}
#KEY @woodkey {chop wood}
#CLASS 0 |
|
|
|
Zener Wanderer
Joined: 31 May 2004 Posts: 54 Location: USA
|
Posted: Fri Jun 25, 2004 1:15 pm |
quote: Originally posted by Amylon
I am at present writing a script and need to be able to give the user the ability to set the macros to what they desire. I tried like this but it failed, am I doing it wrong? (NOTE: If pasted into command line it works fine, if Brought in through settings/import/Ascii script it fails)
#CLASS WOOD
#PR woodkey "Set wood to which key? e.g F3 F4 etc"
#PR metalkey "Set metal to which key? e.g. F3, F4 etc"
#KEY @metalkey {mine metal}
#KEY @woodkey {chop wood}
#CLASS 0
I hate to tell you but when I copy/pasted it into an alias and it worked just fine.
Note: Do NOT copy/paste the following with a blank line between the 2 aliases. Make sure to delete the blank line.
#ALIAS Setwood {#CLASS WOOD
#PR woodkey "Set wood to which key? e.g F3 F4 etc"
#KEY @woodkey {chop wood}
#CLASS 0}
#ALIAS Setmetal {#CLASS WOOD
#PR metalkey "Set metal to which key? e.g. F3, F4 etc"
#KEY @metalkey {mine metal}
#CLASS 0}
~Zener |
|
|
|
Amylon Novice
Joined: 31 Jan 2003 Posts: 49 Location: Australia
|
Posted: Fri Jun 25, 2004 1:48 pm |
Seems it was a timing issue with its place within the script.
By placing the code you did near the top and also adding a
#alarm +3 {setwood;setmetal} at the end its all works now when imported as a script. Cut and Paste is just bad news with zmud is the main reason I wanted this fixed.
Thanks for pointing out the obvious to me, seems often the simplist of things is overlooked, I never even considered doing it with an alias! :)
:)Thanks:) |
|
|
|
nabob Beginner
Joined: 01 Aug 2004 Posts: 10
|
Posted: Sun Aug 01, 2004 8:27 pm |
I have experienced a lot of difficulty with import/ascii.
Sometimes it works just fine, and sometimes it works not at all.
I recently copy/pasted a class including several multi-state triggers put together by a friend. Everything looks fine in notepad, but when I import it.. the trigger patterns show up in the triggers with the braces included, not everything is imported, and generally, it is all messed up.
I went through and deleted all the blank lines between trigger definitions and still, Zmud choked on it.
Is there some kind of trick to getting Zmud to reliably import ascii scripts? |
|
|
|
|
|