Jump to content

Looting Ideas


Recommended Posts

Posted (edited)

Hi Guys!

 

I'm just making a personal fighting script.

 

I want it to loot items by name that is stored in an array.

 

What are your ideas in doing this task. for example you don't want the script to constantly be looting in areas such as the chicken farm because there is much loot to be had there.

 

I thought about creating a timer method so it will only loot for a certain amount of time and not loot again for say 5 minutes.

 

How would you tackle this task!?

Edited by Paddy299
Posted

Hi Guys!

 

I'm just making a personal fighting script.

 

I want it to loot items by name that is stored in an array.

 

What are your ideas in doing this task. for example you don't want the script to constantly be looting in areas such as the chicken farm because there is much loot to be had there.

 

I thought about creating a timer method so it will only loot for a certain amount of time and not loot again for say 5 minutes.

 

How would you tackle this task!?

 

might want it to do it in the downtime between monsters killed when it's finding another monster to attack.

 

if you want to combine that with your idea, you'd set a variable equal to the current time (once again, when it's finding another monster) and update it each time that you picked up an item. but before picking up an item, you'd make a check too see that the difference between the current time and last pick up time was 5 seconds (or whatever time you want to use). if you need any help, feel free to hit me up because i already know what i'd use to make this.

Posted (edited)

Think about your problem more.

 

You say:

 

 

for example you don't want the script to constantly be looting in areas such as the chicken farm because there is much loot to be had there.

 

OK. So think about the conditions which should be true before you begin looting.

 

Time based is almost certainty not how you should approach the problem, but it's easy enough to implement (pseudocode):

long nextScheduledTime

func scheduler(someDuration, currentSystemTime):
    return someDuration + currentSystemTime

onStart:
    nextScheduledTime = scheduler(args...)

onLoop:
    if currentSystemTime > nextScheduledTime:
       nextScheduledTime = scheduler(args...)
       <suite>
Edited by Solzhenitsyn

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