kadiem Posted August 16, 2017 Share Posted August 16, 2017 (edited) Hello everyone, I'm releasing my second script (actually it's like mini-script), as the name says it chats with other people. Source: private Dialogue Dialogue; boolean said; int Index; private void Respond() throws InterruptedException { //Message sending method if(said == true){ sleep(random(2000,4500)); Dialogue = new Dialogue(); List<String> RespondSpeach = Dialogue.getNumberList1(); keyboard.typeString(RespondSpeach.get(Index) , true); said = false; } } public void onMessage(Message m) throws InterruptedException { //Message recieveing method Dialogue = new Dialogue(); List<String> ReceivedSpeach = Dialogue.getNumberList(); for (String word : ReceivedSpeach){ if (m.getMessage().contains(word)){ Index = ReceivedSpeach.indexOf(word); said = true; } } } and here is the dialogue class: Spoiler package Chatter; import java.util.ArrayList; import java.util.List; public class Dialogue { private List<String> ReceivedSpeach; private List<String> RespondSpeach; public ArrayList<String> getNumberList() { //Messages to receive ReceivedSpeach = new ArrayList<String>(); ReceivedSpeach.add(0, "Hello"); ReceivedSpeach.add(1, "Finally someone who is not a bot"); return (ArrayList<String>) ReceivedSpeach; } public ArrayList<String> getNumberList1() { //Messages to send RespondSpeach = new ArrayList<String>(); RespondSpeach.add(0, "Hi"); RespondSpeach.add(1, "Lol" +System.lineSeparator()+ "Yh bots are literally everywhere is osrs"); return (ArrayList<String>) RespondSpeach; } } Hope that some people find it useful Edited August 18, 2017 by kadiem Quote Link to comment Share on other sites More sharing options...
kul782 Posted August 24, 2017 Share Posted August 24, 2017 Cool nice release Quote Link to comment Share on other sites More sharing options...
Coolst0rybr0 Posted August 29, 2017 Share Posted August 29, 2017 nice bro Quote Link to comment Share on other sites More sharing options...