forked from aim2kill/FishingBuddy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFishingHoles.lua
executable file
·43 lines (39 loc) · 1.39 KB
/
FishingHoles.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
-- Support for Fishing Holes
FishingBuddy.FishingHoles = {};
-- Let's store fishing holes like this
-- FishingBuddy_Info["FishingHoles"][ZONE]
-- Store everything to two digits?
local function IsFishingHole()
if ( GameTooltip:IsVisible() ) then
local text = getglobal("GameTooltipTextLeft1");
if ( text ) then
text = text:GetText();
-- let a partial match work (for translations)
if ( string.find(text, FishingBuddy.SCHOOL_OF) ) then
local s,e = string.find(text, FishingBuddy.SCHOOL_OF.." ");
if ( s ) then
if ( s > 1 ) then
text = string.sub(text, 1, s-1)..string.sub(fishie, e+1);
else
text = string.sub(text, e+1);
end
else
s,e = string.find(text, " "..FishingBuddy.SCHOOL_OF);
if ( s ) then
text = string.sub(text, 1, s-1)..string.sub(text, e+1);
end
end
return text;
end
end
end
return nil;
end
FishingBuddy.FishingHoles.CheckFishingHole = function()
local holename = IsFishingHole();
if ( holename ) then
-- find the name of the fish in our database if we can
-- if not, we can find it later, when we catch one
-- need translations for the other kinds of fishing holes
end
end