eyez
Member
- Joined
- Oct 11, 2016
- Messages
- 129
- Reaction score
- 19
On OTclient you can replace your weapons on hands...
Right/Left
But i play paladin with BOW/CROSSBOW
So i create a new condition to arrow slot...
But how to get arrow slot to complete my code?
/modules/01-afk/events/replacehands.lua
Right/Left
But i play paladin with BOW/CROSSBOW
So i create a new condition to arrow slot...
But how to get arrow slot to complete my code?
Code:
elseif AfkModule.getPanel():getChildById('AutoReplaceWeaponSelect'):getText() == "Arrow Slot" then
hand = InventorySlotRight
/modules/01-afk/events/replacehands.lua
Code:
--[[
@Authors: Ben Dol (BeniS)
@Details: Auto replace hands event logic
]]
AfkModule.AutoReplaceHands = {}
AutoReplaceHands = AfkModule.AutoReplaceHands
function AutoReplaceHands.Event(event)
if g_game.isOnline() then
local player = g_game.getLocalPlayer()
local selectedItem = AfkModule.getPanel():getChildById('ItemToReplace'):getItem():getId()
local item = player:getItem(selectedItem)
local hand = InventorySlotOther
if AfkModule.getPanel():getChildById('AutoReplaceWeaponSelect'):getText() == "Left Hand" then
hand = InventorySlotLeft
elseif AfkModule.getPanel():getChildById('AutoReplaceWeaponSelect'):getText() == "Right Hand" then
hand = InventorySlotRight
elseif AfkModule.getPanel():getChildById('AutoReplaceWeaponSelect'):getText() == "Arrow Slot" then
hand = InventorySlotRight
end
local handPos = {['x'] = 65535, ['y'] = hand, ['z'] = 0}
local handItem = player:getInventoryItem(hand)
if handItem and handItem:getCount() > 3 then
return 10000
end
if item and (not handItem or handItem:getId() ~= item:getId()) then
g_game.move(item, handPos, item:getCount())
end
end
return Helper.safeDelay(500, 1500)
end