Using the highlightRoom during manual fastwalk

Post Reply
takilara
Posts: 26
Joined: Tue Jul 28, 2020 10:23 pm

Using the highlightRoom during manual fastwalk

Post by takilara »

the mud i play on have a delay when moving, meaning that one often queues up several directions while walking from one place to another.
The mud supports gmcp.Room, so i have set it up to move the map whenever it gets a gmcp.Room.

This works good, however, when running around i would like to highlight the room i queuing to, for instance by using highlightRoom

Example, I am looking for:
i hit "w" 5 times, the room 5 west of current room is highlighted, the current position gets updated as i get feedback from the mud, when i enter the target room, the highlight is removed

I can do this easily by running a function on my direction macros (keypad), to where they check if the command i am executing is in the exits table in the "selected" room. If it is, then move the highlighter.

However i would like to do this for every written command (check if it is an exit in the selected room, if it is, move the highlighter, then send(cmd))
I was sortof able to do this, but now we get to the challenge as "send" sends the command to the mud, not to Mudlet, meaning that if the command i wrote was a mudlet alias, or a "lua ..." command, then they will not expand.

I contemplated replacing send() with expandAlias(), but then I fear a loop as i think i would need a way to prevent the alias capturing the command from re-firing on its own expandAlias. (maybe the capture alias can disable itself jsut before the expandAlias, then renable itself?)

i also conteplated building dynamic triggers using the room exits in the selected room as pattern, then deleting these as the highlighter is moved. This might work, but feels clunky.


does anyone have suggestions as to the best way of doing this?

thanks and regards

User avatar
demonnic
Posts: 884
Joined: Sat Dec 05, 2009 3:19 pm

Re: Using the highlightRoom during manual fastwalk

Post by demonnic »

I think you probably want to make use of the sysDataSendRequest event: https://wiki.mudlet.org/w/Manual:Event_ ... endRequest

takilara
Posts: 26
Joined: Tue Jul 28, 2020 10:23 pm

Re: Using the highlightRoom during manual fastwalk

Post by takilara »

Awesome! that will solve it perfectly!

Thank you very much!

takilara
Posts: 26
Joined: Tue Jul 28, 2020 10:23 pm

Re: Using the highlightRoom during manual fastwalk

Post by takilara »

Update. using the event sysDataSendRequest worked perfectly for me to check all user input to see if it matched exits in currently hightlighted room :) thanks!

Followup question:
[ignore]- I quickly queue walking directions "outside" my visible map. Is there a way to check if a room is "visible" in the map widget?[/ignore]

I now realized that the "red dot" on the map is the "centerview" highlighter, meaning:
- instead of manually highlighting as i run commands, and centerviewing when i get gmcp.Room, i should instead centerview as i run commands, then highligh as i get gmcp.Room.
This will solve the need to check if a room is visible on the map.


best regards

User avatar
demonnic
Posts: 884
Joined: Sat Dec 05, 2009 3:19 pm

Re: Using the highlightRoom during manual fastwalk

Post by demonnic »

an interesting and clever solution. cheers

Post Reply