Diddy 265 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
NZL 13 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)
sini 32 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.
lily 491 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 =(
Diddy 265 Author 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
lily 491 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
Diddy 265 Author 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
Recommended Posts
Archived
This topic is now archived and is closed to further replies.