Jump to content

Opening all feather packs - Need help


Ragboys is back

Recommended Posts

I know there are tons of scripts like feather buying already, but I usually like to make my own scripts to improve my programming skills/get more used to the API.

What my script is supposed to do:

- Buy feather pack only if there is over 95 packs in the shop; (working)

- Open all the packs in the inventory when the inventory is full; (need help)

 

To open the packs, I'm checking if the inventory is full. If it its, it'll open the packs, but once one pack is open, the inventory is not full anymore, so it'll buy more packs until the inventory is full again.

I also tried checking if my inventory had over 'x' packs, but that's not working either, because it's pretty much the same logic above. Let's say it'll open packs once my inventory contains  25 or more (>=25) packs. Once one pack is open, the inventory will contain 24 packs and it will buy more packs, not opening the remaining.

 

How could I fix this? What kind of condition should I check? Should I make my own void method to open 'x' packs? If so, how to do it?

Thanks in advance.

 

 

 

Edited by Ragboys is back
Link to comment
Share on other sites

10 minutes ago, Ragboys is back said:

I know there are tons of scripts like feather buying already, but I usually like to make my own scripts to improve my programming skills/get more used to the API.

What my script is supposed to do:

- Buy feather pack only if there is over 95 packs in the shop; (working)

- Open all the packs in the inventory when the inventory is full; (need help)

 

To open the packs, I'm checking if the inventory is full. If it its, it'll open the packs, but once one pack is open, the inventory is not full anymore, so it'll buy more packs until the inventory is full again.

I also tried checking if my inventory had over 'x' packs, but that's not working either, because it's pretty much the same logic above. Let's say it'll open packs once my inventory contains  25 or more (>=25) packs. Once one pack is open, the inventory will contain 24 packs and it will buy more packs, not opening the remaining.

 

How could I fix this? What kind of condition should I check? Should I make my own void method to open 'x' packs? If so, how to do it?

Thanks in advance.

 

 

 

you pathing to bank when invent is full?

Link to comment
Share on other sites

Once you open a feather pack, yes the condition is no longer true that inventory is full, however you are still inside the code block. The code block will execute everything inside of it (that should be executed), it wont just exit because the condition changed.  If you have it written so that it opens everything (example: iterate through all items and open), then you wouldn't be facing this problem.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...