Mushclient plugin: Do/Then

Have a question about which MUD client works best with SI? Looking for a free app that lets you log in from your phone? Need help with a complicated script? This is the place.
Post Reply
galaban
Citizen of Archai
Posts: 25
Joined: Thu Apr 07, 2016 8:05 am

Mushclient plugin: Do/Then

Post by galaban »

Greetings, all. A first contribution to the Mushclient community of Shattered Isles:

https://github.com/galaban/SHATTEREDISLESDoThen

This is my Do/Then plugin for crafting. The basic commands:
  • do <count> <command>
    then <command>
The "do" command repeats the given command (or string of commands). It triggers off the completion of the previous crafting command. So, for example, "do 5 chop" would chop 5 times.

The "then" command also triggers off of the crafting commands. It executes the command (or list of commands) after the next crafting command is complete. If there is a "do" cycle currently being processed, it waits until the count is complete. So, for example "chop;then get poplar" or "do 5 chop;then get all.poplar"

In addition to this, I overrode the stack character so that the "then" command can more easily stack. Normally, putting in "then bundle poplar;get poplar" would cause the "get poplar" command to execute immediately. However, with this plugin, it will stack so that [bundle poplar;get poplar] will execute after the next command. The advantage to this is that the "then" command can easily be stacked: "then chop;then chop;then get all.poplar". That would chop twice before getting the results.

Finally, I have added a "wait" in as well. Since there are multiple queues going on in this mud, there are often times a need to wait in between commands. A perfect example is during walking: "then s;s;wait 1.5;sell toy"

Enjoy.
Ayanna
Citizen of Archai
Posts: 23
Joined: Sat Jan 30, 2016 9:18 am

Re: Mushclient plugin: Do/Then

Post by Ayanna »

I'm not sure if this is doing the same thing but when I have a trigger for crafting I change the send to from World to Execute. This makes the commands I put in there execute in order. They don't run over each other.
galaban
Citizen of Archai
Posts: 25
Joined: Thu Apr 07, 2016 8:05 am

Re: Mushclient plugin: Do/Then

Post by galaban »

Well, the purpose of this is that you can't enter "chop;chop;chop;chop" and queue up a bunch of chops (or forges, forages, cooks, etc.) If you do that, the first will execute and the rest will just say "You're already doing something". So, you have to trigger the next chop off the completion of the last chop. IE: "do 4 chop"

Also, movement is on a different queue from the buy/sell commands. Buy, sell, give, get, put, etc, all execute immediately, wherever you are, where as movement has a delay. So, if you want to move from the inn, say, to the pawnshop, you can't just enter: n;se;se;e;e;s;s;sell all. You have to add a delay in there or else "sell all" will execute before you even move. So, we end up with:
> do 4 forge cup
> then get all;n;se;se;e;e;s;s;wait 5;sell all
So, that above would forge 4 cups, get them, and go sell them.
Post Reply