Mushclient 4.94 with LUA
So, I'm an old time Wintin user and it's time to move to something new, and Mushclient seems to offer quite a lot.
Having some growing pains trying to convert the programming language (Wintin is very Basic-like and easy)
I'm trying to make a trigger that will grab specific items from a corpse.
I'm on an old DIKU based game (mud.finalchallenge.net 4000 if your interested) and I get lists like this:
The corpse contains:
(Moderate magic) a sickle
(Moderate magic) a bright white potion with purple swirls
(Potent magic) a pair of hardened leather breeches
an axe
a mushroom
80 coins
I want the magic items and the gold (the gold has already been figured out, that's an easy one) while leaving the rest.
The problem comes in the form of the item names.
They can be 2-12 words long and the last word in the name isn't always a usable keyword.
For instance, typing 'get swirls' for the potion wont work, but bright, white, purple and potion are valid. Hardened won't work, but leather and breeches will.
In Wintin, my thought was to try and count the # of words in the name (if 6 words, 'get %5 corpse', if 2 words 'get %2 corpse') but I've hit programming limits with that.
Seems that
(Moderate magic) %1 %2 (no space after %2)
will catch the sickle ok, but on the breeches will turn %2 into the rest of the string ('pair of hardened leather breeches') which I cant use in the 'get %2 corpse' command (more than a single keyword).
But if I put a space after %2 then it won't recognize the sickle, as there is an EOL char that I cannot read/process.
So far all I have is:
<triggers>
<trigger
enabled="y"
match="(Moderate magic) *"
send_to="9"
sequence="1"
variable="modtxt"
>
<send>%1</send>
</trigger>
</triggers>
So, I have a string of varying length that I need to be able to process in some fashion to pull out a word or two that could be used as a keyword, ignoring obvious non-keyword words (a, the, pair, etc).
And the REALLY tricky part is that I could also find:
(Moderate magic) a pair of hardened leather pants
in the same corpse, meaning there is a HUGE list of keywords for these items.
So I know WHAT I want to do, I don't know to finagle the programs to do what I want.
Anyone have suggestions for a Mushclient newbie?
CM
So, I'm an old time Wintin user and it's time to move to something new, and Mushclient seems to offer quite a lot.
Having some growing pains trying to convert the programming language (Wintin is very Basic-like and easy)
I'm trying to make a trigger that will grab specific items from a corpse.
I'm on an old DIKU based game (mud.finalchallenge.net 4000 if your interested) and I get lists like this:
The corpse contains:
(Moderate magic) a sickle
(Moderate magic) a bright white potion with purple swirls
(Potent magic) a pair of hardened leather breeches
an axe
a mushroom
80 coins
I want the magic items and the gold (the gold has already been figured out, that's an easy one) while leaving the rest.
The problem comes in the form of the item names.
They can be 2-12 words long and the last word in the name isn't always a usable keyword.
For instance, typing 'get swirls' for the potion wont work, but bright, white, purple and potion are valid. Hardened won't work, but leather and breeches will.
In Wintin, my thought was to try and count the # of words in the name (if 6 words, 'get %5 corpse', if 2 words 'get %2 corpse') but I've hit programming limits with that.
Seems that
(Moderate magic) %1 %2 (no space after %2)
will catch the sickle ok, but on the breeches will turn %2 into the rest of the string ('pair of hardened leather breeches') which I cant use in the 'get %2 corpse' command (more than a single keyword).
But if I put a space after %2 then it won't recognize the sickle, as there is an EOL char that I cannot read/process.
So far all I have is:
<triggers>
<trigger
enabled="y"
match="(Moderate magic) *"
send_to="9"
sequence="1"
variable="modtxt"
>
<send>%1</send>
</trigger>
</triggers>
So, I have a string of varying length that I need to be able to process in some fashion to pull out a word or two that could be used as a keyword, ignoring obvious non-keyword words (a, the, pair, etc).
And the REALLY tricky part is that I could also find:
(Moderate magic) a pair of hardened leather pants
in the same corpse, meaning there is a HUGE list of keywords for these items.
So I know WHAT I want to do, I don't know to finagle the programs to do what I want.
Anyone have suggestions for a Mushclient newbie?
CM