init start
-- Script_Version 1.0.0
local hornBp = "grey backpack" -- Backpack with not used horns
local mouthpieceBp = "yellow backpack" -- Backpack with mouthpieces
local dbLocation = 10 -- Location of backpacks
-- Do not edit
local mouthId = 20057
local hornId = 20055
local usedHorn = 20056
local counter = 0
local function findContainer(index)
local info = {found = false, id = 0}
local cont = getcontainer(index)
for i = 0, cont.itemcount do
if iteminfo(cont.item[i].id).iscontainer then
info.found, info.id = true, cont.item[i].id
end
end
return info
end
init end
closewindows()
while windowcount() == 0 do
openitem($back.id, "back") waitping(2, 3)
resizewindows(0, "0")
end
local mainBp = getcontainer(0).name
opendepot(dbLocation)
if itemcount(hornBp, 1) == 0 then
printerror("There is no horn bp in depot box ".. dbLocation ..". Persistant stopped.")
return false
end
if itemcount(mouthpieceBp, 1) == 0 then
printerror("There is no mouthpiece bp in depot box ".. dbLocation ..". Persistant stopped.")
return false
end
local hornIndex, mouthIndex = 2,1
while windowcount(hornBp) == 0 do
openitem(hornBp, 1, true) waitping(2,3)
end
resizewindows(100, "2")
while windowcount(mouthpieceBp) == 0 do
openitem(mouthpieceBp, 1, false) waitping(2,3)
end
resizewindows(100, "1")
while (true) do
if itemcount(mouthId, mouthIndex) == 0 then
local bp = findContainer(mouthIndex)
if bp.found then
openitem(bp.id, mouthIndex, false) waitping(2,3)
else
if itemcount(mouthId, mouthIndex) == 0 then
printerror("There is no more mouthpieces of horn. It have made ".. counter .. " horns. Persistant stopped.")
break
end
end
end
if itemcount(hornId, hornIndex) == 0 then
local bp = findContainer(hornIndex)
if bp.found then
openitem(bp.id, hornIndex, false) waitping(2,3)
else
if itemcount(hornId, hornIndex) == 0 then
printerror("There is no more cruds horn of bone. It have made ".. counter .. " horns. Persistant stopped.")
break
end
end
end
while itemcount(hornId, hornIndex) > 0 and itemcount(mouthId, mouthIndex) > 0 do
useitemon(hornId, mouthId) waitping(2,3)
while itemcount(usedHorn, mainBp) > 0 and getcontainer(hornIndex).emptycount > 0 do
moveitems(usedHorn, hornIndex, mainBp, 1) waitping(2,3)
counter = counter + 1
end
end
end
09-07-2016, 01:09 PM
Garkstal
@Patatje , @selassie
Here you are. Also please test it out if you can because I had only few horns :(.
09-07-2016, 03:06 PM
Patatje
Quote:
Originally Posted by Garkstal
@Patatje , @selassie
Here you are. Also please test it out if you can because I had only few horns :(.
thanks a lot using your time on this.
i have been trying to test it now but it doesnt work since the Horns has to be on you. the way it works now is that its using the horns in depot on the mouthpieces but doesnt work like i said before that the Horn has to be in your main backpack :P
09-07-2016, 04:52 PM
Garkstal
Quote:
Originally Posted by Patatje
thanks a lot using your time on this.
i have been trying to test it now but it doesnt work since the Horns has to be on you. the way it works now is that its using the horns in depot on the mouthpieces but doesnt work like i said before that the Horn has to be in your main backpack :P
Atm its working like this
opening mainbp > opening all bps from X depot box ( you need to put both bps to same depot box) > check if there are any items to use on > using horn on mouthpiece (horn with moutpiece will be pushed to your mainbp) > if there is any horn with mouthpiece on it it will move it to normal horns bp > repeat checking
Btw, you need to enable action again if you finished it because code is executing only once.
09-07-2016, 07:40 PM
Patatje
Quote:
Originally Posted by Garkstal
Atm its working like this
opening mainbp > opening all bps from X depot box ( you need to put both bps to same depot box) > check if there are any items to use on > using horn on mouthpiece (horn with moutpiece will be pushed to your mainbp) > if there is any horn with mouthpiece on it it will move it to normal horns bp > repeat checking
Btw, you need to enable action again if you finished it because code is executing only once.
'
im trying it but it still does not work, i have the backpacks with horns and backpack with mouthpieces inside depot box 10 - and i got a empty backpacks on me as a main backpack.
and all the horn backpacks i got in grey backpack
and mouthpieces in yellow backpacks.
i wrote the right backpack names and everything but, sometimes i get it working but sometimes its not working i dont know whats wrong :P
09-08-2016, 09:30 PM
Garkstal
Quote:
Originally Posted by Patatje
'
im trying it but it still does not work, i have the backpacks with horns and backpack with mouthpieces inside depot box 10 - and i got a empty backpacks on me as a main backpack.
and all the horn backpacks i got in grey backpack
and mouthpieces in yellow backpacks.
i wrote the right backpack names and everything but, sometimes i get it working but sometimes its not working i dont know whats wrong :P
Ill check it out, np.
09-11-2016, 02:08 AM
Patatje
Quote:
Originally Posted by Garkstal
Ill check it out, np.
when do you think you can/will release the updated script?