suggestion: add waiting button for special exit window in mapper

All and any discussion and development of the Mudlet Mapper.
Post Reply
caiyaozheng
Posts: 15
Joined: Sat Mar 18, 2023 5:34 am

suggestion: add waiting button for special exit window in mapper

Post by caiyaozheng »

hi Mudlet developers:

I want to go from Room 1 to Room 10, let's say the directions are: 4 s, 1 open door, 4 n. in Room 5, where the special exit is open door, I should wait for 4 seconds then input open door. Can you add this function to the next version mapper? where we can decide whether we should wait before do a special action or after.

thank u!

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: suggestion: add waiting button for special exit window in mapper

Post by Vadi »

Using an updated version of the generic mapper, you should be able to set a special exit that does this:

script: tempTimer(6, [[sendAll("open door", "n")]])

Let me know if that works for you!

caiyaozheng
Posts: 15
Joined: Sat Mar 18, 2023 5:34 am

Re: suggestion: add waiting button for special exit window in mapper

Post by caiyaozheng »

Vadi wrote:
Sun Jul 16, 2023 11:17 am
Using an updated version of the generic mapper, you should be able to set a special exit that does this:

script: tempTimer(6, [[sendAll("open door", "n")]])

Let me know if that works for you!
hi Vadi, there is a problem, that the exit commands for the following rooms will not wait untile 6 seconds later, they will be executed before this special exit command is executed, therefore the whole speedwalk path is messed. : )

Jor'Mox
Posts: 1146
Joined: Wed Apr 03, 2013 2:19 am

Re: suggestion: add waiting button for special exit window in mapper

Post by Jor'Mox »

Yeah, speedwalks with waiting included require special implementation because of the way that speedwalks work. Normally, they just spam out all the commands as fast as possible, and assume everything will go through properly.

As far as I see it, there are three different approaches that could work in a widely applicable way. The first is to have a special "wait" command added for speedwalks that the script recognizes, and if it sees one, it shifts the entire rest of the speedwalk into that timer, nesting if necessary. This one is probably the easiest, though you'd likely need to increase the wait time you specify because the timer would essentially start as soon as the speedwalk did, and so it would need to include the travel time to that room, which is difficult if the speedwalk is dynamic rather than static.

The second would be to add an option in speedwalks in general to wait for a new room to be entered before sending the next command, if that command seems like one that should produce movement. This one would be complicated by requiring some sort of list or algorithm to determine if a command is or isn't one that causes movement, but it allows for some interesting further modifications, like allowing for movements that only work sometimes, and so might need to be repeated if they don't succeed.

And the third would be to again have a special "wait" command, but in this instance enfold it into the ability to have speedwalk wait between each command sent, which is often used to avoid anti-spam features, and just add that amount of waiting to the normal wait time in that spot in the speedwalk. Here, it would be very important to adjust the wait time to roughly match how long it actually takes to move from room to room, so that the time spent waiting for that special exit actually happens in the right place.

If the timing is SUPER important, I think the second option is the most likely to be successful, while the third would probably be the best low effort option, especially since implementing it would make also implementing the first option at the same time fairly trivial.

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: suggestion: add waiting button for special exit window in mapper

Post by Vadi »

What we did in the IRE mapper is this: https://github.com/IRE-Mudlet-Mapping/i ... 56C1-L6458, a function to delay the movement timer by a given amount. Looking at https://github.com/ZookaOnGit/Mudlet/bl ... 2906-L2910, the same might be possible here?

The way it's used in scripts is like this:

script: send("turn jar") mmp.customwalkdelay(6) tempTimer(6, [[send("down")]])

Jor'Mox
Posts: 1146
Joined: Wed Apr 03, 2013 2:19 am

Re: suggestion: add waiting button for special exit window in mapper

Post by Jor'Mox »

So long as they are already using speedwalk with a delay, you could absolutely do something like that, where they set an extra delay variable in their script, that is executed, and it is reset when the continue_walk function runs its own wait timer where you indicated. And given that it would be essentially impossible to predict travel time to that room if you were doing speedwalk without a delay, that is probably a reasonable requirement for someone to expect it to work as they need it to.

This change would do the trick, assuming that we used map.tempWait as the relevant variable to be used for scripting that delay.
Code: [show] | [select all] lua
    -- make tempTimer to send next command if necessary
    if walking and (not map.configs.speedwalk_wait or (map.configs.speedwalk_wait and wait > 0)) then
        if map.tempWait then
            wait = wait + map.tempWait
            map.tempWait = nil
        end
        if timerID then killTimer(timerID) end
        timerID = tempTimer(wait, function() continue_walk() end)
    end

caiyaozheng
Posts: 15
Joined: Sat Mar 18, 2023 5:34 am

Re: suggestion: add waiting button for special exit window in mapper

Post by caiyaozheng »

Vadi wrote:
Tue Jul 18, 2023 5:31 pm
What we did in the IRE mapper is this: https://github.com/IRE-Mudlet-Mapping/i ... 56C1-L6458, a function to delay the movement timer by a given amount. Looking at https://github.com/ZookaOnGit/Mudlet/bl ... 2906-L2910, the same might be possible here?

The way it's used in scripts is like this:

script: send("turn jar") mmp.customwalkdelay(6) tempTimer(6, [[send("down")]])
got confused:

1. i reinstalled Mudlet and the new versions of generic mapper and IREs mudlet mapper.

2. the sepcial exit "script:"method seemed working, however a new problem appeared:

the information "(9-n)" repeatedly shown on the screen until I press the "emergency stop"button.

3. I restarted Mudlet, set player locations, clicking the target room on map, then old problem appear:

[ LUA ] - object: <> function:<doSpeedWalk>
<[string "Script: mmp.speedwalking"]:580: attempt to index field 'Room' (a nil value)>

lost my current location.

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: suggestion: add waiting button for special exit window in mapper

Post by Vadi »

You only need to have one version of the mapper installed, so remove the IRE mudlet mapper.

Post Reply