View Single Post
12/22/15, 03:20 PM   #12
SnowmanDK
 
SnowmanDK's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 161
For now I have ended up with this (a kind of a mix):
Lua Code:
  1. local FoulBaitLeft, FoulSBaitLeft, RiverBaitLeft, RiverSBaitLeft = 0, 0, 0, 0
  2.     local OceanBaitLeft, OceanSBaitLeft, LakeBaitLeft, LakeSBaitLeft = 0, 0, 0, 0
  3.     local GeneralBait = 0
  4.     if DestinationsSV.filters[PINS_FISHING_SHOW_BAIT_LEFT] then
  5.         local lureIndex = GetFishingLure()
  6.         local numLures = GetNumFishingLures()
  7.         for lureIndex=1, numLures do
  8.             local name, icon, stack, _, _  = GetFishingLureInfo(lureIndex)
  9.             if     string.find(icon, "centipede") then  --Crawlers
  10.                 FoulBaitLeft = stack
  11.             elseif string.find(icon, "fish_roe") then   --Fish Roe
  12.                 FoulSBaitLeft = stack
  13.             elseif string.find(icon, "torchbug") then   --Insect Parts
  14.                 RiverBaitLeft = stack
  15.             elseif string.find(icon, "shad") then   --Shad
  16.                 RiverSBaitLeft = stack
  17.             elseif string.find(icon, "worms") then  --Worms
  18.                 OceanBaitLeft = stack
  19.             elseif string.find(icon, "fish_tail") and not (string.find(name, "simple") or string.find(name, "einfacher") or string.find(name, "appāt")) then    --Chub
  20.                 OceanSBaitLeft = stack
  21.             elseif string.find(icon, "guts") then   --Guts
  22.                 LakeBaitLeft = stack
  23.             elseif string.find(icon, "river_betty") then    --Minnow
  24.                 LakeSBaitLeft = stack
  25.             elseif string.find(icon, "fish_tail") and (string.find(name, "simple") or string.find(name, "einfacher") or string.find(name, "appāt")) then    --Simle Bait
  26.                 GeneralBait = stack
  27.             end
  28.         end
  29.     end
The reason for name comparison is that I found out that Chub and Simple Bat use the same icon.
Testing it right now
Edit: I am slow too lol

Last edited by SnowmanDK : 12/22/15 at 04:19 PM.
  Reply With Quote