Signup Now
Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: AutoOpenBP

  1. #1
    Free User Cisco's Avatar
    Join Date
    Aug 2014
    Location
    Brazil
    Posts
    1,415
    Reputation
    119
    Rep Power
    18

    AutoOpenBP

    This persistent is programmed to work when you are not in zone safe, if you want to configure any specific area edit line 54.

    Do not forget to edit the name of the bps Looting > Seetings (line 13 - 17)

    --AutoOpenBP
    auto(1000)
    local useAutoBP = true --check, if use auto open bp
    local MinimizeEquip = false
    --Checks
    local useSupBP = true --check, if use supbp
    local useExtraBP = false --check, if use extrabp
    local useExtraBP2 = false --check, if use extrabp2
    local useLootBP = true --check, if use lootbp
    local useGoldBP = true --check, if use goldbp
    --Destination
    local mainbp = itemname($back.id)
    local supplybp = getlootingdestination('suppbp') --check you looting destination, name supbp
    local extrabp = getlootingdestination('extrabp') --check you looting destination, name extrabp
    local extrabp2 = getlootingdestination('extrabp2') --check you looting destination, name extrabp2
    local lootbp = getlootingdestination('lootbp') --check you looting destination, name lootbp
    local goldbp = getlootingdestination('goldbp') --check you looting destination, name goldbp

    --===================================================================================================

    function UseMinimizeEquip()
    while windowcount(mainbp) == 0 do
    restorewindows('equip')
    end
    while windowcount(mainbp) == 1 do
    minimizewindows('equip')
    end
    end

    function OpenMainBP()
    while windowcount(mainbp) == 0 do
    pausewalking(2000)
    wait(200,400)
    closewindows()
    openitem(0,'back')
    wait(200,400)
    pausewalking(0)
    resizewindows()
    end
    end

    function OthersBP(BpType)
    while windowcount(BpType) == 0 and windowcount(mainbp) == 1 do
    pausewalking(2000)
    openitem(BpType,mainbp,true)
    wait(200,400)
    pausewalking(0)
    resizewindows()
    end
    end

    if $connected then
    if useAutoBP then
    if not $pzone then
    if MinimizeEquip then
    UseMinimizeEquip()
    elseif not MinimizeEquip then
    restorewindows('equip')
    end
    OpenMainBP()
    if useSupBP and itemcount(supplybp) > 0 then
    OthersBP(supplybp)
    end
    if useExtraBP and itemcount(extrabp) > 0 then
    OthersBP(extrabp)
    end
    if useExtraBP2 and itemcount(extrabp2) > 0 then
    OthersBP(extrabp2)
    end
    if useLootBP and itemcount(lootbp) > 0 then
    OthersBP(lootbp)
    end
    if useGoldBP and itemcount(goldbp) > 0 then
    OthersBP(goldbp)
    end
    end
    end
    end


    -Update: 06/15/2017 --Add check if not Minimize equip then restore equip

  2. #2
    Free User downloadkct's Avatar
    Join Date
    Dec 2013
    Location
    Rio de Janeiro
    Posts
    1,164
    Reputation
    25
    Rep Power
    18
    Another great action, this bp opener is the best available here on forum, thank you \o/
    Old 'n Proud Neobot-Elfbot and blackd user

  3. #3
    Free User Cisco's Avatar
    Join Date
    Aug 2014
    Location
    Brazil
    Posts
    1,415
    Reputation
    119
    Rep Power
    18
    Quote Originally Posted by downloadkct View Post
    Another great action, this bp opener is the best available here on forum, thank you \o/
    thanks

  4. #4
    Free User MenelZThais's Avatar
    Join Date
    Aug 2016
    Location
    Poland
    Posts
    253
    Reputation
    10
    Rep Power
    11
    Nice dude! Simple, but useful and universal

  5. #5
    Free User
    Join Date
    May 2017
    Posts
    22
    Reputation
    10
    Rep Power
    0
    One of best BP openers. Great job Cisco!

  6. #6
    Free User Cisco's Avatar
    Join Date
    Aug 2014
    Location
    Brazil
    Posts
    1,415
    Reputation
    119
    Rep Power
    18
    Quote Originally Posted by GimmePancakes View Post
    One of best BP openers. Great job Cisco!
    Quote Originally Posted by MenelZThais View Post
    Nice dude! Simple, but useful and universal
    thanks

  7. #7
    Free User Cisco's Avatar
    Join Date
    Aug 2014
    Location
    Brazil
    Posts
    1,415
    Reputation
    119
    Rep Power
    18
    @downloadkct @MenelZThais @GimmePancakes

    --==Update: 06/15/2017 --Add check if not Minimize equip then restore equip==--

    Tomorrow I must put another update. I will put options to choose which backpacks to open in certain sections of the cavebot.


    Example of how I use ...

    - When I'm hunting I always have to open all the backpacks.
    - When I am buying potions or ammunition in the city, going hunting, refill, coming back from hunting, I just have to open the essentials which is mainbp, sup bp and bp extras. Because backpack of gold and loot in this case would be useless and one loses of time for the bot abrir and being able to cause deaths in the strongest hunts.

  8. #8
    Banned
    Join Date
    Jun 2015
    Posts
    48
    Reputation
    10
    Rep Power
    0
    i love u

  9. #9
    Free User
    Join Date
    Aug 2015
    Posts
    4
    Reputation
    10
    Rep Power
    0
    Yours is missing some stuff and not working at least for me, this is the one i made and added 2 functions u had, more code but works for me

    To see te Listas activate at HUD activehotkeys.lua
    Cavebot config (you need to add 1 per option) if i can ill add it later:
    Code:
    {
      				"type" : "combobox",
      				"name" : "MainBP",
    				"description" : "<p><strong>Main Backpack</strong><br>Name of your main backpack.</p>",
      				"text" : "Main Backpack Name",
    				"items" : [
    							"Backpack of Holding [[item: backpack of holding]]",
    							"Blue Backpack [[item: blue backpack]]",
    							"Anniversary Backpack [[item: Anniversary backpack]]",
    							"Brown Backpack [[item: brown backpack]]",
    							"Beach Backpack [[item: beach backpack]]",
    							"Brocade Backpack [[item: brocade backpack]]",
    							"Buggy Backpack [[item: buggy backpack]]",
    							"Camouflage Backpack [[item: camouflage backpack]]",
    							"Crown Backpack [[item: crown backpack]]",
    							"Crystal Backpack [[item: crystal backpack]]",
    							"Deepling Backpack [[item: deepling backpack]]",
    							"Demon Backpack [[item: demon backpack]]",
    							"Dragon Backpack [[item: dragon backpack]]",
    							"Expedition Backpack [[item: expedition backpack]]",
    							"Fur Backpack [[item: fur backpack]]",
    							"Golden Backpack [[item: golden backpack]]",
    							"Green Backpack [[item: green backpack]]",
    							"Grey Backpack [[item: grey backpack]]",
    							"Heart Backpack [[item: heart backpack]]",
    							"Jewelled Backpack [[item: jewelled backpack]]",
    							"Minotaur Backpack [[item: minotaur backpack]]",
    							"Moon Backpack [[item: moon backpack]]",
    							"Mushroom Backpack [[item: mushroom backpack]]",
    							"Orange Backpack [[item: orange backpack]]",
    							"Pannier Backpack [[item: pannier backpack]]",
    							"Pirate Backpack [[item: pirate backpack]]",
    							"Purple Backpack [[item: purple backpack]]",
    							"Red Backpack [[item: red backpack]]",
    							"Santa Backpack [[item: santa backpack]]",
    							"Shopping Bag [[item: shopping bag]]",
    							"Yellow Backpack [[item: yellow backpack]]"
    							]
      			},
    Script:
    Code:
    -- Auto Open Bps
    -- Options
    local useAutoBP = true -- check, if use auto open bp
    local useMinimizeEquip = true -- check, if minimize equip
    -- Checks
    local useSupBP = true -- check, if use supbp
    local useExtraBP = false -- check, if use extrabp
    local useExtraBP2 = false -- check, if use extrabp2
    local useLootBP = true -- check, if use lootbp
    local useGoldBP = true -- check, if use goldbp
    -- Destination, need to add to Cavebot Configs the user option
    local mainbp 	= getuseroption("MainBP")	-- check you looting destination, name mainbp
    local suppbp	= getuseroption("SuppBP")	-- check you looting destination, name supbp
    local extrabp	= getuseroption("ExtraBP")	-- check you looting destination, name extrabp
    local extrabp2	= getuseroption("ExtraBP2")	-- check you looting destination, name extrabp2
    local lootbp	= getuseroption("LootBP")	-- check you looting destination, name lootbp
    local goldbp	= getuseroption("GoldBP")	-- check you looting destination, name goldbp
    --------------------------------------------------------------------------------------------
    auto(1500,3000)
    if not $pzone and useAutoBP and $connected then
    	if (windowcount(mainbp) ~= 1 or windowcount(goldbp) ~= 1 or windowcount(lootbp) ~= 1 or windowcount(suppbp) ~= 1 or windowcount(extrabp) ~= 1 and useExtraBP or windowcount(extrabp2) ~= 1 and useExtraBP2) then
                    	setsetting('Looting/OpenNextBP', 'no')
    		if windowcount(mainbp) ~= 1 then
    			listas("BP Opener - Opening mainbp")
    			pausewalking(2000)
    			openitem(mainbp,'back')
    			waitping() 		waitping()
    			resizewindows(0,mainbp)
    			waitping() 		waitping()
    		end
    		if windowcount(lootbp) ~= 1 and useLootBP then
    			listas("BP Opener - Opening lootbp")
    			pausewalking(2000)
    			openitem(lootbp,mainbp,true)
    			waitping() 		waitping()
    			resizewindows(0,lootbp)
    			waitping() 		waitping()
    		end
    		if windowcount(suppbp) ~= 1 and useSupBP then
    			listas("BP Opener - Opening supplybp")
    			pausewalking(2000)
    			openitem(suppbp,mainbp,true)
    			waitping() 		waitping()
    			resizewindows(0,supplybp)
    			waitping() 		waitping()
    		end
    		if windowcount(goldbp) ~= 1 and useGoldBP then
    			listas("BP Opener - Opening goldbp")
    			pausewalking(2000)
    			openitem(goldbp,mainbp,true)
    			waitping() 		waitping()
    			resizewindows(0,goldbp)
    			waitping() 		waitping()
    		end
    		if windowcount(extrabp) ~= 1 and useExtraBP then
    			listas("BP Opener - Opening extrabp")
    			pausewalking(2000)
    			openitem(extrabp,mainbp,true)
    			waitping() 		waitping()
    			resizewindows(0,extrabp)
    			waitping() 		waitping()
    		end
    		if windowcount(extrabp2) ~= 1 and useExtraBP2 then
    			listas("BP Opener - Opening extrabp2")
    			pausewalking(2000)
    			openitem(extrabp2,mainbp,true)
    			waitping() 		waitping()
    			resizewindows(0,extrabp2)
    			waitping() 		waitping()
    		end
    		setsetting('Looting/OpenNextBP', 'yes')
    	else
    		listas("BP Opener - BPs Opened")
    	end
    else
    	listas("Disabled For Depositer")
    end
    if useMinimizeEquip then
    	minimizewindows('equip')
    end
    Last edited by iafondo; 07-06-2017 at 11:00 AM.

  10. #10
    Free User Cisco's Avatar
    Join Date
    Aug 2014
    Location
    Brazil
    Posts
    1,415
    Reputation
    119
    Rep Power
    18
    @iafondo

    The function of this persistent is only to open the backpacks.

    1- Useroption --> some players do not use, so I put "getlootingdestination()" which is the names you would write in "Looting > Settings > Looting Destinations"

    2- listas() --> just a writing to guide what is happening

    3- windowcount(mainbp) == 0 or windowcount(mainbp) ~= 1 --> In this case it's the same thing, the two mean even the backpacks are not open.

    4- setsetting('Looting/OpenNextBP', 'yes') --> This is option of every script that is done, I could not put this in persistent because in some moments this part would have to be disabled or the whole looting disabled for certain functions like dp.

    This issue is resolved with another persistent.

    auto(1000)

    local Sections = {'Hunt'} --{'Hunt'} or {'Floor 1', 'Floor 2'} or {'City', 'ToCity', 'Hunt'} etc...

    if $connected then
    if table.find(Sections, $wptsection) then
    setsetting('Looting/OpenNextBP', 'yes')
    else
    setsetting('Looting/OpenNextBP', 'no')
    end
    end


    or desable Looting

    auto(1000)

    local Sections = {'Hunt'} --{'Hunt'} or {'Floor 1', 'Floor 2'} or {'City', 'ToCity', 'Hunt'} etc...

    if $connected then
    if table.find(Sections, $wptsection) then
    setsetting('Looting/Enabled', 'yes')
    else
    setsetting('Looting/Enabled', 'no')
    end
    end


    5- wait() or waitping() --> I used "wait()" but if you want "waitping()" just change all "wait()" to "waitping()"

    PS -->The problem you should be having is this part, always to open backpacks you put 2 "waitping()" followed this means that your problem should be ping + time to open backpack. Then just increase the "wait()" or put 1 "waitping()"

    6- If you are disconnected the persistent you posted will not open the backpacks because you only put them to minimize the "equips" and did not put them to maximize if they are closed.

    7- Your "mainbp" opens only if it is the "useroption" backpack, the way I put it in the persistent it opens any backpacks that are like "mainbp"

    8- It is a persistence that anyone can use. In the case of your persistent the person would have to have "useroption" and in the part of "open next bp" the person would change some configuration that sometimes at that moment the scripter had it deactivated.

    9- But the goal is to serve as backpack opener the rest is personal setting. I can not put personal setup into a persistent serving for several people with different styles. An example I use it so ...my persistent line 54

    if table.find({'City'}, $wptsection) and $wptid ~= 006 or 
    table.find({'Location', 'To Spawn', 'Refill', 'To City', 'City2', 'TrainerOff', 'Hunt'}, $wptsection) then


    section City, wptid 006 is my depositing (dehan depot box)

 

 

Posting Permissions

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