Mapper: Delete room but preserve stubs

Share your scripts and packages with other Mudlet users.
Post Reply
Tagon
Posts: 24
Joined: Thu Sep 19, 2013 8:38 pm

Mapper: Delete room but preserve stubs

Post by Tagon » Sun Sep 22, 2013 2:54 pm

I put this as a suggestion for the default behaviour of delete room, or an option to the function in the suggestions thread but I also made an alias for now, thought it might be useful to share (maybe someone can improve on it, I'm a 3-day newbie to lua after all).
Code: [show] | [select all] lua
Pattern: ^delRoom (\d+)$
Code: [show] | [select all] lua
local roomID=tonumber(matches[2])
if not roomExists(roomID) then echo("Room not found") else
	local tmp=getRoomExits(roomID)
	deleteRoom(roomID)
	for k, v in pairs(tmp) do
		setExitStub(v,reverseStub(k),true)
	end
end

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests