Rifbot Scripts
Go to label on X coordinates
--[[
Script: Go to label on X coordinates
Function: Detect if character is at specific coordinates and go to label if true.
Created By: LuaDEV_iL
Contact Info: https://discord.gg/C9XPAxs8eD | https://luadevil.blogspot.com/
Note: Please don't sell my scripts
]]
local RENEW_LABEL = "LABEL NAME" -- Label to go to if at specific coordinates
-- Coordinates to detect
local TARGET_POSITION = {x = xxxx, y = xxxx, z = xx} -- ENTER COORDINATIONS HERE (WHERE THE CHARACTER WILL STEP AND GO TO LABEL AFTER)
-- DON'T EDIT BELOW THIS LINE
function Self.Position()
return selfPosition()
end
Module.New("Detect Coordinates and Go to Label", function()
local pos = Self.Position()
if pos.x == TARGET_POSITION.x and pos.y == TARGET_POSITION.y and pos.z == TARGET_POSITION.z then
Walker.Goto(RENEW_LABEL)
end
end)
Always have X runes
--[[
Script: Cast spell if less than X runes
Function: Always have X runes. You can combine multiple instances of this script and always have X blanks and X GFBs for example.
Created By: LuaDEV_iL
Contact Info: https://discord.gg/C9XPAxs8eD | https://luadevil.blogspot.com/
Note: Please don't sell my scripts
]]
local RUNE_ID = 3147 -- ID of Rune
local RUNE_THRESHOLD = 1 -- Threshold of runes
local SPELL = "adori blank" -- Spell to cast
local SPELL_DELAY = {500, 1000} -- Delay between casting spell
-- DON'T EDIT BELOW THIS LINE
----------------------------------------------------------------------------------------------------------------------------------------------------------
--> Function: equipmentItemCount
--> Description: Get count of items in equipment by id.
--> Params: @id - item ID to check
--> Return: int - amount of items
----------------------------------------------------------------------------------------------------------------------------------------------------------
function equipmentItemCount(id)
local amount = 0
for i = 0, 9 do
local item = selfGetEquipmentSlot(i)
if id == item.id then
amount = amount + item.count
end
end
return amount
end
Module.New("Cast Adori Blank for Runes", function()
if Self.isConnected() then
local runeCount = Self.ItemCount(RUNE_ID) + equipmentItemCount(RUNE_ID)
if runeCount < RUNE_THRESHOLD then
Self.Say(SPELL)
mod:Delay(math.random(SPELL_DELAY[1], SPELL_DELAY[2])) -- delay between casting spell
end
end
mod:Delay(500, 1000) -- delay between checking rune count
end)
Fishing break
--[[
Script: Fishing break
Function: It will turn fishing off for X seconds every X seconds (Random between minimum and maximum amount you choose)
Created By: LuaDEV_iL
Contact Info: https://discord.gg/C9XPAxs8eD | https://luadevil.blogspot.com/
Note: Please don't sell my scripts
]]
local OFF_INTERVAL = 30 -- interval to turn off fishing in seconds
local OFF_DURATION_MIN = 5 -- minimum duration to turn off fishing in seconds
local OFF_DURATION_MAX = 60 -- maximum duration to turn off fishing in seconds
-- DON'T EDIT BELOW THIS LINE
local lastOffTime = 0
local isFishingOff = false
local offEndTime = 0
Module.New("Fishing break", function(mod)
if Self.isConnected() then
local currentTime = os.clock()
-- Check if it's time to turn off fishing
if currentTime - lastOffTime >= OFF_INTERVAL then
if not isFishingOff then
-- Turn off fishing
Rifbot.setCheckboxState("Tools", "AutoFishing", false)
isFishingOff = true
offEndTime = currentTime + math.random(OFF_DURATION_MIN, OFF_DURATION_MAX)
end
end
-- Check if it's time to turn fishing back on
if isFishingOff and currentTime >= offEndTime then
-- Turn on fishing
Rifbot.setCheckboxState("Tools", "AutoFishing", true)
isFishingOff = false
lastOffTime = currentTime
end
end
mod:Delay(500, 1000)
end)