Jump to content

Animation resets


todamach

Recommended Posts

if (!myPlayer().isAnimating()) {
   if (!myPlayer().isMoving()) {
      // click
   }
}

it will still click every animation reset. How can i fix this?

 

 

 

What are you trying to do? Do you not understand the code here, or what is the issue? With those two conditional statements, any time that your player is not doing anything, and not moving, that //click code will execute. What are you wanting it to do? Let me know so I can help you out. ^_^

Link to comment
Share on other sites

While (animating) {

sleep for the duration of one animation cycle;

}


e75ae6cae5a1e649c4c931b2e6b76398.png

 

The time of a full cycle will always be a multiple of 600 (in ms).

 

Another way of doing it would be to start a timer once you are not animating anymore, and if this timer exceeds the animation rest time -> re-click rock.

Edited by Botrepreneur
Link to comment
Share on other sites

Thanks for such informative answer. I don't think sleeping for a full cycle is an option, because mining animation is probobly close to 6 seconds, so it way too long to sleep.

 

I'll try to do the timer thing.

 

Also, what I was doing myself, but for some reason it doesn't work right for me:

while(ore.exists(){
  sleep(150);
}

So basically, it should be stuck in this loop while ore exists, but for some reason it exits after about 10 seconds. 

Link to comment
Share on other sites

Thanks for such informative answer. I don't think sleeping for a full cycle is an option, because mining animation is probobly close to 6 seconds, so it way too long to sleep.

 

I'll try to do the timer thing.

 

Also, what I was doing myself, but for some reason it doesn't work right for me:

while(ore.exists(){
  sleep(150);
}

So basically, it should be stuck in this loop while ore exists, but for some reason it exits after about 10 seconds. 

 

If you stay near the object in question it shouldn't cease existing.

Objects change reference when the game reloads (walking away to far / logging out) unless you use their unique hash value as explained by Laz here: http://osbot.org/forum/topic/54215-object-reference-becomes-irrelevant-when-reloading-how-to/

 

Or is the object you are trying to mine dynamic ? Does it have multiple states? In that case you might need to revisit its declaration.

Link to comment
Share on other sites

Well, I'm mining it, so I'm standing in front of it. Not sure what dynamic or multiple states exactly is, but I don't think so.

 

I'm mining Pay-dirt from Ore veins in motherlode. When ore veins are mined (depleted) it changes to other object with different id. So, I think, that's where my loop should exit. But it constantly exits even if ore vein is still there - not depleted, not changed to other object.

Link to comment
Share on other sites

Well, I'm mining it, so I'm standing in front of it. Not sure what dynamic or multiple states exactly is, but I don't think so.

 

I'm mining Pay-dirt from Ore veins in motherlode. When ore veins are mined (depleted) it changes to other object with different id. So, I think, that's where my loop should exit. But it constantly exits even if ore vein is still there - not depleted, not changed to other object.

 

So what you are saying is that when you do the mining animation, then it stops for a second between animations, and the script clicks the rock again even though it doesnt need to click the rock because you are still mining correct?

Link to comment
Share on other sites

Well, I'm mining it, so I'm standing in front of it. Not sure what dynamic or multiple states exactly is, but I don't think so.

 

I'm mining Pay-dirt from Ore veins in motherlode. When ore veins are mined (depleted) it changes to other object with different id. So, I think, that's where my loop should exit. But it constantly exits even if ore vein is still there - not depleted, not changed to other object.

 

Motherlode ore veins are dynamic / have multiple states.

Get its depleted id or model and use that reference to check if the vein is depleted instead (the depleted state, contrary to the undepleted state, is static).

Link to comment
Share on other sites

Motherlode ore veins are dynamic / have multiple states.

Get its depleted id or model and use that reference to check if the vein is depleted instead (the depleted state, contrary to the undepleted state, is static).

 

Thanks. This will make my script run much smoother. I'll try to implement it tomorrow (today..... -.-), because it's very late (early -.-) now. I hope you won't mind if I will PM you with a question or two.

Link to comment
Share on other sites

Thanks. This will make my script run much smoother. I'll try to implement it tomorrow (today..... -.-), because it's very late (early -.-) now. I hope you won't mind if I will PM you with a question or two.

  1. use a timer class
  2. determine how long the sleep is between the two animation.
  3. create two if statements.
  4. If your not animating, then mine.
  5. if your animating. create a new methods
  6. within the methos, create a while loop,
  7. check the timer, and see if it has passed the time between animation.
  8. within the while loop, add a if statement, is animating
  9. if its true just reset the timer.
Link to comment
Share on other sites

 

  1. use a timer class
  2. determine how long the sleep is between the two animation.
  3. create two if statements.
  4. If your not animating, then mine.
  5. if your animating. create a new methods
  6. within the methos, create a while loop,
  7. check the timer, and see if it has passed the time between animation.
  8. within the while loop, add a if statement, is animating
  9. if its true just reset the timer.

 

 

What if someone else gets the last ore, and you are left animating at the depleted one? 

Link to comment
Share on other sites

You can also keep checking the ore you are mining,

 

so while the ore isn't mined, don't interact with it.

I guess there a lot of ways to fix this smile.png

 

Apparently, ores I try to mine are dynamic/has multiple states. So this method doesn't quite work.

 

 Botrepreneur suggested to track it's depleted model/id instead. I'll try that in the evening today. I'll be busy all day.

Link to comment
Share on other sites

Apparently, ores I try to mine are dynamic/has multiple states. So this method doesn't quite work.

 

 Botrepreneur suggested to track it's depleted model/id instead. I'll try that in the evening today. I'll be busy all day.

 

Ya you could use the modelID's ... just check out the different options :D

What ores are u trying to mine?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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