Jump to content

Looting Ideas


Paddy299

Recommended Posts

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

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.

Link to comment
Share on other sites

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