View Full Version : Use X item on Heroic Axe.
Elizabeth
04-28-2016, 10:41 PM
Hey, friends!
I need script, that will use item X from my main BP on my Heroic Axe. 13565
For exemple every one minute.
eldera
04-29-2016, 12:48 AM
13567
No subscription no script.
yompa93
04-29-2016, 01:31 AM
My monthly sub has ran out, but i just let tibia be runnin til i get cash. could be in the same position :(
Elizabeth
04-29-2016, 06:47 PM
13567
No subscription no script.
I buy....
Jontor Oscagi
HELP ME :(
Oscagi
04-29-2016, 07:49 PM
I buy....
Jontor Oscagi
HELP ME :(
I found 1 on form but it don't use the sapphire, I will fix it later
Elizabeth
04-29-2016, 07:55 PM
I found 1 on form but it don't use the sapphire, I will fix it later
Can always rely on u :D
Oscagi
04-29-2016, 10:59 PM
Can always rely on u :D
I have this but it dequip the weapon but dont use the sapphire, and I dont find wheres the mystake, maybe Jontor can help you.
Sorry.
local bp = 'Dragon Backpack'
while(true) do
c = Container.GetByName(bp)
if(Self.Weapon().id == 7383) then -- Relic Sword
for spot = 0, c:ItemCount()-1 do
if c:GetItemData(spot).id == 675 then -- Small Enchanted Sapphire
Self.Dequip("weapon", c)
wait(400,500)
c:UseItemWithContainerItem(spot, 1, 0)
wait(400,500)
Self.Equip(7383, "weapon")
end
end
end
wait(2000)
end
yompa93
04-29-2016, 11:18 PM
This should work, just have one backpack solely for this purpose. for example a bag with 10 enchanted sapphires and nothing else.
-- I recommend having one backpack or bag for the enchant to take place,
-- because the enchanted sapphires needs to be on spot 1 and the weapon at spot 0 when enchanting.
local bp = 'dragon backpack'
while(true) do
c = Container.GetByName(bp)
if(Self.Weapon().id == 7383) then -- Relic Sword
for spot = 0, c:ItemCount()-1 do
if c:GetItemData(spot).id == 675 then -- Small Enchanted Sapphire
Self.Dequip("weapon", c)
wait(400,500)
c:UseItemWithContainerItem(1, bp, 0)
wait(400,500)
Self.Equip(680, "weapon") -- icy relic sword
end
end
end
wait(2000)
end
Elizabeth
04-30-2016, 05:22 AM
Oscagi yompa93
The script is very problematic, becouse:
I'll have to always empty first container, this is impossible when i used bank. And i'll have to change all scripts .lua and create new products.
I found this script:
local AxeBackpack = "Backpack Of Holding"
local ReplaceAxe = 16096
local ChargeGem = 675
Module.New("Enchant", function(mod)
local weapon = Self.Weapon()
if (weapon.id == 7389) then
Walker.Stop()
local ping = Self.Ping()
local bp = Container.New(AxeBackpack)
local spots = {}
while (Self.Weapon().id == 7389) do
Self.Equip(ReplaceAxe, "weapon")
wait(500 + ping)
end
for i = 0, bp:ItemCount() do
local spot = bp:GetItemData(i)
if (spot.id == ChargeGem) then
spots[1] = i
elseif (spot.id == 7389) then
spots[2] = i
end
end
if (spots ~= nil) then
bp:UseItemWithContainerItem(spots[1], bp:Index(), spots[2])
wait(500 + ping)
local new = bp:GetItemData(spots[2])
while (Self.Weapon().id ~= new.id) do
Self.Equip(new.id, "weapon")
wait(500 + ping)
end
else
print("Weapon and gems must be in the same backpack!")
end
Walker.Start()
end
mod:Delay(10000)
end)
This is better, but sometimes when i have exhausted and script try use gem on axe don't do it, and my waypoints is stoped.
yompa93
04-30-2016, 06:23 AM
what about this, cant test it atm so yeah
local bp = 'dragon backpack'
while(true) do
c = Container.GetByName(bp)
if(Self.Weapon().id == 7383) then -- Relic Sword
for spot = 0, c:ItemCount()-1 do
if c:GetItemData(spot).id == 675 then -- Small Enchanted Sapphire
Self.Dequip("weapon", c)
wait(400,500)
c:UseItemWithContainerItem(spot, bp, 0)
wait(400,500)
Self.Equip(680, "weapon") -- icy relic sword
end
end
end
wait(2000)
end
Jontor
04-30-2016, 09:18 AM
Oscagi yompa93
The script is very problematic, becouse:
I'll have to always empty first container, this is impossible when i used bank. And i'll have to change all scripts .lua and create new products.
I found this script:
local AxeBackpack = "Backpack Of Holding"
local ReplaceAxe = 16096
local ChargeGem = 675
Module.New("Enchant", function(mod)
local weapon = Self.Weapon()
if (weapon.id == 7389) then
Walker.Stop()
local ping = Self.Ping()
local bp = Container.New(AxeBackpack)
local spots = {}
while (Self.Weapon().id == 7389) do
Self.Equip(ReplaceAxe, "weapon")
wait(500 + ping)
end
for i = 0, bp:ItemCount() do
local spot = bp:GetItemData(i)
if (spot.id == ChargeGem) then
spots[1] = i
elseif (spot.id == 7389) then
spots[2] = i
end
end
if (spots ~= nil) then
bp:UseItemWithContainerItem(spots[1], bp:Index(), spots[2])
wait(500 + ping)
local new = bp:GetItemData(spots[2])
while (Self.Weapon().id ~= new.id) do
Self.Equip(new.id, "weapon")
wait(500 + ping)
end
else
print("Weapon and gems must be in the same backpack!")
end
Walker.Start()
end
mod:Delay(10000)
end)
This is better, but sometimes when i have exhausted and script try use gem on axe don't do it, and my waypoints is stoped.
It's very long, but should work and never fail as long as you have gems in your equipment.
local normalWeapon = 7389
local chargedWeapon = 686
local gemID = 675
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)
wait(500)
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)
wait(500)
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)
Elizabeth
05-04-2016, 04:24 AM
It's very long, but should work and never fail as long as you have gems in your equipment.
local normalWeapon = 7389
local chargedWeapon = 686
local gemID = 675
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)
At the beginning script work good, but later when bot try change AXE my tibia has been bugged. (white window + no answer)
yompa93
05-04-2016, 07:03 AM
how can you still use bot right after a update without subscription? having the tibia client running doesnt explain that.:confused:
Jontor
05-04-2016, 09:22 AM
At the beginning script work good, but later when bot try change AXE my tibia has been bugged. (white window + no answer)
I forgot some waits, edited the post with code.
Elizabeth
05-19-2016, 03:00 PM
I forgot some waits, edited the post with code.
Jontor, sorry for replying so late.
It's better now, but not completely.
I have again show the message (not answer)only slightly less than before.
Elizabeth
05-24-2016, 02:21 AM
@Jontor
please help me :<
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.