Skip to content

codex #dreambot

import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import com.dreambot.api.methods.Calculations;
import com.dreambot.api.methods.Game;
import com.dreambot.api.methods.Inventory;
import com.dreambot.api.methods.Walking;
import com.dreambot.api.methods.interactive.Players;
import com.dreambot.api.methods.interactive.NPCs;
import com.dreambot.api.methods.interactive.Shop;
import com.dreambot.api.methods.interactive.Interfaces;
import com.dreambot.api.methods.tab.Inventory;
import com.dreambot.api.methods.tab.Skills;
import com.dreambot.api.wrappers.Tile;
import com.dreambot.api.wrappers.interactive.NPC;
import com.dreambot.api.wrappers.interactive.Player;
import com.dreambot.api.wrappers.items.Item;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String username = "";
        String password = "";
        String host = "";
        int port = 43594;

        System.out.println("Enter your username: ");
        username = in.nextLine();
        System.out.println("Enter your password: ");
        password = in.nextLine();
        System.out.println("Enter your host: ");
        host = in.nextLine();
        System.out.println("Enter your port: ");
        port = in.nextInt();

        Game.setHost(host, port);
        Game.login(username, password);

        while(!Game.isLoggedIn()) {
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

        while(Game.isLoggedIn()) {
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

        System.out.println("Logged out");

    }

}

Last update: November 18, 2023
Created: October 12, 2023