Diddy 265 Share Posted November 14, 2015 Hi guys I'm currently making a hill giant script and I incounter a few bugs. So first problem is that it takes a while until the bot realises it's not longer in combat. I remember though that others complaned about the simplicity of getLocalPlayer().isInCombat() , but is there a way around this? If so pls share ;p My other problem I have is with picking up loot. It sometimes tries to pick up the same loot twice when it already disapeared. I don't just want to add a sleep of 5mins and I can't think of a proper sleepUntil. All help is appreciated Link to comment Share on other sites More sharing options...
NZL 13 Share Posted November 14, 2015 Hi guys I'm currently making a hill giant script and I incounter a few bugs. So first problem is that it takes a while until the bot realises it's not longer in combat. I remember though that others complaned about the simplicity of getLocalPlayer().isInCombat() , but is there a way around this? If so pls share ;p My other problem I have is with picking up loot. It sometimes tries to pick up the same loot twice when it already disapeared. I don't just want to add a sleep of 5mins and I can't think of a proper sleepUntil. All help is appreciated maybe pick up item then set the item object = null right afterwards or sleepuntil(s.getinventory.count(itemid) > oldcount) Link to comment Share on other sites More sharing options...
sini 32 Share Posted November 14, 2015 It's best to try and create triggers for a state machine. Combat is triggered by animations, specifically animations for the weapon you have equipped. Or, the animations of a target that you current are facing or is facing you. As for ground items, there might be a bit of a different of time from when you pick an item up and from when it vanishes from the floor. Most of the time you have to execute actions over and over again until the trigger is met or completely try and complete the action again. So say, to reach S1 from S0 you must meat C0. Execute S0 until C0 is met, or wait X amount of time until C0 is met and if C0 is not met then execute S0 again. Link to comment Share on other sites More sharing options...
lily 490 Share Posted November 14, 2015 The best workaround for the isInCombat() method sucking is checking if npcs are interacting and facing a target. (You can also do animations as Sini noted, it might actually be more accurate in the longrun) Can't say I've run into that issue with looting so I can't be much help, sorry =( Link to comment Share on other sites More sharing options...
Diddy 265 Author Share Posted November 14, 2015 The best workaround for the isInCombat() method sucking is checking if npcs are interacting and facing a target. (You can also do animations as Sini noted, it might actually be more accurate in the longrun) Can't say I've run into that issue with looting so I can't be much help, sorry =( looting seems to be fixed with just checking if player is moving or not Link to comment Share on other sites More sharing options...
lily 490 Share Posted November 14, 2015 Oooh! Yeah that'll do it! I think I actually did do that before and totally forgot until just now lol, sorry Link to comment Share on other sites More sharing options...
Nuclear Nezz 2012 Share Posted November 15, 2015 wait what's wrong with isInCombat ._. Link to comment Share on other sites More sharing options...
Diddy 265 Author Share Posted November 15, 2015 wait what's wrong with isInCombat ._. it waits until the mob is down and the localplayer his health bar is gone so it's almost a minute delay Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.