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

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  a trigger, and an alias

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: a trigger, and an alias
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Pages: 1  2 

Posted by Ignis   (20 posts)  [Biography] bio
Date Mon 01 Aug 2005 06:04 AM (UTC)  quote  ]
Message
btw, end result on alias to get and light kindling
<aliases>
<alias
match="1*"
enabled="y"
send_to="10"
sequence="100"
>
<send>%1
drop %1
remove quartz
take blade from bag
light %1</send>
</alias>
</aliases>

plus one to light an object from the kindling
<aliases>
<alias
match="2* *"
enabled="y"
sequence="100"
>
<send>wear quartz
put blade in bag
take %1
light %1 from %2</send>
</alias>
</aliases>
[Go to top] top

Posted by Ignis   (20 posts)  [Biography] bio
Date Mon 01 Aug 2005 05:56 AM (UTC)  quote  ]
Message
sweet, i have the alias completely solved (thanks to you ofcourse) and the trigger has sort of resolved itself which is also a big perk
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Mon 01 Aug 2005 05:34 AM (UTC)  quote  ]
Message
Instead of world.send, use world.execute.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Ignis   (20 posts)  [Biography] bio
Date Mon 01 Aug 2005 05:32 AM (UTC)  quote  ]
Message
is there a way to have an alias call for another smaller alias from within itself?
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Sun 24 Apr 2005 09:55 PM (UTC)  quote  ]

Amended on Sun 24 Apr 2005 09:59 PM (UTC) by Flannel

Message
You CAN do it in one alias that's what the script that I gave you was for. I went ahead and put it into an alias (notice no script routine? since you seem to have it in everything regardless)

<aliases>
  <alias
   match="@*"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>temp = "%1"
if (temp = "grass") then
  temp = "dried grass"
end if
if (temp = "bark") then
  temp = "shredded bark"
end if
send "get " &amp; temp
send "drop " &amp; temp
send "remove quartz"
send "take blade from bag"
send "light " &amp; temp</send>
  </alias>
</aliases>


will send shredded bark if its bark, dried grass if its grass, and anything else if its whatever else (if you wanted to make it JUST work for grass/bark, we can do that too).

As for your other alias, like I was saying, regular expression. Try matching on this:
^(.*)\|{8} > (.*)$
Which is a regexp. You CANT use a regexp quantifier ({8})with just normal *s for wildcards. It just doesn't work that way, you can't have half be a regexp, and the other half not.

The map thing is going to be way too complicated for you right now. Especially with the overlapping. Although If you have coordinates, that will simplify it some.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Ignis   (20 posts)  [Biography] bio
Date Sun 24 Apr 2005 11:27 AM (UTC)  quote  ]
Message
i know i should keep it simple, but i don't suppose there's a way to make the ansi maps in my game get translated into a bmp so that as i walk around, i'm making one large bmp map of the game world?
[Go to top] top

Posted by Ignis   (20 posts)  [Biography] bio
Date Sun 24 Apr 2005 11:11 AM (UTC)  quote  ]
Message
also i figured out a solution for the ends i wanted with the other alias, but diff means

<triggers>
<trigger
custom_colour="15"
enabled="y"
match="*|||||||||| &gt; *"
omit_from_output="y"
send_to="2"
sequence="91"
>
<send>10 &gt; %1!</send>
</trigger>
</triggers>
[Go to top] top

Posted by Ignis   (20 posts)  [Biography] bio
Date Sun 24 Apr 2005 11:10 AM (UTC)  quote  ]
Message
ok, i was hoping for a two in one alias, but perhaps just doing this for now is best then

<aliases>
<alias
script="temp"
match="@bark"
enabled="y"
sequence="100"
>
<send>get shredded bark
drop bark
remove quartz
take blade from bag
light bark
</send>
</alias>
</aliases>


<aliases>
<alias
script="temp"
match="@grass"
enabled="y"
sequence="100"
>
<send>get dried grass
drop grass
remove quartz
take blade from bag
light grass
</send>
</alias>
</aliases>
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Sun 24 Apr 2005 11:01 AM (UTC)  quote  ]
Message
And also, that script that I posted was for your alias (to be able to do @ [item] or @ [grass] or @ [bark] and have it send accordingly. It had nothing to do with the trigger to figure out which to use.

~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 Sun 24 Apr 2005 10:58 AM (UTC)  quote  ]
Message
No, send to script sends to the script.

And you don't check 16 lines back. It will match when that line gets there. It checks each line, one at a time.

Stick to one problem at a time, the alias was a good once, once you figure that out (including script syntax errors, if youre using VBScript or JavaScript download their help file and reference that to figure out the syntax, as well as the forums) then you can worry about setting and using a variable regarding your preferred item. Mushclient will only do what you tell it to, and if you don't tell it to do the right thing, nothing will work. So take the time and figure it out one step at a time. Simple triggers/aliases to simple scripts inside of triggers/aliases (and how they interface with triggers/aliases) to more complicated triggers/aliases (ones that interact with and depend on other things).

So go back and reread the guide again, you'll probably pick up on things you missed the first time around, and don't try to do things that are too complicated, since then all you get is confused.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Ignis   (20 posts)  [Biography] bio
Date Sun 24 Apr 2005 10:52 AM (UTC)  quote  ]
Message
i'm not matching 16 lines, it's just that it's 16 lines back to find the word forest, to get the trigger to send "shredded bark" to anywhere, and i thought i was sending it to the function, not just the script
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Sun 24 Apr 2005 10:47 AM (UTC)  quote  ]
Message
Wait, what? Where did that come from? You could set a variable for the 'current item', but we're still working on the other problem (or did that fix itself?) since, scripting won't do you any good if you can't get scripting to work.

And that last trigger would call the 'temp' routine, and then send "shredded bark" to the script engine, which would generate a syntax error (most likely). You do one or the other (send to script or a script function) well, under normal circumstances.

Why are you matching 16 lines?

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Ignis   (20 posts)  [Biography] bio
Date Sun 24 Apr 2005 10:42 AM (UTC)  quote  ]
Message
<triggers>
<trigger
custom_colour="15"
enabled="y"
lines_to_match="16"
match="^(.*?) forest (.*?)$"
multi_line="y"
omit_from_output="y"
regexp="y"
script="temp"
send_to="12"
sequence="100"
variable="kindling"
>
<send>shredded bark</send>
</trigger>
</triggers>
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Sun 24 Apr 2005 10:37 AM (UTC)  quote  ]

Amended on Sun 24 Apr 2005 10:38 AM (UTC) by Flannel

Message
You can 'copy' the trigger and paste it here (please do) copy from the main trigger dialog (copy button).

But, a bad script won't cause problems (until it's run).

Do remove the script function though, since you don't need it.

Did you get any errors when reloading the script? I can't remember if an error will make the script engine stop working completely, but it does seem like it might.

And what language are you writing in?

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Ignis   (20 posts)  [Biography] bio
Date Sun 24 Apr 2005 10:36 AM (UTC)  quote  ]
Message
one other thing, this is the desc i'm trying to get whether i need bark or grass from

Heavily wooded forest

Obvious exits: nothing
It is nearly pitch black here.
------------------------------------------------------------------
Dense foliage crowds this area, nearly black at this time of night. Above,
dappled wedges of the night sky are visible through the thick branches;
column-like tree trunks stand starkly against this shadowy backdrop. Fallen
branches and leaves, some tangled in the ever-present undergrowth, are visible
in the few shafts of pale light.
This area is vast.
------------------------------------------------------------------
A wood cabin is to the southwest.
==================================================================



the name of the room, in this case heavily wooded forest is always bold, and that's what i've been trying to get the alias for lighting kindling to respond to
[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.


3,906 views.

This is page 2, subject is 2 pages long:  [Previous page]  1  2 

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]