Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Connecting to irc using PircBotX

Featured Replies

package com.bot.worldscouter;

import org.osbot.rs07.api.def.ItemDefinition;
import org.osbot.rs07.api.model.Player;
import org.osbot.rs07.script.Script;

import org.osbot.rs07.script.ScriptManifest;
import org.pircbotx.Configuration;
import org.pircbotx.Configuration.Builder;
import org.pircbotx.PircBotX;
import org.pircbotx.exception.IrcException;

import java.awt.*;
import java.io.IOException;
import java.util.*;
import java.util.List;

@ScriptManifest(
        name = "WorldScouter",
        author = "ShootMyFruit",
        version = 1.00,
        info = "",
        logo = ""
)

public class WorldScouter extends Script {

    Configuration config = (new Builder())
            .setName("MyExampleBot")
            .setAutoNickChange(true)
            .addAutoJoinChannel("#workworkwork")
            .buildForServer("irc.swiftirc.net");

    PircBotX swiftBot =  new PircBotX(config);;


    public void onStart() {
       log("hello");

        try {
            swiftBot.startBot();
        } catch (IOException var2) {
            log("a");
            var2.printStackTrace();
        } catch (IrcException var3) {
            log("b");
            var3.printStackTrace();
        }
        log("hello");

    }

    public void onExit() {
        log("thank you for using the scouter");
        swiftBot.close();
    }

    public int onLoop() {
        java.util.List<Player> playersList = players.getAll();
        java.util.List<String> capeList = new ArrayList();
        List<String> capeCount = new ArrayList();

        for(Player player : playersList){
            int[] equipment = player.getDefinition().getAppearance();
            if (equipment[1] - 512 > 0) {
                capeList.add(ItemDefinition.forId(equipment[1] - 512).getName());
            }
        }

        Set<String> printed = new HashSet();

        for(String s : capeList) {
            if (printed.add(s)) {
                capeCount.add(s + ": " + Collections.frequency(capeList, s));
            }
        }

        this.log(worlds.getCurrentWorld() + " " + capeCount);
        return 1000;
    }

    public void onPaint(Graphics2D g) {
    }

}

This is my current code it runs all the os bot logic but never connects to the irc channel. And from reading the PircBotx docs it looks like it should connect with what I've written. Any ideas?

Edited by mylo

  • Author
2 minutes ago, Eagle Scripts said:

OSBot doesn't allow any direct external connections.

Damn so there is no way to connect to irc then?

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.