kamilo 7 Share Posted May 7, 2020 Encountered this wierd glitch it was fucking up my script, then went ahead and de-bugged the method and found problems in that so, when a player 'sends a trade' to another player; i.e. message in chatbox appears 'sending trade offer' the boolean getLocalPlayer().isInCombat() becomes true for a bit then becomes false? lmfao can't believe this is even a thing please fix Link to comment Share on other sites More sharing options...
kamilo 7 Author Share Posted May 7, 2020 When the trade is open it sets to false again, i've noticed it only turns to true momentarily after the message 'Sending trade offer..." appears in the Game Messages. Link to comment Share on other sites More sharing options...
Lyuda 10 Share Posted May 7, 2020 😕 unfortunate, although for now, I can think of some ways around this. One would be to check for the combat time to negate the short incombat status you referred to like so. if (getLocalPlayer().getCombatTime() > x && getLocalPlayer().isInCombat()) { } or just simply check if the trade window is open in case the problem is that your player is incombat whilst trading. if (getLocalPlayer().isInCombat() && !getTrade().isOpen()) { } or in case its just the message that procs isInCombat to be true use the advanced message listener described in this thread: Link to comment Share on other sites More sharing options...
kamilo 7 Author Share Posted May 7, 2020 51 minutes ago, Lyuda said: 😕 unfortunate, although for now, I can think of some ways around this. One would be to check for the combat time to negate the short incombat status you referred to like so. if (getLocalPlayer().getCombatTime() > x && getLocalPlayer().isInCombat()) { } or just simply check if the trade window is open in case the problem is that your player is incombat whilst trading. if (getLocalPlayer().isInCombat() && !getTrade().isOpen()) { } or in case its just the message that procs isInCombat to be true use the advanced message listener described in this thread: naw it appears when you trade someone, it sets to false when the trade it open so when my character clicks trade with, message appears in chat 'sending trade offer...' that triggers the boolean to set true it doesn't affect the person accepting the trade, althoughi think when you accept the trade offer through the game messages, the sending trade offer message also appears and triggers the boolean again. so would probably have to listen to game message and do if (isInCombat() && !getMessage.contains("Sending trade offer...")) Link to comment Share on other sites More sharing options...
Lyuda 10 Share Posted May 7, 2020 1 minute ago, kamilo said: naw it appears when you trade someone, it sets to false when the trade it open so when my character clicks trade with, message appears in chat 'sending trade offer...' that triggers the boolean to set true it doesn't affect the person accepting the trade, althoughi think when you accept the trade offer through the game messages, the sending trade offer message also appears and triggers the boolean again. so would probably have to listen to game message and do if (isInCombat() && !getMessage.contains("Sending trade offer...")) Yeah, in that case the only solution I can think of is to use the message listener. Someone is making a muling script 😜 Link to comment Share on other sites More sharing options...
kamilo 7 Author Share Posted May 7, 2020 25 minutes ago, Lyuda said: Yeah, in that case the only solution I can think of is to use the message listener. Someone is making a muling script 😜 Link to comment Share on other sites More sharing options...
Pseudo 179 Share Posted May 7, 2020 I'd imagine it's due to isInCombat incorporating isInteracting which is true when you're attempting to trade with somebody. Link to comment Share on other sites More sharing options...
Nuclear Nezz 2061 Share Posted May 10, 2020 As Pseudo said, we check against isInteracting on some cases, because combat timer (if I'm remembering correctly) goes off of you being hit, not you hitting something else. So for instance, safespotting, we can't check strict combat based variables. I can't think of very many instances where you're going to need a distinct "trade but do something else if I'm in combat between the point of me interacting and me opening the trade window" so it's not really a bug I'm overly concerned about. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.