Results 1 to 8 of 8

Thread: Loop in Reopen backpack

  1. #1
    Focus Group MoS's Avatar
    Join Date
    Feb 2012
    Posts
    832
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    63 Post(s)
    Reputation
    77
    Rep Power
    6

    Loop in Reopen backpack

    well, couldn't find it... so, my question is

    how can I create a loop until the action open all the bps correctly?

    for exemple, I have a reopen backpack in the middle of a hunt, I don't use reconnect, because most of the times I stay in front of computer, so.. i just relog manually, and when I do it, the action reopen all my backpacks, but sometimes, it kills a monster before the bps are open, then i have like.... main bp (00), loot bp (01), dead monster (03), gold bp (04), supp bp (05)..... the loot goes to the wrong backpacks then

    i have this action, and I want it to check the backpacks like this

    PHP Code:
    if windowcount() < 4 then
    pausewalking
    (1500)
    setsettings("Settings\\Cavebot\\Settings\\OpenNextBp","no")  
    closewindows()
    setcavebot("no")
    settargeting("no")
    setlooting("no")
    wait(3006000)
    openitem(MainBP'back')
    wait(5001000)
    resizewindows()
    openitem(LootBPMainBPtrue)
    wait(5001000)
    resizewindows()
    openitem(GoldBPMainBPtrue)
    wait(5001000)
    resizewindows()
    openitem(SuppBPMainBPtrue)
    wait(5001000)
    resizewindows()
    setsettings("Settings\\Cavebot\\Settings\\OpenNextBp","yes")
    setcavebot("yes")
    settargeting("yes")
    setlooting("yes")
    end 
    thats the original action i use.... but i dont know what to do, to check the backpacks (if there are only 4 open, no dead bodies or anything else) before it turn on the settings again

    i dont know the correct function, maybe like this?

    PHP Code:
    ....
    resizewindows()
    if 
    windowcount() = 4 then
    setsettings
    ("Settings\\Cavebot\\Settings\\OpenNextBp","yes")
    setcavebot("yes")
    settargeting("yes")
    setlooting("yes")
    else
    loop begin of action
    end 
    sorry for english, help guys
    Ajudei você? ...............+REP
    -----------------------------------------
    Did I help you? ..........+REP

  2. #2
    iBot User Dehan's Avatar
    Join Date
    May 2012
    Location
    www.ssocialscripts.com
    Posts
    910
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    114
    Rep Power
    7
    Lua Code:
    while windowcount() < 4 do
    pausewalking(1500)
    setsettings("Settings\\Cavebot\\Settings\\OpenNextBp","no")  
    closewindows()
    setcavebot("no")
    settargeting("no")
    setlooting("no")
    wait(300, 6000)
    openitem(MainBP, 'back')
    wait(500, 1000)
    resizewindows()
    openitem(LootBP, MainBP, true)
    wait(500, 1000)
    resizewindows()
    openitem(GoldBP, MainBP, true)
    wait(500, 1000)
    resizewindows()
    openitem(SuppBP, MainBP, true)
    wait(500, 1000)
    resizewindows()
    wait(1000,2000)
    	if windowcount() == 4 then
    		setsettings("Settings\\Cavebot\\Settings\\OpenNextBp","yes")
    		setcavebot("yes")
    		settargeting("yes")
    		setlooting("yes")
    	else
    		closewindows()
    	end
    end
    Check out - Dehan Accounts Service!

    Proud Scripter of BUgWT STAFF

  3. #3
    Normal User giovani's Avatar
    Join Date
    Feb 2012
    Location
    Rio Grande do Sul - Brasil
    Posts
    78
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    11
    Rep Power
    5
    Just set the looting off while opening the bp's

    @EDIT: My mistake, Dehan already did this. :P

  4. #4
    Focus Group MoS's Avatar
    Join Date
    Feb 2012
    Posts
    832
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    63 Post(s)
    Reputation
    77
    Rep Power
    6
    Quote Originally Posted by giovani View Post
    Just set the looting off while opening the bp's

    @EDIT: My mistake, Dehan already did this. :P
    if windowcount() < 4 then
    pausewalking(1500)
    setsettings("Settings\\Cavebot\\Settings\\OpenNextBp","no")
    closewindows()
    setcavebot("no")
    settargeting("no")
    setlooting("no")

    i had already set the looting off, but for some reason.... before the action see the closed backpacks, it attacked a monster.. then turned it off, but opened body anyway, dik, strange :/

    @Dehan

    thx bro, once i get time to test it, i give a feedback
    Ajudei você? ...............+REP
    -----------------------------------------
    Did I help you? ..........+REP

  5. #5
    Focus Group MoS's Avatar
    Join Date
    Feb 2012
    Posts
    832
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    63 Post(s)
    Reputation
    77
    Rep Power
    6
    it didnt work, i tested, and it doesnt close all the backpacks again... also, it doesnt turn on the cavebot/looting/targeting

    any other option? i tried to change "while" for "if" and it didnt work either
    Ajudei você? ...............+REP
    -----------------------------------------
    Did I help you? ..........+REP

  6. #6
    iBot User Dehan's Avatar
    Join Date
    May 2012
    Location
    www.ssocialscripts.com
    Posts
    910
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    114
    Rep Power
    7
    Quote Originally Posted by MoS View Post
    it didnt work, i tested, and it doesnt close all the backpacks again... also, it doesnt turn on the cavebot/looting/targeting

    any other option? i tried to change "while" for "if" and it didnt work either
    any debug errors?
    ps: when you change while for if you also need to change the do for then
    Check out - Dehan Accounts Service!

    Proud Scripter of BUgWT STAFF

  7. #7
    Normal User giovani's Avatar
    Join Date
    Feb 2012
    Location
    Rio Grande do Sul - Brasil
    Posts
    78
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    11
    Rep Power
    5
    You should put the setlooting("no") in the first position, after the while. This way, it'll be the first thing to do...

  8. #8
    Focus Group MoS's Avatar
    Join Date
    Feb 2012
    Posts
    832
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    63 Post(s)
    Reputation
    77
    Rep Power
    6
    Quote Originally Posted by giovani View Post
    You should put the setlooting("no") in the first position, after the while. This way, it'll be the first thing to do...
    already tried... most of the times it works.. but it already happened few times to still open the dead body, even with looting off :/

    Quote Originally Posted by Dehan View Post
    any debug errors?
    ps: when you change while for if you also need to change the do for then
    PERFECT !

    exacly how I wanted... i tested, it was with 1 dead body + 4 bps.... then it closed everything again (without turning anything ON), opened all again... and turned ON, THANKS DUDE
    Ajudei você? ...............+REP
    -----------------------------------------
    Did I help you? ..........+REP

Posting Permissions

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