Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Xenobot Skrypt na uzywanie small enchanted ruby na mysticial blade


barioo

Rekomendowane odpowiedzi

Opublikowano
local normalWeapon = 3271
local chargedWeapon = 779
local gemID = 677

local isChanging = false

function findEmptyContainer()
for i = 0, 15 do
if (Container.isOpen(i) and not Container.isFull(i)) then
return i
end
end
return nil
end

function findItemInContainer(item)
local itemid = Item.GetItemIDFromDualInput(item)

for i = 0, 15 do
if (Container.isOpen(i)) then
for spot = 0, Container.ItemCount(i) - 1 do
local data = Container.GetItemData(i, spot).id

if (itemid == data) then
return i, spot
end
end
end
end

return nil
end

function equipWeapon(weapon, callback)
local cWeapon = Self.Weapon().id
local weapon = Item.GetItemIDFromDualInput(weapon)

local wCont, wSpot = findItemInContainer(weapon)

if (not wCont or not wSpot) then
callback()
return false
end

local time = os.time()
local sCount = Self.ItemCount(weapon, wCont)

while (sCount == Self.ItemCount(weapon, wCont) and os.difftime(os.time(), time) < 10) do
local wCont, wSpot = findItemInContainer(weapon)

Container.MoveItemToEquipment(wCont, wSpot, "weapon", -1)
end

callback()
return true
end

function dequipWeapon(weapon, callback)
local item = Self.Weapon().id
local weapon = Item.GetItemIDFromDualInput(weapon)

if (item ~= weapon) then
callback(false)
return false
end

local emptyCont = findEmptyContainer()

if (not emptyCont) then
callback(false)
return false
end

local time = os.time()

while (Self.Weapon().id == weapon and os.difftime(os.time(), time) < 10) do
slotMoveItemToContainer("weapon", emptyCont, Container.ItemCount(emptyCont) - 1)
wait(500)
end

callback(true)
return true
end

function enchantWeapon(weapon, gem, chargedWeapon, callback)
local weapon = Item.GetItemIDFromDualInput(weapon)
local gem = Item.GetItemIDFromDualInput(gem)
local chargedWeapon = Item.GetItemIDFromDualInput(chargedWeapon)

local wCont, wSpot = findItemInContainer(weapon)
local gCont, gSpot = findItemInContainer(gem)

if (not wCont or not wSpot or not gCont or not gSpot) then
callback(false)
return false
end

local wItemCount = Self.ItemCount(weapon, wCont)
local gItemCount = Self.ItemCount(gem, gCont)
local cItemCount = Self.ItemCount(chargedWeapon)
local time = os.time()

while (wItemCount == Self.ItemCount(weapon, wCont) and gItemCount == Self.ItemCount(gem, gCont) and cItemCount == 

Self.ItemCount(chargedWeapon) and os.difftime(os.time(), time) < 10) do
local wCont, wSpot = findItemInContainer(weapon)
local gCont, gSpot = findItemInContainer(gem)

Container.UseItemWithContainerItem(gCont, gSpot, wCont, wSpot)
end

callback(true)
return true
end

Module.New("Enchant Weapon", function(mod)
if (Self.Weapon().id == normalWeapon and not isChanging and getSelfTargetID() == 0) then
delayWalker(20000)
isChanging = true

dequipWeapon(normalWeapon, function(success)
if (not success) then delayWalker(0) isChanging = false return end

enchantWeapon(normalWeapon, gemID, chargedWeapon, function(success)
if (not success) then equipWeapon(normalWeapon, function() delayWalker(0) isChanging = false end) end
if (success) then equipWeapon(chargedWeapon, function() delayWalker(0) isChanging = false end) end
end)
end)
end
end)

W pierwszych trzech linijkach zmieniasz pod siebie. Tutaj masz listę z ID itemków.

http://www.tibiaibot.com/forum/showthread.php?2813-Reference-Item-s-ID-List

EktJsRF.gif

 

Na przyszłość pisz tutaj - http://www.mpcforum.pl/topic/1259260-pro%C5%9Bba-o-skryptywaypointycaveboty-real-tibia/

 

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...