Jump to content

Script help - Items


Recommended Posts

Posted

Hey,

I'm trying to write my first script and so far I feel it's going ok, however, If I want it to loot items does the first letter of the item have to be capitals exactly as it shows or does it not matter?

And how would I implement it to pick something up over a set value? 

 

Thanks

Posted (edited)
8 minutes ago, Pogba said:

If I want it to loot items does the first letter of the item have to be capitals exactly as it shows or does it not matter?

This is basic java.

String.toLowerCase().equals(String.toLowerCase())

 

And to answer how you can implement picking up items with values over X,

 

You need to access a database of item values and when you find a new item on the ground which you have not stored the value of you query the value.

You then make an item filter for nearby items and filter them based on their value you got earlier.

(do NOT re-query every item every loop cycle but rather store the value if read once)

 

Also for ideal income you should create your own unit of measurement for an items "worth" to pick up.

What if you have an item worth 2M that is 10 tiles away and an item worth 1M 1 tile away.

You generally want to grab the closer one if the worth of it is not too low.

This can ofc be expanded and tweaked to your liking.

Edited by House
  • Like 1
Posted
1 minute ago, House said:

This is basic java.

String.toLowerCase().equals(String.toLowerCase())

 

And to answer how you can implement picking up items with values over X,

 

You need to access a database of item values and when you find a new item on the ground which you have not stored the value of you query the value.

You then make an item filter for nearby items and filter them based on their value you got earlier.

(do NOT re-query every item every loop cycle but rather store the value if read once)

 

Also for ideal income you should create your own unit of measurement for an items "worth" to pick up.

What if you have an item worth 2M that is 10 tiles away and an item worth 1M 1 tile away.

You generally want to grab the closer one if the worth of it is not too low.

 

Ah thanks House, thought I'd attempt to look at my own script before purchasing from someone, I'll probably fail but...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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