passing selected rooms on map to a script?

All and any discussion and development of the Mudlet Mapper.
Post Reply
reyl
Posts: 12
Joined: Wed Jul 10, 2013 5:33 pm

passing selected rooms on map to a script?

Post by reyl »

I was wondering - is there any way to access the list of rooms that have been selected visually on the map screen from our own scripts? Like, so I can drag-select some rooms with the mouse then use an alias to walk to each of the selected rooms, for example?

User avatar
SlySven
Posts: 980
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: passing selected rooms on map to a script?

Post by SlySven »

I don't think you can currently capture that list, but I agree it would be a useful thing to have.

From a coder's viewpoint I think you would need to add a map context menu (right click) item - which can be done by the user and use that to call a, as unwritten yet, built-in lua function that would return the current map room selection widget content. This would only work on the 2D map but then nothing is perfect.

User avatar
SlySven
Posts: 980
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: passing selected rooms on map to a script?

Post by SlySven »

I was wrong - you CAN do that, but I don't yet fully understand how. Though it does sort of follow the outline I gave before. Apparently the current list of selected rooms is something that get passed to any user action that is put onto that mapper context menu (right-click) with the addMapEvent() function. I'm trying to put together an outline of how it is done but it seems a function you declare and assign as a UserEventHandler gets called and the fourth and subsequent arguments are the rooms in the list - I don't fully understand enough about Lua to see how such a "vararg" function can be constructed to recover a lua table from that - perhaps someone with more skill in that area would like to comment?

Silvine
Posts: 142
Joined: Sat Oct 23, 2010 2:36 pm

Re: passing selected rooms on map to a script?

Post by Silvine »

Mapper of Bedlam

User avatar
SlySven
Posts: 980
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: passing selected rooms on map to a script?

Post by SlySven »

By Jove, that's it! Somebody give that man(?) a sock filled to the brim with custard...

Silvine
Posts: 142
Joined: Sat Oct 23, 2010 2:36 pm

Re: passing selected rooms on map to a script?

Post by Silvine »

Umm thanks I think, I trust that comes with spotted dick :D
Or at a push jam roly poly.
Mapper of Bedlam

Post Reply