WoWInterface SVN mikma

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /TomTom_FF
    from Rev 175 to Rev 176
    Reverse comparison

Rev 175 → Rev 176

TomTom_FF.lua
2,14 → 2,19
local lastx,lasty,total = 0,0,0
local instance = select(2,IsInInstance())
 
function getposition()
local c,z = GetCurrentMapContinent(), GetCurrentMapZone()
local x,y = GetPlayerMapPosition("player")
x,y = floor(x * 10000)/100,floor(y * 10000)/100
return c,z,x,y
end
 
local function onUpdate(self,elapsed)
total = total + elapsed
if total >= 2 then
if (instance == "pvp" or instance == "none") and UnitExists(TTFF) and UnitIsConnected(TTFF) then
local c,z = GetCurrentMapContinent(), GetCurrentMapZone()
local x,y = GetPlayerMapPosition("player")
x,y = floor(x * 10000)/100,floor(y * 10000)/100
local data = {c,z,x,y}
local c,z,x,y = getposition()
local data = c.."!"..z.."!"..x.."!"..y
if x ~= lastx and y ~= lasty then
SendAddonMessage("TTFF", data, "WHISPER", TTFF)
lastx,lasty = x,y
25,11 → 30,14
if TTFF == 0 and prefix == "TTFF" and message == "TARGET" then
TTFF = sender
f:SetScript("OnUpdate", onUpdate)
print("TTFF: "..arg1.." has set you as friend, set him as mine too.")
print("TTFF: "..arg1.." has set you as friend, set him as mine too.")
end
if prefix == "TTFF" and UnitExists(TTFF) then
local c,z,x,y = unpack(message)
TomTom:AddZWaypoint(c, z, x, y, sender, false, false, false, nil, true, true)
local c,z,x,y = string.split("!",message)
c,z,x,y = tonumber(c),tonumber(z),tonumber(x),tonumber(y)
if GetCurrentMapContinent() == c then
if c and z and x and y then TomTom:AddZWaypoint(c, z, x, y, sender, false, false, false, nil, true, true) end
end
end
end)
 
44,8 → 52,11
if UnitExists(arg1) and UnitIsConnected(arg1) then
SendAddonMessage("TTFF", "TARGET", "WHISPER", arg1)
TTFF = arg1
print("TTFF: friend sent to "..arg1)
local c,z,x,y = getposition()
local data = c.."!"..z.."!"..x.."!"..y
SendAddonMessage("TTFF", data, "WHISPER", TTFF)
f:SetScript("OnUpdate", onUpdate)
print("TTFF: friend sent to "..arg1)
end
end
end