Results 1 to 9 of 9

Thread: Editing Backpack opener

  1. #1
    iBot User
    Join Date
    Sep 2013
    Posts
    38
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    7 Post(s)
    Reputation
    24
    Rep Power
    4

    Editing Backpack opener

    Hello i just wonder how to edit script which i found into forum given by pink panther

    loopBp = "Green Backpack"

    If getcontainer(lootBp).usedslots == 1 then openitem(lootBp, lootBp, false) end

    Everything is right if every backpacks are in same colour. But i need to make script that opening backpack with random colour for example Red>blue>gren>golden>beach >red>red>red>purple etc...

    I thinking about use first slot of backpack if only 1 is used but even with documentation i cannot solve it. I didnt even know how to use table in situation like this :<
    Last edited by buluss; 08-05-2014 at 06:10 PM.

  2. #2
    Normal User RafiXWPT's Avatar
    Join Date
    Jun 2012
    Location
    (Poland) http://rafixwptscripts.com
    Posts
    1,602
    Mentioned
    31 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    128 Post(s)
    Reputation
    128
    Rep Power
    9
    Quote Originally Posted by buluss View Post
    Hello i just wonder how to edit script which i found into forum given by pink panther




    Everything is right if every backpacks are in same colour. But i need to make script that opening backpack with random colour for example Red>blue>gren>golden>beach >red>red>red>purple etc...

    I thinking about use first slot of backpack if only 1 is used but even with documentation i cannot solve it :<

    Its immpossible with that action, if you want to use different colours you must change it what is waste of time. Just buy backpacks with same colour.

  3. #3
    iBot User
    Join Date
    Sep 2013
    Posts
    38
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    7 Post(s)
    Reputation
    24
    Rep Power
    4
    Its impossible? oh ok.. I got 1 question is possible to return id of item on 1st slot? if yes then is possible to do


    Anyway i can make action like

    Lua Code:
     
     
    lootBp = "Green Backpack" 
     
    If getcontainer(lootBp).usedslots == 1 and itemcount(lootBp) >0 then openitem(lootBp, lootBp, false) end
     
     
    lootBp2 = "Grey Backpack" 
     
    If getcontainer(lootBp2).usedslots == 1 and itemcount(lootBp2) >0 then openitem(lootBp, lootBp, false) end


    Just want to know is possible to make it simply way....


    Just fast making like this hope my PC wont blow off

    Lua Code:
     
    lootBp = "Grey Backpack" 
    lootBp2 = "Fur Backpack"
    lootBp3 = "Green Backpack"
    lootBp4 = "Backpack"
    lootBp5  = "golden Backpack"
    --1BP--
    If getcontainer(lootBp).usedslots == 1 and itemcount(LootBp) > 0  then openitem(lootBp, lootBp, false) end
    If getcontainer(lootBp).usedslots == 1 and itemcount(LootBp2) > 0  then openitem(lootBp2, lootBp, false) end
    If getcontainer(lootBp).usedslots == 1 and itemcount(LootBp3) > 0  then openitem(lootBp3, lootBp, false) end
    If getcontainer(lootBp).usedslots == 1 and itemcount(LootBp4) > 0 then openitem(lootBp4, lootBp, false) end
    If getcontainer(lootBp).usedslots == 1 and itemcount(LootBp5) > 0 then openitem(lootBp5, lootBp, false) end
    --2BP--
     
    If getcontainer(lootBp2).usedslots == 1 and itemcount(LootBp) > 0  then openitem(lootBp, lootBp2, false) end
    If getcontainer(lootBp2).usedslots == 1 and itemcount(LootBp2) > 0  then openitem(lootBp2, lootBp2, false) end
    If getcontainer(lootBp2).usedslots == 1 and itemcount(LootBp3) > 0  then openitem(lootBp3, lootBp2, false) end
    If getcontainer(lootBp2).usedslots == 1 and itemcount(LootBp4) > 0 then openitem(lootBp4, lootBp2, false) end
    If getcontainer(lootBp2).usedslots == 1 and itemcount(LootBp5) > 0 then openitem(lootBp5, lootBp2, false) end
    --3BP--
    If getcontainer(lootBp3).usedslots == 1 and itemcount(LootBp) > 0  then openitem(lootBp, lootBp3, false) end
    If getcontainer(lootBp3).usedslots == 1 and itemcount(LootBp2) > 0  then openitem(lootBp2, lootBp3, false) end
    If getcontainer(lootBp3).usedslots == 1 and itemcount(LootBp3) > 0  then openitem(lootBp3, lootBp3, false) end
    If getcontainer(lootBp3).usedslots == 1 and itemcount(LootBp4) > 0 then openitem(lootBp4, lootBp3, false) end
    If getcontainer(lootBp3).usedslots == 1 and itemcount(LootBp5) > 0 then openitem(lootBp5, lootBp3, false) end
    --4BP--
    If getcontainer(lootBp4).usedslots == 1 and itemcount(LootBp) > 0  then openitem(lootBp, lootBp4, false) end
    If getcontainer(lootBp4).usedslots == 1 and itemcount(LootBp2) > 0  then openitem(lootBp2, lootBp4, false) end
    If getcontainer(lootBp4).usedslots == 1 and itemcount(LootBp3) > 0 then openitem(lootBp3, lootBp4, false) end
    If getcontainer(lootBp4).usedslots == 1 and itemcount(LootBp4) > 0  then openitem(lootBp4, lootBp4, false) end
    If getcontainer(lootBp4).usedslots == 1 and itemcount(LootBp5) > 0 then openitem(lootBp5, lootBp4, false) end
    --5BP--
    If getcontainer(lootBp5).usedslots == 1 and itemcount(LootBp) > 0  then openitem(lootBp, lootBp5, false) end
    If getcontainer(lootBp5).usedslots == 1 and itemcount(LootBp2) > 0  then openitem(lootBp2, lootBp5, false) end
    If getcontainer(lootBp5).usedslots == 1 and itemcount(LootBp3) > 0 then openitem(lootBp3, lootBp5, false) end
    If getcontainer(lootBp5).usedslots == 1 and itemcount(LootBp4) > 0 then openitem(lootBp4, lootBp5, false) end
    If getcontainer(lootBp5).usedslots == 1 and itemcount(LootBp5) > 0  then openitem(lootBp5, lootBp5, false) end
    Last edited by buluss; 08-05-2014 at 06:57 PM.

  4. #4
    Moderator Drakke's Avatar
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,898
    Mentioned
    216 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    390 Post(s)
    Reputation
    366
    Rep Power
    10
    Quote Originally Posted by RafiXWPT View Post
    Its immpossible with that action, if you want to use different colours you must change it what is waste of time. Just buy backpacks with same colour.
    Its not impossible, quite easy to do IMO

    Quote Originally Posted by buluss View Post
    Hello i just wonder how to edit script which i found into forum given by pink panther

    Everything is right if every backpacks are in same colour. But i need to make script that opening backpack with random colour for example Red>blue>gren>golden>beach >red>red>red>purple etc...

    I thinking about use first slot of backpack if only 1 is used but even with documentation i cannot solve it. I didnt even know how to use table in situation like this :<
    Here you go

    Lua Code:
     
    local lootBp = 00 --Set to the correct window, 00 is first 01 second 02 third etc
    local nextBp = getcontainer(lootBp).items[0].id --Will check ID of first item in whatever colored backpack you have open if lootBp is correct
     
    if getcontainer(lootBp).usedslots == 1 then 
        openitem(nextBp, lootBp, false) 
    end
    Last edited by pink_panther; 08-05-2014 at 06:57 PM.

  5. #5
    iBot User pink_panther's Avatar
    Join Date
    May 2012
    Location
    Australia
    Posts
    4,075
    Mentioned
    49 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    178 Post(s)
    Reputation
    309
    Rep Power
    10
    Quote Originally Posted by RafiXWPT View Post
    Its immpossible with that action, if you want to use different colours you must change it what is waste of time. Just buy backpacks with same colour.
    Lies!


    Quote Originally Posted by Drakke View Post
    Its not impossible, quite easy to do IMO



    Here you go

    Lua Code:
     
    local lootBp = 00 --Set to the correct window, 00 is first 01 second 02 third etc
    local nextBp = getcontainer(lootBp).items[0].id --Will check ID of first item in whatever colored backpack you have open if lootBp is correct
     
    if getcontainer(lootBp).usedslots == 1 then 
        openitem(nextBp, lootBp, false) 
    end

    Umm... Why are you setting looBp to 00? why not just make it "Blue Backpack" or whatever, why an int?

    Granted, this would work if your bp was always in slot 0.


    HOWEVER, I will take you one step further....
    @buluss

    This will open the first container it finds when your backpack is full.
    Lua Code:
     
    local lootBp = 00 -- Needs to be an index for the bp window, because the name will change.
     
    if getcontainer(lootBp).usedslots == getcontainer(lootBp).maxslots then
        for i = 0, getcontainer(lootBp).maxslots do
            if itemproperty((getcontainer(lootBp).items[i].id)).isContainer then
                useitem(getcontainer(lootBp).items[i].id, lootBp)
                wait(500)
            end
        end
    end
    Last edited by pink_panther; 08-05-2014 at 07:27 PM.

  6. #6
    iBot User
    Join Date
    Sep 2013
    Posts
    38
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    7 Post(s)
    Reputation
    24
    Rep Power
    4
    Quote Originally Posted by Drakke View Post
    Its not impossible, quite easy to do IMO



    Here you go

    Lua Code:
     
    local lootBp = 00 --Set to the correct window, 00 is first 01 second 02 third etc
    local nextBp = getcontainer(lootBp).items[0].id --Will check ID of first item in whatever colored backpack you have open if lootBp is correct
     
    if getcontainer(lootBp).usedslots == 1 then 
        openitem(nextBp, lootBp, false) 
    end


    Umm... Why are you setting looBp to 00? why not just make it "Blue Backpack" or whatever, why an int?

    Granted, this would work if your bp was always in slot 0.
    I knew it !!! As a beginer got problems with tables/complex functions so i cant build it correctly ;/ Rep +


    Quote Originally Posted by pink_panther View Post
    Umm... Why are you setting looBp to 00? why not just make it "Blue Backpack" or whatever, why an int?

    Granted, this would work if your bp was always in slot 0.
    I think there is no option that bp will change its index :>
    Last edited by buluss; 08-05-2014 at 07:14 PM.

  7. #7
    Moderator Drakke's Avatar
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,898
    Mentioned
    216 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    390 Post(s)
    Reputation
    366
    Rep Power
    10
    Quote Originally Posted by pink_panther View Post
    Umm... Why are you setting looBp to 00? why not just make it "Blue Backpack" or whatever, why an int?

    Granted, this would work if your bp was always in slot 0.
    Because then it will always look for items in "Blue backpack" and wont open next if it opens a yellow backpack for example.
    And then the action will not do what he wants.
    And I just set it as 00 as default, I clearly wrote that he should change to whatever space hes lootbp is using

  8. #8
    iBot User pink_panther's Avatar
    Join Date
    May 2012
    Location
    Australia
    Posts
    4,075
    Mentioned
    49 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    178 Post(s)
    Reputation
    309
    Rep Power
    10
    Quote Originally Posted by Drakke View Post
    Because then it will always look for items in "Blue backpack" and wont open next if it opens a yellow backpack for example.
    And then the action will not do what he wants.
    And I just set it as 00 as default, I clearly wrote that he should change to whatever space hes lootbp is using
    Hmm oh right, because after it opens the first bp, it's going to change names... right. Good point. I'm in the mindset that you just use the same colour.

    I've updated my script, it will still work with the index, and will still find the next bp, doesnt have to be in the first or last slot every time.

    Also noted mine opens the nexp bp when it's full. But it would be easy to change getcontainer(lootBp).maxslots to 1 or whatever you wanted so it opens when it's empty.

    I just got out of bed, leave me alonee

    @buluss Can I just ask what you need to use random bps for?
    Last edited by pink_panther; 08-05-2014 at 07:32 PM.

  9. #9
    Moderator Drakke's Avatar
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,898
    Mentioned
    216 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    390 Post(s)
    Reputation
    366
    Rep Power
    10
    Quote Originally Posted by pink_panther View Post
    I just got out of bed, leave me alonee
    And I was suppose to go to bed 2h ago!

Posting Permissions

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