Signup Now
Results 1 to 8 of 8
  1. #1
    Free User Garkstal's Avatar
    Join Date
    Dec 2013
    Location
    www.garkstalscripts.com
    Posts
    795
    Reputation
    124
    Rep Power
    23

    Mouthpiece of horn user

    Mouthpiece of horn user

    Description
    Using mouthpieces of horn at crude bone of horn.

    Configuration
    Put backpacks with horns and mouthpieces to 1 depot box. You need to have some space in your main backpack.

    Code

    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
    http://i.imgur.com/lkWkIMg.png
    ........................Script Name......................
    Profession
    Asura Palace ED + EK
    Characters for sale! | Like Our Facebook! | Sell Tibia Gold

  2. #2
    Free User Garkstal's Avatar
    Join Date
    Dec 2013
    Location
    www.garkstalscripts.com
    Posts
    795
    Reputation
    124
    Rep Power
    23
    @Patatje , @selassie
    Here you are. Also please test it out if you can because I had only few horns .
    http://i.imgur.com/lkWkIMg.png
    ........................Script Name......................
    Profession
    Asura Palace ED + EK
    Characters for sale! | Like Our Facebook! | Sell Tibia Gold

  3. #3
    Free User Patatje's Avatar
    Join Date
    Jan 2014
    Posts
    81
    Reputation
    21
    Rep Power
    21
    Quote Originally Posted by Garkstal View Post
    @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

  4. #4
    Free User Garkstal's Avatar
    Join Date
    Dec 2013
    Location
    www.garkstalscripts.com
    Posts
    795
    Reputation
    124
    Rep Power
    23
    Quote Originally Posted by Patatje View Post
    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.
    http://i.imgur.com/lkWkIMg.png
    ........................Script Name......................
    Profession
    Asura Palace ED + EK
    Characters for sale! | Like Our Facebook! | Sell Tibia Gold

  5. #5
    Free User Patatje's Avatar
    Join Date
    Jan 2014
    Posts
    81
    Reputation
    21
    Rep Power
    21
    Quote Originally Posted by Garkstal View Post
    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
    Last edited by Patatje; 09-07-2016 at 08:30 PM.

  6. #6
    Free User Garkstal's Avatar
    Join Date
    Dec 2013
    Location
    www.garkstalscripts.com
    Posts
    795
    Reputation
    124
    Rep Power
    23
    Quote Originally Posted by Patatje View Post
    '



    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.
    http://i.imgur.com/lkWkIMg.png
    ........................Script Name......................
    Profession
    Asura Palace ED + EK
    Characters for sale! | Like Our Facebook! | Sell Tibia Gold

  7. #7
    Free User Patatje's Avatar
    Join Date
    Jan 2014
    Posts
    81
    Reputation
    21
    Rep Power
    21
    Quote Originally Posted by Garkstal View Post
    Ill check it out, np.
    when do you think you can/will release the updated script?

  8. #8
    Free User Patatje's Avatar
    Join Date
    Jan 2014
    Posts
    81
    Reputation
    21
    Rep Power
    21
    bump!

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •