Mushclient Questions

by Esano

Back to Mechanic's Corner.

Unknown2010-03-13 02:29:20
Is there any way of setting something up to 'remember' the last command entered, so that if it fails for some reason like drunkness/stupidity or whatever, it automatically retries it until it goes through?
Sylphas2010-03-13 02:33:05
QUOTE (Palindromic @ Mar 12 2010, 09:29 PM) <{POST_SNAPBACK}>
Is there any way of setting something up to 'remember' the last command entered, so that if it fails for some reason like drunkness/stupidity or whatever, it automatically retries it until it goes through?


Off the top of my head, a regular expression alias set to ^(.*)$ that does SetVariable("lastcommand", "%1"), check "Keep Evaluating". Should store whatever you typed last, but I haven't tested it, so ymmv.
Unknown2010-03-13 02:33:15
Yes, but it can be very tricky to do so and not interfere with other scripts or aliases. Usually, the best solution is to just spam whatever it is or pay closer attention to what's actually happening and retry manually as needed.
Unknown2010-03-13 02:36:14
Wow, that was a quick response. Thanks!
Sylphas2010-03-13 02:37:31
Never underestimate how often people just sit around refreshing forums while they do other stuff. smile.gif
Zallafar2010-03-13 04:40:58
QUOTE (Palindromic @ Mar 12 2010, 06:29 PM) <{POST_SNAPBACK}>
Is there any way of setting something up to 'remember' the last command entered, so that if it fails for some reason like drunkness/stupidity or whatever, it automatically retries it until it goes through?

As Iasmos said, this is really tricky. My system can issue three commands before the game responds to the first one, so determining which command got scarfed by stupidity or whatever can be really difficult. In my system I have gone to great lengths, keeping a queue of performed commands and popping them off as they get acknowledged by the game, in order to deal with this problem. It's way more involved, but that's the idea.

The major benefit is that I can start on recuring immediately, if it was a cure that was lost. Otherwise, I have to wait for the cure to timeout, which can be a long time in combat terms.
Sylphas2010-03-13 09:02:34
You may be overthinking it, as he did say "entered" and not "sent by my system".
Ilyarin2010-03-13 09:04:41
Correct, but your alias will still fire off things that are sent by the script using Execute() (if Lua).
Unknown2010-03-19 00:03:42
I think I might of found a bug in the Treant system with the pipes. I'm sure the coding on lighting the pipes automatically and smoking them are right. But when I type in 'pipes' I get a list, and all of them are displayed lit, despite the fact they have gone cold for quite some time. Because of this, my guy won't light the pipes and smoke them when I'm in trouble.


» Pipes:
» coltsfoot 220228 lit 9
» faeleaf 160471 lit 7
» myrtle 96485 lit 10

smoke 160471
That pipe isn't lit.
Unknown2010-03-19 00:29:34
Posting Treant bugs here doesn't get them fixed. You need to e-mail me, and I'll need logs showing the entire process, preferably with DEBUG ON, if you can.
Unknown2010-03-19 00:40:53
QUOTE (Zarquan @ Mar 19 2010, 01:29 AM) <{POST_SNAPBACK}>
Posting Treant bugs here doesn't get them fixed. You need to e-mail me, and I'll need logs showing the entire process, preferably with DEBUG ON, if you can.



heh, your inbox is full it says, let me see your like.. personal email or something? I don't know. I haven't checked your profile much yet but let me check.
Unknown2010-03-19 02:51:10
QUOTE (TheSponge @ Mar 19 2010, 12:40 AM) <{POST_SNAPBACK}>
heh, your inbox is full it says, let me see your like.. personal email or something? I don't know. I haven't checked your profile much yet but let me check.

Click on the Treant Combat System for MUSHclient (free to download, support costs credits) right in the signature block of every post he makes. Right in the Introduction you'll see his email, as well as his policy on IG messages and forum PMs.
chalraes2010-03-27 07:50:48
Okay, it is past midnight, I have been working on this for the last ten hours nonstop, and I am finally ready to break down and admit I need help. I have been working on an influence queue script, and have found two problems that I cannot seem to wrap my head around. First, a bit of background information. Fresh profile on MUSHclient v4.51. Wrapwidth 0.

Now, problem one... When trying to grab all id numbers from IH, my script is supposed to avoid adding anything in the completed(gag) table to the target queue. It successfully prevents doubles in the tar queue, but will still add gagged id numbers. The code for this function is:

CODE
require "serialize"

function checkQueue(chagainst)

    assert (loadstring (GetVariable ("tarqueue"))) ()
    assert (loadstring (GetVariable ("gaglist"))) ()


    for _,v in pairs(targetqueue) do
        if v == chagainst then
            return 0
        end --if
    end --for
    for _,v in pairs(gagtable) do
        if v == chagainst then
            return 0
        end --if
    end --for
    table.insert(targetqueue, chagainst)
    SetVariable("tarqueue", "targetqueue = " .. serialize.save_simple ( targetqueue ) )
    return 1
end --function


Problem 2 is just getting on my nerves, because I know it should work, and I know it is most likely something I am missing, but it does not. I have tried matching a few things, including:
CODE
(A (.*+) sighs dramatically and searches (her|his) pockets, looking for something to give you.

The same with ^ at the beginning and $ at the end.
CODE
sighs and searches


None of those seem to work. It is not the script, as I had it, for a while, send to world instead of script to verify that it was triggering, but it did not, which points to the trigger itself.

I am not asking for somebody to solve my problem for me, but a hint in the right direction, or any help at all, would be wonderful. If you want more information, I will gladly supply it.

Thank you.
Esano2010-03-27 08:07:24
CODE
^.*? sighs dramatically and searches (his|her) pockets\\, looking for something to give you\\.$

You'd missed a \\ before the ,

Working on your other problem now ... how are your tables stored? What inserts things into the gag table?
chalraes2010-03-27 08:10:57
QUOTE (Esano @ Mar 27 2010, 09:07 AM) <{POST_SNAPBACK}>
CODE
^.*? sighs dramatically and searches (his|her) pockets\\, looking for something to give you\\.$

You'd missed a \\ before the ,

Working on your other problem now ... how are your tables stored? What inserts things into the gag table?


The \\ didn't make a difference for me. The trigger still does not fire.

Copied and pasted from MUSH
Variable gaglist:
CODE
gagtable = {
   = "58",
   = "57",
  }


CODE
function gagTarget()
    assert (loadstring (GetVariable ("gaglist"))) ()

    table.insert(gagtable, GetVariable("target"))
    SetVariable("gaglist", "gagtable = " .. serialize.save_simple ( gagtable ) )
end



EDIT: Added a log of the script while tracing.


EDIT2: Er, it seems the problem has been fixed. Thank you, Esano, for your help.
Turns out, problem 1 was caused by problem 2, and problem 2 was caused by the trigger not firing because I wasn't paying attention to what it was supposed to capture.
I blame it on sleep deprivation. sleep.gif
Unknown2010-03-27 17:08:18
unless mushclient for some reason requires it, regex does -not- require you to escape commas. Periods it's a good idea to escape, unless you really mean "any character"

It's a common misapprehension.
Zallafar2010-03-27 17:51:35
QUOTE (Chalraes @ Mar 27 2010, 12:50 AM) <{POST_SNAPBACK}>
Now, problem one... When trying to grab all id numbers from IH,

I just wanted to make sure that you know that if you target, for example, 'centaur' repeatedly, the game will give you the next centaur available to be influenced, without you having to use ID numbers.

I didn't know this for the longest time, and was so happy to find out it worked that way!
Unknown2010-03-29 17:07:36
Okay, my turn to be stuck. Ever since the server update, I haven't been able to connect to Lusternia through Mush. Wondering if I need to update an IP somewhere or something.

When I try to connect, I get:

Unable to connect to "Treant", code = 10061 (Connection refused)

Error occurred during phase: Connecting to world: 64.127.116.166, port 23.

This started directly after the server update, and I don't think I've tinkered with any computer settings.
Unknown2010-03-29 17:12:46
QUOTE (Ilaveuse @ Mar 29 2010, 05:07 PM) <{POST_SNAPBACK}>
Okay, my turn to be stuck. Ever since the server update, I haven't been able to connect to Lusternia through Mush. Wondering if I need to update an IP somewhere or something.

When I try to connect, I get:

Unable to connect to "Treant", code = 10061 (Connection refused)

Error occurred during phase: Connecting to world: 64.127.116.166, port 23.

This started directly after the server update, and I don't think I've tinkered with any computer settings.



It's port 23, IP is 209.212.145.235
Unknown2010-03-29 17:16:04
I figured it was a screwy IP address, but I wasn't sure how to find the new one. I see the newspost now, but I couldn't get on to check that, so... thanks.

Also, that new server is pretty awesome... noticeable difference, at least for me.