Jump to content

Free and Open Source || Simple Chatting Anti-ban


Recommended Posts

Posted (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:D

Edited by kadiem

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...