Fishing Bite Clicker

@rebind / fishing-bite-clickerv0.1.3Public

Watches for the bite color, reels in, and casts again until you stop it.

Files

Older release. Installs get 0.1.3.

main.luau1.4 KB

-- Fishing Bite Clicker: watch a patch of screen around the pointer for the
-- bite color, click to reel in, wait, and click to cast again.

local cfg = UI.Schema({
  toggle = UI.Keybind("F7", { label = "Start or stop" }),
  bite = UI.Color("#ff3b30", { label = "Bite color" }),
  size = UI.Slider(40, {
    min = 10,
    max = 200,
    suffix = " px",
    label = "Watch area",
  }),
  recast = UI.Slider(1200, {
    min = 300,
    max = 4000,
    suffix = " ms",
    label = "Recast after",
  }),
})

local task = nil

Bind(cfg.toggle, function()
  if task then
    task:Cancel()
    task = nil
    UI.Notify("Fishing off", "info")
    return
  end
  -- the watch area is fixed where the pointer is when fishing starts
  local x, y = System.Mouse()
  local r = math.floor(cfg.size / 2)
  local box = { x - r, y - r, x + r, y + r }
  local color = cfg.bite:gsub("^#", "")
  UI.Notify("Fishing on", "success")
  task = Run(function()
    local _, err = pcall(function()
      while true do
        if Screen.SearchForColor(box, color, 0.12) then
          HID.Press("Mouse1", 40) -- reel in
          Sleep(cfg.recast)
          HID.Press("Mouse1", 40) -- cast again
        end
        Sleep(30)
      end
    end)
    -- a screen read that fails ends fishing; say so
    task = nil
    UI.Notify("Fishing stopped: " .. tostring(err), "error")
  end)
end)

function OnStop()
  if task then
    task:Cancel()
  end
end

3 files, 3.4 KB.