Jump to content

Script help - Items


Pogba

Recommended Posts

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
Link to comment
Share on other sites

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...

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...