Jump to content

Free and Open Source || Simple Chatting Anti-ban


kadiem

Recommended Posts

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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