|
OmegaDeus Apprentice
Joined: 14 Sep 2005 Posts: 121
|
Posted: Mon Oct 17, 2005 5:13 am
Editplus zMUD Script color syntax |
I currently use a very powerful text editor called Editplus. I've just recently (tonight) written the script needed for it to make zmud scripts (.mud files) have colored syntax. Here is the code for the file required. You must copy this into a regular text document then name it anything.stx
Code: |
Removed by Vijilante. See the Finished Script Forum. |
Then under Document->Permanent Settings, goto the files sub menu, and select Settings & Syntax, click on add, put anything for description and more than likely mud for the extension, and point the syntax file to where you stored your .stx file, most commonly they are stored in the editplus root. once you point the syntax file and click apply settings, restart editplus so it recognizes the file and then go back and set your colors as you like them and enjoy. Now whenever you create a document of the zmud type, or open one, all your scripts will be in pretty colors. |
|
_________________
Look at me I've got zSKILLS |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Mon Oct 17, 2005 3:40 pm |
Thanks Omega... I use EditPlus all the time and this will be a boon to me. A few years ago when I was big into MUDding (recently got back into it) I'd considered doing something similar myself. I did notice that you don't have any code completion there. Any plans to add that, or would that be later on?
|
|
_________________ Asati di tempari! |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Mon Oct 17, 2005 3:50 pm |
For kicks I checked the EditPlus page to see if there were any other's already defined and there was one by Matthew "Triggum" Walls. He takes a slightly different approach, but also includes shortname versions of most commands.
|
|
_________________ Asati di tempari! |
|
|
|
OmegaDeus Apprentice
Joined: 14 Sep 2005 Posts: 121
|
Posted: Mon Oct 17, 2005 4:10 pm |
I am actually working on autocompletion, it just takes a little while longer because i have to sift though what is and isn't in need of autocompletion. His is a better version of mine cept for one part. Add # to function, @ to variable, and put a PREFIX3=@ just below the case, that will make @blah show up as a variable too. Oh, also, if you want colored numbers, add #number_pattern=cpp
[edit] using his structure, i've revised to make a better layout. Mine is turning out to be quite a color syntaxing. He didn't include quote characters to the delimeters, he should have, and i also put the quotation marks in so that they color now. |
|
_________________
Look at me I've got zSKILLS |
|
|
|
OmegaDeus Apprentice
Joined: 14 Sep 2005 Posts: 121
|
Posted: Mon Oct 17, 2005 5:09 pm |
This is a good way for color syntaxing, but I'd eventually like to take this a step further by making a program that'd be a standalone zmud script editor that could tell you whether a trigger would match, and also, if i could do it(or talk zugg into it) make a complete tester to test what the input is and if it hits the trigger, test to see what the output is w/o having to crash zmud with a recursive loop.
|
|
_________________
Look at me I've got zSKILLS |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Mon Oct 17, 2005 5:34 pm |
Well I couldn't resist, I tweaked both of them and added a few other items, for what is, hopefully, going to be the definitive syntax file for zMud and EditPlus. Omega let me know if you have any additional input.
Code: |
Removed by Vijilante. See the Finished Script Forum. |
|
|
_________________ Asati di tempari! |
|
|
|
OmegaDeus Apprentice
Joined: 14 Sep 2005 Posts: 121
|
Posted: Mon Oct 17, 2005 5:57 pm |
Actually I've edited mine too, and it looks very similar to that. I also added %1..%99 into my variables, cuz quite frankly they are, they take up quite a bit of space but it's worth it to have them color right. Here's my latest. I'm currently working on that autocomplete for you and hope to be done with that sometime today, but there's a lot of research and tweaking that goes into making that sonofa work right.
Code: |
Removed by Vijilante. See the Finished Script Forum.
|
|
|
_________________
Look at me I've got zSKILLS |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Mon Oct 17, 2005 6:14 pm |
I'm wondering if we should post the final product under finished scripts.
|
|
_________________ Asati di tempari! |
|
|
|
Wallsy Newbie
Joined: 07 Nov 2005 Posts: 1 Location: Melbourne
|
Posted: Mon Nov 07, 2005 2:29 pm |
Wow, the things you find when you Google your name. ;-)
When you get a definitive version of the file done, could you mail me a copy? I'll send it on to the EditPlus people to replace the version that's there ATM. |
|
|
|
OmegaDeus Apprentice
Joined: 14 Sep 2005 Posts: 121
|
Posted: Mon Nov 07, 2005 8:24 pm |
Oh, i've got a definitive copy, i'll post it in the finished scripts section
|
|
_________________
Look at me I've got zSKILLS |
|
|
|
saplingg Novice
Joined: 06 Oct 2005 Posts: 31
|
Posted: Tue Nov 08, 2005 10:51 am |
I do not understand. What does this do?
|
|
|
|
Vitae Enchanter
Joined: 17 Jun 2005 Posts: 673 Location: New York
|
Posted: Tue Nov 08, 2005 4:02 pm |
I'll post OmegaDeus' 1st 2 lines in this whole post:
Quote: |
I currently use a very powerful text editor called Editplus. I've just recently (tonight) written the script needed for it to make zmud scripts (.mud files) have colored syntax. |
Does that make any MORE sense to you? |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Tue Nov 08, 2005 10:58 pm |
Since the actual meat of this topic was transferred over to the Finished scripts forum...I am going to edit out those very lengthy code blocks. I am sick of scrolling through them.
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
|
|
|
saplingg Novice
Joined: 06 Oct 2005 Posts: 31
|
Posted: Wed Nov 09, 2005 5:48 am |
Uh, no, Vitae, it doesn't. Doesn't zMUD already colour your syntax?
|
|
|
|
Slaem Apprentice
Joined: 20 Sep 2005 Posts: 135
|
Posted: Wed Nov 09, 2005 5:55 am |
From what I gather, it's for viewing external zscript files with Pretty Print. That is, if you copy any zscript to a file, it has no color. Using EditPlus, Omega has enabled that sw to provide Pretty Print coloring for easier reading of your saved zscript files. So, while very nifty, I presume this is limited to having EditPlus.
|
|
|
|
Pseudo Wanderer
Joined: 25 Oct 2005 Posts: 99
|
Posted: Wed Nov 09, 2005 2:49 pm |
This is not an advertisement.
The product they are referring to can be found here: http://www.editplus.com/
It is a text editor with customizable syntax highlighting, customizable auto-completion, and other features.
It is not free. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Nov 09, 2005 5:05 pm |
And actually, another interesting fact to keep in mind is that in zMUDXP I am using the various zApp components, and the zApp zMemo component has syntax highlighting. The syntax highlighting in zMemo has a new method that allows an EditPlus *.stx file to be loaded for the syntax. So, in zMUDXP, when you have a script written in VBScript, zMUDXP will load the vbscript.stx file. If your script is written in PerlScript, it will load the perlscript.stx file. When using the default zScript, the syntax is loaded internally, but you can optionally provide a zscript.stx file to override the internal syntax.
So the file that Omega created could have more use for regular zMUDXP users in the future. |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Wed Nov 09, 2005 7:23 pm |
Zugg that is sooooooo sweet. Will you have support for their autocompletion file too?
|
|
_________________ Asati di tempari! |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Nov 09, 2005 9:28 pm |
Autocompletion will have to come later. The zApp stuff doesn't have autocompletion, it only has syntax highlighting. So it's possible to add in the future, but it doesn't come "for free" along with zApp features.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Nov 09, 2005 9:32 pm |
I guess I have another question for EditPlus users though:
It seems that you can have several #KEYWORD sections in the stx file. But what controls the actual text style of these keywords? Is there some other settings in EditPlus where you assign the color and text attributes to each keyword section? Or do all of the keyword sections get styled the same? And does it have options to set a style for delimiters, line comments, etc? I don't have EditPlus myself, so I'm just going by there documentation for the stx file.
In zMUDXP (and zApp), each syntax "rule" is assigned to a particular text style name. And then you can set the color, font, etc of each style name just like any other style in an editor. So maybe I need to take the name of the #KEYWORD section and use that for the style name? Any advice on this would be appreciated. |
|
|
|
OmegaDeus Apprentice
Joined: 14 Sep 2005 Posts: 121
|
Posted: Thu Nov 10, 2005 2:04 am |
It's in the settings file, you have to manually create the link to the file in EditPlus and then once you've made the links you set the colors through there. I think it'd be easier if you set everything in the .STX file and just created the link to it. As far as the #KEYWORD sections, you can only have 5 of them, and if you want numbers colored, you are only limited to cpp, or wasting an entire #KEYWORD section for your own colors for numbers. I'd much like it to have more than 5 keyword sections and the likes, but for now that will have to do since editplus has regular expression checking which make is it real easy to do replaces and such. like searching for | and replacing it with \n on all the values of string lists or db vars to put each item on it's own line to change what's broke, then replacing \n with | again to port back into the syntax editor. For me it's a very great way to search through some of my GUIs and replace the one little item that's making the whole thing look messed up, while still having colored syntax.
|
|
_________________
Look at me I've got zSKILLS |
|
|
|
OmegaDeus Apprentice
Joined: 14 Sep 2005 Posts: 121
|
Posted: Thu Nov 10, 2005 2:08 am |
Oh BTW, this is the entire help file on the syntax highlighting for you zugg:
Code: |
EditPlus supports powerful and customizable syntax highlighting for HTML, CSS, PHP, ASP, Perl, C/C++, Java, JavaScript and VBScript by default. Also, you can create your own syntax file to support other programming languages.
In order to add your own syntax type, you must create a syntax file and add it on Settings & Syntax page of the Preferences dialog box.
Syntax file is a plain text file which has ".STX" extension and should be written in predefined format. The format is very simple. The fastest way is to look into the sample .STX file such as JS.STX for JavaScript files (*.JS).
Header Information
#TITLE=C/C++
#DELIMITER=,(){}[]-+*%/="'~!&|\<>?:;.
#QUOTATION1='
#QUOTATION2="
#CONTINUE_QUOTE=n
#LINECOMMENT=//
#LINECOMMENT2=
#COMMENTON=/*
#COMMENTOFF=*/
#COMMENTON2=
#COMMENTOFF2=
#ESCAPE=\
#CASE=y
#PREFIX1=
#PREFIX2=
#PREFIX3=
#PREFIX4=
#PREFIX5=
#SUFFIX1=
#SUFFIX2=
#SUFFIX3=
#SUFFIX4=
#SUFFIX5=
#HTML_EMBEDDED=
#SCRIPT_BEGIN=
#SCRIPT_END=
#HEREDOC=
#AUTOCASE=
#NUMBER_PATTERN=cpp
#SPECIAL_STX=cpp
All statements must be prefixed with '#' sign.
#TITLE
The title of syntax file. It should be located at the first line of the file. Otherwise, EditPlus cannot load it.
#DELIMITER
Specify delimiters for parsing keywords. You don't need to specify the space character and the tab character here, since those are treated as delimiter by default.
#QUOTATION1
Specify quotation mark. Enter only one character.
#QUOTATION2
Specify alternate quotation mark. Enter only one character.
#CONTINUE_QUOTE
This option allows un-terminated quotation to be continued to next line. 'y' for yes and 'n' for no. 'n' is default value.
#LINECOMMENT
Specify a string which turns on line comment. If you prefix ^! to the line comment string, it works only when located at the beginning of line.
#LINECOMMENT2
Specify a string which turns on line comment 2. If you prefix ^! to the line comment string, it works only when located at the beginning of line.
#COMMENTON
Specify a string which turns on block comment.
#COMMENTOFF
Specify a string which turns off block comment.
#COMMENTON2
Specify a string which turns on block comment 2.
#COMMENTOFF2
Specify a string which turns off block comment 2.
#ESCAPE
Specify escape character. Enter only one character here.
#CASE
Specify case sensitivity. 'y' for yes and 'n' for no. Default value is 'n'.
#PREFIX1 - #PREFIX5
Specify keyword prefix character. Any word that follows the prefix will be treated as a keyword.
#SUFFIX1 - #SUFFIX5
Specify keyword suffix character. Any word that precedes the suffix will be treated as a keyword.
#HTML_EMBEDDED
Specify 'y' if it is HTML-embedded script such as PHP. See 'PHP.STX' for an example.
#SCRIPT_BEGIN
Specify the string which turns on HTML-embedded script. Valid only if #HTML_EMBEDDED is 'y'. See 'PHP.STX' for an example.
#SCRIPT_END
Specify the string which turns off HTML-embedded script. Valid only if #HTML_EMBEDDED is 'y'. See 'PHP.STX' for an example.
#HEREDOC
Specify a string for heredoc in Perl and PHP files. For example, #HEREDOC=<<EOF.
#AUTOCASE
Specify 'y' if you would like to use the automatic keyword case correction feature.
#NUMBER_PATTERN
'cpp' for C/C++ number syntax highlighting.
#SPECIAL_STX
'html' for HTML sytax file, 'cpp' for C/C++ syntax file, and 'perl' for Perl syntax file. Leave blank for all other syntax files.
You can also insert comment line in syntax file. Comment line must begin with semicolon(;). If you need to add a keyword which begins with semicolon, you must prefix an escape character '^' to it.
Keyword groups
#KEYWORD=Reserved words
abstract
boolean
break
#KEYWORD=Compiler directives
...
Each keyword group begins with #KEYWORD statement with optional description of the group. Keyword list follows from the next line. If you need to include '#' sign into a keyword, you must prefix an escape character '^' to it like this: '^#'. In this case, the '#' sign should not be included in #DELIMITER statement. You can specify up to 5 keyword groups.
User files repository
EditPlus web site has a collection of user files (stx, ctl, acp files) on User Files page. You can submit your own syntax file to <submit@editplus.com> if you would like to share your file with other users. |
|
|
_________________
Look at me I've got zSKILLS |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Thu Nov 10, 2005 2:45 am |
A little off topic, I use Macromedia Homesite 5 for my script editing and I have a nice little zscript syntax file for it if anyone wants it.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu Nov 10, 2005 4:48 pm |
Omega, yeah, I had found that help file on the net (in Wikipedia of all places). But it doesn't answer my questions. It doesn't mention how EditPlus actually sets up the text style for each keyword, and whether each keyword section has it's own style or not. So I still need some tips on how the stx file is actually associated with text styles.
Nexela, I'd be interested in anything you have for Homesite. If they have an easy interface and some documentation, it probably wouldn't be hard to support it. I've gotten the zApp Memo control syntax highlighting working really well and it has very flexible regular expression patterns for syntax highlighting, so I can probably adopt most anything to it. Converting the EditPlus file only took a couple of hours. |
|
|
|
|
|