Thread Tools Display Modes
08-25-06, 11:01 AM   #1
sid67
A Cliff Giant
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 78
HELP: Open Flightpath on Bind

I'm trying to create a one-button macro to open up the Flightmap. I'm sick of clicking on the vendor, then clicking showme flight paths, then picking one. I just want to stand near him and punch one marco that will open the flight path. I've searched all over WoW_Wiki and I can't find any functions that open the Taxi window or allow you to interact with the vendor. If I knew the name of the frame, could I just open it that way? Any other ideas?
  Reply With Quote
11-16-06, 09:50 PM   #2
Txzeenath
A Defias Bandit
Join Date: Nov 2006
Posts: 2
I'm actually trying to do the same thing basically with trainers, I can't seem to find how to open the window properly without an actual click.
  Reply With Quote
01-30-07, 05:27 PM   #3
pha7ars3
A Murloc Raider
Join Date: Jan 2007
Posts: 5
It's impossible to initiate an NPC dialog from your code, but you can automate your interaction with one. Here is my fast-n-dirty solution I actually use:

/Interface/AddOns/Passenger/Passenger.lua
Code:
Passenger = CreateFrame('Frame')
Passenger:SetScript('OnEvent', function()
	if event ~= 'GOSSIP_SHOW' then return end
	if GetGossipActiveQuests() or GetGossipAvailableQuests() then return end
	function pairs2(t)
		local index = nil
		return function()
			index, value1 = next(t, index)
			if ( index ) then
				index, value2 = next(t, index)
				return index / 2, value1, value2
			end
		end
	end
	GetGossipOptions()
	for index, title, type in pairs2({GetGossipOptions()}) do
		if type == 'taxi' then
			SelectGossipOption(index)
			return
		end
	end
end)
Passenger:RegisterEvent('GOSSIP_SHOW')
/Interface/AddOns/Passenger/Passenger.toc:
Code:
## Interface: 20003
## Title: Passenger
## Notes: one click flight path selection
## Version: 0.1
## DefaultState: enabled
## X-Category: Interface

Passenger.lua
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » HELP: Open Flightpath on Bind


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off