Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Dropping

fox

Joined
Nov 3, 2013
Messages
41
I've written some api for an old bot
dropAll
dropAllOff
Code:
    public void dropAllOf(final int id) {
        if(Inventory.isFull()) {
            for(final Item i: Inventory.getItems()) {
                if(i.getId() == id) {
                    i.interact("Drop");
                    Task.sleep(500, 1000);
                }
            }
        }
    }
    public void dropAll() {
        if(Inventory.isFull()) {
            for(final Item i: Inventory.getItems()) {
                    i.interact("Drop");
                    Task.sleep(500, 1000);
                }
        }
    }
}
 
Joined
Nov 18, 2013
Messages
120
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.
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
Dropping methods probably will not be added to the client, since there something everyone should be handling differently.
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.
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
 
Joined
Nov 18, 2013
Messages
120
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

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.
 

fox

Joined
Nov 3, 2013
Messages
41
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.
you just look like retard if you don't finalize it
 
Mod Automation
Joined
Jul 26, 2013
Messages
3,046
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.
 
Joined
Nov 18, 2013
Messages
120
you just look like retard if you don't finalize it

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.
 

fox

Joined
Nov 3, 2013
Messages
41
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.
Yeah, and any programmer who doesn't use finalize is just a retard like i'm stating.
 
Joined
Nov 18, 2013
Messages
120
Yeah, and any programmer who doesn't use finalize is just a retard like i'm stating.

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.
 
Joined
Nov 18, 2013
Messages
120
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.

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 :)
 

fox

Joined
Nov 3, 2013
Messages
41
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.
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.
 
Joined
Nov 18, 2013
Messages
120
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.

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.
 

fox

Joined
Nov 3, 2013
Messages
41
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.
Ehh we can discuss this later. We shouldn't be arguing about this here
 

red

Joined
Nov 17, 2013
Messages
259
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.
I personally think this is a great idea! To have the community involved to making this bot quite amazing
 
Top