View Single Post
06/29/23, 05:12 PM   #8
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 247
this seems to do what I need.. any thoughts?

Code:
SLASH_COMMANDS["/rd"] = function (option)--<< /RD TELEPORT TO ZONE OR SPECIFIC PLAYER HOUSE
	if option == "" then df(RidinDirty.logo .. "  /rd partialzonename => overland zones") df(RidinDirty.logo .. "  /rd exact@name partialhousename => player houses") return end
	local options = {}
    local searchResult = { string.match(option, "^(%S*)%s*(%S*)%s*(%S*)%s*(%S*)$") }
	for i,v in pairs(searchResult) do
        if (v ~= nil and v ~= "") then
            --options[i] = string.lower(v)
			options[i] = v
		end
    end
	if (options[3] ~= nil and options[3] ~= "") or (options[4] ~= nil and options[4] ~= "") then
		df(RidinDirty.logo .. "  /rd partialzonename => overland zones") df(RidinDirty.logo .. "  /rd exact@name partialhousename => player houses")
	elseif (options[2] ~= nil and options[2] ~= "") then
		if string.find(options[1], "^(@)") then
			RidinDirty.Teleport(options[1], options[2])
		else
			df(RidinDirty.logo .. "  /rd partialzonename => overland zones") df(RidinDirty.logo .. "  /rd exact@name partialhousename => player houses")
		end
	else
		RidinDirty.Teleport(options[1])
	end
end

Last edited by sinnereso : 06/29/23 at 05:20 PM.
  Reply With Quote