[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Importing triggers

Importing triggers

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by TommyKetchup   (3 posts)  [Biography] bio
Date Mon 21 Mar 2005 04:14 PM (UTC)
Message
Hi,

I am importing some old triggers from Pueblo 2.01, if anyone knows of that client. However since pueblo writes it triggers and alias into a .txt format, Mushclient is having a few problems importing it, cause it expects all files in a .XML format.

This is what I have tried so far :-

Opened my old alias file into word, and saved it as an XML file, and then tried to import it. However when I did that I got several errors :-

i) Popup window - "There was a problem parsing the XML. See the error window for more details"
ii) Line 3: Attribute name must start with letter or underscore, but starts with ":" (problem in this file)

Does anyone have any ideas on how to get around this.

Regards
TK
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #1 on Mon 21 Mar 2005 07:38 PM (UTC)
Message
Pueblo and mushclient probably have completely different trigger attributes and styles. I know you wont be able to simply import. And doubt you'll be able to do a few text replacements either. Since they simply arent the same recording style.

However, conversion might be possible. Mind posting some of the text (and what it does)?

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by TommyKetchup   (3 posts)  [Biography] bio
Date Reply #2 on Mon 21 Mar 2005 08:27 PM (UTC)
Message
Here is a small section of one of my alias/action files

#alias <alias name> <the actions that the alias performs>
#action <txt that is sent from the mud> <the alias or action that reacts to the incoming text>

#action {You bless your armour with the power of the beads.} {by1;wear amulet;wear beads}
#alias {cc} {condition charlie}
#alias {cer} {ceremony}
#alias {cleric} {fantasy;s;s;w;s;sw;w;w;w;w;s;s;s;s;s;s;s;s;s;s;s;s;s;s;s;s;s;s;s;s;s;w;w;n;e;e}
#alias {cleric1} {w;w;s;e;e;n;n;n;n;n;n;n;n;n;n;n;n;n;n;n;n;n;n;n;n;n;n;n;e;e;e;e;e;e;n;n;hub}
#action {+[ Thou hast made %1 guild exps ]+} {gs}
#action {You bless your armour with the power of the beads.} {by1;wear amulet;wear beads}
#action {You receive five holy rewards.} {robe;by1;wear amulet;wear beads}
#action {You summon a small loaf of bread from thin air.} {eat loaf}

These are simple tintin++ commands I have been told. If you need more info, please let me know.

Regards
TK
[Go to top] top

Posted by Shadowfyr   USA  (1,786 posts)  [Biography] bio
Date Reply #3 on Tue 22 Mar 2005 03:01 AM (UTC)
Message
TinTin   Mushclient
------   ----------
alias    alias
action   trigger

Beyond that, its a bit different.

In the simplest form an alias would be:

<aliases>
  <alias
   match="cleric"
   enabled="y"
   send_to="10"
   sequence="100"
  >
  <send>fantasy;s;s;w;s;sw;w;w;w;w;s;s;s;s;s;s;s;s;s;s;s;s;s;s;s;s;s;s;s;s;s;w;w;n;e;e</send>
  </alias>
</aliases>

Unlike TinTin, aliases are not 'usually' entered direct into the command window. The easiest solution is to copy the above lines from this post, then go to the alias window and look for the 'Paste' button. If all went well, then it should be active and clicking on that will enter it directly into the client. There is also a script execution prefic you can use, which is by default '/', and be used to do almost the same thing. For instance:

/importXML("<aliases><alias match=""cleric"" enabled=""y"" send_to=""10"" sequence=""100""><send>fantasy;s;s;w;s;sw;w;w;w;w;s;s;s;s;s;s;s;s;s;s;s;s;s;s;s;s;s;s;s;s;s;w;w;n;e;e</send></alias></aliases>")

would be the same as entering your 'cleric' alias from the command line in TinTin. Note the doubled " to mean a literal one and the setting 'send_to="10"'. That setting is 'send to execute', which treats the commands as literally typed from the command line, otherwise the ';' would be sent, instead of treated as a command seperator. The above requires scripting to be enabled and works with VBScript. It may work with a lot of the other options too, though some differ slightly.

Usually its simpler just to go to the trigger or alias menu and click add, then make all your settings that way.

Triggers are also much the same:

<triggers>
  <trigger
   enabled="y"
   match="You bless your armour with the power of the beads."
   send_to="10"
   sequence="100"
  >
  <send>by1;wear amulet;wear beads</send>
  </trigger>
</triggers>

Again, I used send_to="10" to make it recognize the ; as command seperators. Normally, when you create a trigger or alias you would leave it set to the default 'world'. In that case, commands are sent each as a seperate line and ';' is considered a 'literal' character, not a seperator:

<send>by1
wear amulet
wear beads</send>

Also, TinTin seems to use very similar commands, from your examples, to zMud. Someone created a plugin that takes simple zMud ones and creates Mushclient triggers and aliases from them. While you might have to change it to check for #action, instead of #trigger, it may be possible to adapt it to give you something closer to what Pueblo/TinTin uses. If not, then the examples above should give you an idea about how to convert them over. ;) Though there 'may' be things that don't quite work in the same way and are harder to translate across. Mushclient will definitely do them, just too differently for an easy jump from one to the other.
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #4 on Tue 22 Mar 2005 05:53 AM (UTC)
Message
Actually, with a keyboard macro (not a mushclient macro, but a macro as in recording keyboard commands, some text editors do this, my preferred for this sort of thing is PFE) it wouldn't be that hard to do. Well, with a replace or two as well.

First sort things into triggers and aliases (alphabetize, or whatever else). Then substitute } { for a newline, } for nothing, and { for a newline (all seperately, in that order) then you'll have this:
#action
You bless your armour with the power of the beads.
by1;wear amulet;wear beads

Then with your macro, you'll insert the rest of the stuff, as well as getting rid of the #action/#alias. Overwriting that with <trigger> (or <alias>), then prepending the first line of stuff with match=" and then end it with " then go down a line, to the beginning, prepend <send> and append </send> and then insert the rest of the stuff for a trigger (enabled="y"\n</trigger> (or </alias)). Then after youve done that for all of them, replace all the ; with newlines.
Then take your portions of triggers and aliases and surround them with <triggers></triggers> (or aliases) and then copy/paste.
You will have to do some manual tweaking on some of them, such as the guild experience thing (looks like anything that matches a wildcard) but that doesn't really matter, since theyre a fraction of what you originally would have to do.

I suppose if needed I could help you with that macro. I couldn't find a thread with a converter in it. But there are plenty of other threads to help you convert.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #5 on Tue 22 Mar 2005 06:07 AM (UTC)

Amended on Tue 22 Mar 2005 06:11 AM (UTC) by Flannel

Message
I went ahead and made the macro, this is after you do all the replacing ('} {' and '{' to newline (\n) and } to nothing.

Go to the top of the file, first line (it should be #alias) and press f7 after inserting this into the edit macro dialog.
Well, if you're using PFE anyway (google it, I dont think it actually has a website anymore). But even if you're not, this is a reasonable map of what you'll be doing.
You need to replace ';' with '\n' afterwards as well as surrounding them with their proper things <aliases> or <triggers>.
If I have time tomorrow, I'll write a perlscript to do the whole conversion.

CaretStartOfLine
CaretEndOfLineSelect
EditDeleteForwards
"<alias "
CaretDown
CaretStartOfLine
"match=\""
CaretEndOfLine
"\""
EditNewLine
"enabled=\"y\""
EditNewLine
"sequence=\"100\""
CaretDown
CaretStartOfLine
">"
EditNewLine
"<send>"
CaretEndOfLine
"</send>"
EditNewLine
"</alias>"
CaretDown
CaretStartOfLine

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by TommyKetchup   (3 posts)  [Biography] bio
Date Reply #6 on Tue 22 Mar 2005 09:33 AM (UTC)
Message
Thanks dude for all the help that you are providing. I have to admin, I aint much of a script expert. In fact I probably know as much as scripts as you do about me :P

Most of the stuff you have said has gone over my head, but I will try to take on board what you have said, and try to learn exactly what it means.

I will look forward to this pearl script u mention and see what happens.

Kind Regards
TK
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


20,048 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]