Dropping

Discussion in 'Client & Site Suggestions' started by Fox, Nov 20, 2013.

  1. I've written some api for an old bot
    dropAll
    dropAllOff
    Code (Text):
    1.     public void dropAllOf(final int id) {
    2.         if(Inventory.isFull()) {
    3.             for(final Item i: Inventory.getItems()) {
    4.                 if(i.getId() == id) {
    5.                     i.interact("Drop");
    6.                     Task.sleep(500, 1000);
    7.                 }
    8.             }
    9.         }
    10.     }
    11.     public void dropAll() {
    12.         if(Inventory.isFull()) {
    13.             for(final Item i: Inventory.getItems()) {
    14.                     i.interact("Drop");
    15.                     Task.sleep(500, 1000);
    16.                 }
    17.         }
    18.     }
    19. }
     
  2. There really isn't a reason for Item to be final, you should also NOT use a static sleep method. I'm not even sure if those classes/methods exist for runemate. They seem to be old powerbot methods that were in everyone's script bot.
     
  3. Dropping methods probably will not be added to the client, since there something everyone should be handling differently.
    There isn't any harm with having Item finalized, even if it isn't necessary. And for your info, there are methods for static sleeping, but there are also methods for dynamic sleeping. Check out the Execution class
     
  4. No, just stating it was unnecessary :p. For the methods i was referring to the getAll() and interacting and such. It would also be horrible practice and broken code if there was a static sleep in the dropping method.

    I do think it should be added to the API.

    Inventory.dropAll()
    Inventory.drop(int id)
    Inventory.dropAllExcept(int[] ids)

    That would cover pretty much every use that I can think of.
     
  5. you just look like retard if you don't finalize it
     
  6. How about an xAPI (extended API) sort of thing where we encourage users to develop their own libraries and share them that implements some of the non-core methods (particularly learning) Bot Authors would use on a regular basis? I understand Cloud's thought process in it not being standard and therefore not in the core client, but I also acknowledge the other side where each developer shouldn't need to re-invent the wheel to do basic operations.
     
  7. There is 0 reason to have that variable as a final. A half decent programmer would know not to redefine it, and even then it doesn't affect anything. It is simply unnecessary. It doesn't really matter that you put it, I was simply critiquing it.
     
  8. Yeah, and any programmer who doesn't use finalize is just a retard like i'm stating.
     
  9. Where did you learn that? I've never seen anyone do that other than for constants vars or final classes. It's retarded to do that for a foreach loop. Not to mention your static sleep was dumb and breaks the method anyway, so I can't really believe anything you say to be valid until I see oracle documented proof.

    EDIT: My CS professor doesn't finalize anything other than a few global constants (he worked at google and amazon). Soooo. Yeah

    Also even oracle docs don't finalize http://docs.oracle.com/javase/1.5.0/docs/guide/language/foreach.html (they created java in case you didn't know)

    So don't try to call me out as a retard when you have no idea what you are talking about.
     
  10. You should do this! I like the idea of creating it's own library and having it updated regularly by the community so methods can be fixed faster than when a developer is available and not busy to fix it :)
     
  11. Just to let you know. I'm guessing your CS prefessor is prob like 40 years +. Oracle doesn't finalize due to the fact that it isn't needed.
     
  12. He is around 32, which is fairly irrelevant. I still don't get why you finalize that singular variable in your for each. You never explained why, simply said everyone else was a retard.
     
  13. Ehh we can discuss this later. We shouldn't be arguing about this here
     
  14. I personally think this is a great idea! To have the community involved to making this bot quite amazing
     
  15. yes
     

Share This Page

Loading...