Untitled
Guest 311 30th Nov, 2022
--[[
Script Name: Switch lure mode on monsters
Description: When low amount of monsters enable lure mode, else disable and attack.
Important: Walking time for luring you can change in walker -> settings -> lure step time.
Author: Ascer - example
]]
local config = {
amount = 3, -- how many monsters to start attack
range = 6, -- search monsters in range (7 deafult full screen)
untildie = true, -- lure sepecific amount, kill all then start next luring session
list = {"Sea Serpent"} -- list monsters to search.
}
-- DON'T EDIT BELOW THIS LINE
local amountReached = false
config.list = table.lower(config.list)
----------------------------------------------------------------------------------------------------------------------------------------------------------
--> Function: getMonsters()
--> Description: Get amount monsters in specific range.
--> Class: Self
-->
--> Return: number monsters amount.
----------------------------------------------------------------------------------------------------------------------------------------------------------
function getMonsters()
-- set default count
local count = 0
-- inside loop for all found creatures do:
for i, mob in pairs(Creature.iMonsters(config.range, false)) do
if table.find(config.list, string.lower(mob.name)) then
-- calsulate monsters.
count = count + 1
-- when count is equal to our config break
if count >= config.amount then break end
end
end
-- return monsters amount.
return count
end
-- mod to run function in loop 10ms
Module.New("Switch lure mode on monsters", function ()
-- when connected.
if Self.isConnected() then
--load monsters amount
local monsters = getMonsters()
-- when no monsters
if monsters <= 0 then
-- reset amount
amountReached = false
end
-- when low amount of monsters
if monsters < config.amount then
-- when disabled untildie destroy reached amount
if not config.untildie then
-- reset amount
amountReached = false
end
-- enable lure mode and not reached amount to kill all
if not Walker.isLureModeEnabled() and not amountReached then Walker.setLureMode(true) end
else
-- disable lure mode
if Walker.isLureModeEnabled() then Walker.setLureMode(false) end
-- set we reach current amount of monsters
amountReached = true
end
end
end)
To share this paste please copy this url and send to your friends
RAW Paste Data
Recent Pastes
- Untitled
Markup | 12 | 59 minutes ago
- Wanted to see what your conviction is on this theme
Markdown | 5 | 1 hour ago
- Untitled
Markup | 42 | 1 day ago
- mega555kf7lsmb54yd6etzginolhxxi4ytdoma2rf77ngq55fhfcnyid.onion
Template Toolkit 2 | 22 | 1 day ago
- Untitled
Markup | 52 | 2 days ago
- Untitled
Markup | 52 | 2 days ago
- Untitled
Markup | 61 | 2 days ago