July 25, 20178 yr 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 July 25, 20178 yr by mylo
July 25, 20178 yr 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?
July 25, 20178 yr 56 minutes ago, mylo said: Damn so there is no way to connect to irc then? I suppose not
Create an account or sign in to comment