Hello.
I've adapted the following script to work like you need:
|Only Registered members can see download links. | Click here to buy subscription or here to register.
Both scripts below will check if you are at on of the specified positions then use setsettings(path, false) to disable every tool you added to "TOOLS" table, for example: 'Tools/Ring Equipper/Enabled', which is the "path" to enable/disable Ring Equipper. If you are not on any of the specified positions then it will use setsettings(path, true) to enable every tool you added to "TOOLS" table.
This script uses locations with range, very similar to Cavebot, which can make your life easier if you know how to use it. You could even use HUDs -> Show waypoints and create waypoints then just insert the wpt coordinates and range to the script. So you would actually see where exactly it would work.
local LOCATIONS = {
{ X = 32956, RangeX = 3, Y = 32075, RangeY = 3 } -- This will check if you are on X = 32956, 32957 or 32958 AND Y = 32075, 32076 or 32077.
{ X = 32956, RangeX = 1, Y = 32075, RangeY = 1 } -- If you wanna check for a specific SQM use RangeX and RangeY = 0.
}
local TOOLS = { -- Tools to disable when you are inside pzone and enable when you are out of pzone.
'Tools/Ring Equipper/Enabled'
}
if connected() then
local player_x = posx()
local player_y = posy()
local player_z = posz()
local flag = false
for _, temple_location in ipairs(LOCATIONS) do
if (player_x >= temple_location.X and player_x <= (temple_location.X + temple_location.RangeX - 1)) and (player_y >= temple_location.Y and player_y <= (temple_location.Y + temple_location.RangeY - 1)) and player_z == temple_location.Z then
flag = true
break
end
end
if flag then
for _, setting in ipairs(TOOLS) do
if getsettings(setting) == true then
setsettings(setting, false)
end
end
else
for _, setting in ipairs(TOOLS) do
if getsettings(setting) == false then
setsettings(setting, true)
end
end
end
end
This script does the same, except it don't use ranges. So you would need to add every single sqm.
local LOCATIONS = {
{ X = 32957, Y = 32076, Z = 7 },
{ X = 32958, Y = 32076, Z = 7 },
{ X = 32956, Y = 32076, Z = 7 },
{ X = 32957, Y = 32075, Z = 7 },
{ X = 32957, Y = 32077, Z = 7 },
{ X = 32956, Y = 32075, Z = 7 },
{ X = 32958, Y = 32077, Z = 7 },
{ X = 32958, Y = 32075, Z = 7 },
{ X = 32956, Y = 32077, Z = 7 },
}
local TOOLS = { -- Tools to disable when you are inside pzone and enable when you are out of pzone.
'Tools/Ring Equipper/Enabled'
}
if connected() then
local player_x = posx()
local player_y = posy()
local player_z = posz()
local flag = false
for _, temple_location in ipairs(LOCATIONS) do
if player_x == temple_location.X and player_y == temple_location.Y and player_z == temple_location.Z then
flag = true
break
end
end
if flag then
for _, setting in ipairs(TOOLS) do
if getsettings(setting) == true then
setsettings(setting, false)
end
end
else
for _, setting in ipairs(TOOLS) do
if getsettings(setting) == false then
setsettings(setting, true)
end
end
end
end