Page 1 of 1

suggestion: add waiting button for special exit window in mapper

Posted: Sun Jul 16, 2023 10:25 am
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!

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

Posted: Sun Jul 16, 2023 11:17 am
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!

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

Posted: Tue Jul 18, 2023 6:23 am
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. : )

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

Posted: Tue Jul 18, 2023 4:10 pm
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.

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

Posted: Tue Jul 18, 2023 5:31 pm
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")]])

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

Posted: Wed Jul 19, 2023 6:48 pm
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

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

Posted: Sun Jul 30, 2023 9:50 am
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.

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

Posted: Sat Aug 05, 2023 7:31 am
by Vadi
You only need to have one version of the mapper installed, so remove the IRE mudlet mapper.