TheGreatests Posted March 24, 2017 Share Posted March 24, 2017 Need some help with chat listener, looking to implement a Quote Link to comment Share on other sites More sharing options...
TheGreatests Posted March 24, 2017 Author Share Posted March 24, 2017 Also having a issue with resettin clay count! from whatever it is, to zero. ! Here is a brief look at clay acounter currentExp = skills.getExperience(Skill.MINING); expGained = currentExp - startExp; claycount = expGained / 4; Quote Link to comment Share on other sites More sharing options...
whipz Posted March 24, 2017 Share Posted March 24, 2017 public void onMessage(Message message) throws InterruptedException { if (message.getType() == Message.MessageType.GAME && message.getMessage().contains("form 4 cannonballs")) { itemsMade = itemsMade + 4; } } Quote Link to comment Share on other sites More sharing options...
Pseudo Posted March 24, 2017 Share Posted March 24, 2017 58 minutes ago, whipz said: public void onMessage(Message message) throws InterruptedException { if (message.getType() == Message.MessageType.GAME && message.getMessage().contains("form 4 cannonballs")) { itemsMade = itemsMade + 4; } } In addition make sure you're calling the message listener event on start. Quote Link to comment Share on other sites More sharing options...
TheGreatests Posted March 24, 2017 Author Share Posted March 24, 2017 4 hours ago, Pseudo said: In addition make sure you're calling the message listener event on start 5 hours ago, whipz said: public void onMessage(Message message) throws InterruptedException { if (message.getType() == Message.MessageType.GAME && message.getMessage().contains("form 4 cannonballs")) { itemsMade = itemsMade + 4; } } WHipz, what about resetting the inter value during on loop? Quote Link to comment Share on other sites More sharing options...
TheGreatests Posted March 24, 2017 Author Share Posted March 24, 2017 5 hours ago, whipz said: public void onMessage(Message message) throws InterruptedException { if (message.getType() == Message.MessageType.GAME && message.getMessage().contains("form 4 cannonballs")) { itemsMade = itemsMade + 4; } } whats ur skype Whipz? Quote Link to comment Share on other sites More sharing options...
TheGreatests Posted March 24, 2017 Author Share Posted March 24, 2017 5 hours ago, Pseudo said: In addition make sure you're calling the message listener event on start. How so? Still need help with the on message method. How do I fully implement it, and somehow I keep getting syntax errors like ) is missing. Quote Link to comment Share on other sites More sharing options...
Pseudo Posted March 24, 2017 Share Posted March 24, 2017 onStart getBot().addMessageListener(this); Quote Link to comment Share on other sites More sharing options...
TheGreatests Posted March 24, 2017 Author Share Posted March 24, 2017 1 minute ago, Pseudo said: onStart getBot().addMessageListener(this); Ok, I called it. I am trying to implement this into a way that my muler will get a text from my miner, and hop to that world to trade with my miner. Do you have some extra time? My Skype is Elvis.basic3 if you wanna do a good deed just show me exactly how to implement it, in a good manner. I'm also having issues resetting my clay counter variable!. Like I called onpaint, and then onstart and it'll count my clay up until I need to trade, however after that, I cant get it to reset. ive tried assigning that value down to 0 again but it still wont? Quote Link to comment Share on other sites More sharing options...
TheGreatests Posted March 24, 2017 Author Share Posted March 24, 2017 Well, I keep getting a syntax error for this method. I am not entirely sure why, I tried everything with it - if(message.getType() == Message.MessageType.GAME && message.getMessage().contains("form 4 cannonballs"))) { } } Still giving me syntax error.. somebody help if you got time! Also having a issue with resetting my clay count variable still. I've tried everything, from Claycount = 0; to other things with no results! Quote Link to comment Share on other sites More sharing options...
Pseudo Posted March 24, 2017 Share Posted March 24, 2017 21 minutes ago, TheGreatests said: Ok, I called it. I am trying to implement this into a way that my muler will get a text from my miner, and hop to that world to trade with my miner. Do you have some extra time? My Skype is Elvis.basic3 if you wanna do a good deed just show me exactly how to implement it, in a good manner. I'm also having issues resetting my clay counter variable!. Like I called onpaint, and then onstart and it'll count my clay up until I need to trade, however after that, I cant get it to reset. ive tried assigning that value down to 0 again but it still wont? I'll add you now but I'm heading away for ~20 minutes or so, will sort you out when I return. Quote Link to comment Share on other sites More sharing options...
TheGreatests Posted March 24, 2017 Author Share Posted March 24, 2017 Just now, Pseudo said: I'll add you now but I'm heading away for ~20 minutes or so, will sort you out when I return. ok sounds good! tyvm Quote Link to comment Share on other sites More sharing options...
Explv Posted March 24, 2017 Share Posted March 24, 2017 40 minutes ago, Pseudo said: onStart getBot().addMessageListener(this); 37 minutes ago, TheGreatests said: Ok, I called it. I am trying to implement this into a way that my muler will get a text from my miner, and hop to that world to trade with my miner. If you are overriding onMessage, you do not then need to call getBot().addMessageListener(this). You will just end up having two message listeners. Quote Do you have some extra time? My Skype is Elvis.basic3 if you wanna do a good deed just show me exactly how to implement it, in a good manner. I'm also having issues resetting my clay counter variable!. Like I called onpaint, and then onstart and it'll count my clay up until I need to trade, however after that, I cant get it to reset. ive tried assigning that value down to 0 again but it still wont? Consider learning Java before trying to write scripts, simply asking other people to write things for you is not going to help you in the long run: 28 minutes ago, TheGreatests said: Well, I keep getting a syntax error for this method. I am not entirely sure why, I tried everything with it - if(message.getType() == Message.MessageType.GAME && message.getMessage().contains("form 4 cannonballs"))) { } } Still giving me syntax error.. somebody help if you got time! Also having a issue with resetting my clay count variable still. I've tried everything, from Claycount = 0; to other things with no results! You have an extra closing bracket.. 3 Quote Link to comment Share on other sites More sharing options...
Chris Posted March 24, 2017 Share Posted March 24, 2017 2 minutes ago, Explv said: If you are overriding onMessage, you do not then need to call getBot().addMessageListener(this). You will just end up having two message listeners. Consider learning Java before trying to write scripts, simply asking other people to write things for you is not going to help you in the long run: You have an extra closing bracket.. u right Quote Link to comment Share on other sites More sharing options...
whipz Posted March 24, 2017 Share Posted March 24, 2017 3 hours ago, TheGreatests said: WHipz, what about resetting the inter value during on loop? thats simple after you have done your trade to mules do clay = 0; in that method public void onMessage(Message message) throws InterruptedException { if (message.getType() == Message.MessageType.GAME && message.getMessage().contains("form 4 cannonballs")) { itemsMade = itemsMade + 4; } } Quote Link to comment Share on other sites More sharing options...