Tiger233 Posted April 17, 2014 Share Posted April 17, 2014 Hey guys, recently started scripting for OsBot. I was wondering how I would make it so that my player, after attacking a cow, will wait until the cow is dead, to loot an item, then find the next cow. Currently, what will happen is this: My character finds a cow1, My character kills the cow1, My character moves onto another cow2, then the last cows1 items pop up, and he cancels his attacking on the new cow2 to grab old cows1 items. I want: Player fight and kills cow1. Loots cow1 Fights cow2. Loots cow2, etc. Sorry if it is unclear, and thanks in advance. If you need SRC code let me know! Link to comment Share on other sites More sharing options...
thepecher Posted April 17, 2014 Share Posted April 17, 2014 Sleep with a loop until cow 1 is dead then execute looting code, repeat Link to comment Share on other sites More sharing options...
YinZ Posted April 17, 2014 Share Posted April 17, 2014 What I do is get the animation of the cow. If the cows animation is death then it goes into the looting switchblock and loots before moving on Link to comment Share on other sites More sharing options...
Tiger233 Posted April 17, 2014 Author Share Posted April 17, 2014 Okay will try the cow animation loop. Thanks guys! Link to comment Share on other sites More sharing options...
FearMe Posted April 18, 2014 Share Posted April 18, 2014 What I do is get the animation of the cow. If the cows animation is death then it goes into the looting switchblock and loots before moving on You can also check if the cow's health is 0%, it's more reliable(if the animations ever change you have to change the code for it, now I know this doesn't happen often but there's no point using animation). Link to comment Share on other sites More sharing options...
Swizzbeat Posted April 18, 2014 Share Posted April 18, 2014 Check if #getFacing() is null. Link to comment Share on other sites More sharing options...
FearMe Posted April 18, 2014 Share Posted April 18, 2014 Check if #getFacing() is null. It isn't null though, since the cow is still doing it's dying animation. Link to comment Share on other sites More sharing options...
Swizzbeat Posted April 18, 2014 Share Posted April 18, 2014 It isn't null though, since the cow is still doing it's dying animation. Which (if I remember correctly) appears as null :p Link to comment Share on other sites More sharing options...