kadiem Posted August 16, 2017 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