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.

JavaFX

Featured Replies

I was desperately browsing stackoverflow for an answer to "this is runescape" so as not to look overwhelmed by your argument while you were editting your reply

 

your turn

 

i had lasagna for dinner

 

your turn

Edited by Tom

i had lasagna for dinner

 

your turn

i was a bad boy and got sent to my room without dinner

 

jagex turn

Static self-references in scripts oh lord.

 

What if you run multiple instances of the same script on the same JVM / bot client ? :)

 

Your turn :boge:

Edited by Botre

Static self-references in scripts oh lord.

 

What if you run multiple instances of the same script on the same JVM / bot client ? smile.png

 

Your turn boge.png

 

what does happen? I thought I would have heard more about it if it was tragic.

package com.loudpacks.gui;
import org.osbot.rs07.script.Script;

public class Settings extends JFrame {
	
	private JPanel master;
	private Consumer<Boolean> callback;

	public Settings(Script script) {
		master = new JPanel();
		setTitle("Settings");
		setSize(300, 120);
		setResizable(false);
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setLocationRelativeTo(null);
		
		
		JPanel buttonPanel = new JPanel();
		buttonPanel.setLayout(new GridLayout(1, 1, 10, 10));
		buttonPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		JButton buttonStart = new JButton("Start");
		buttonStart.addActionListener(event -> {
			callback.accept(true);
			dispose();
		});
		
		buttonPanel.setMaximumSize(new Dimension(getWidth(), 100));
		buttonPanel.add(buttonStart);
		master.add(buttonPanel);

		master.setLayout(new BoxLayout(master, BoxLayout.Y_AXIS));
		add(master);
		setVisible(true);
	}


	public void setCallback(Consumer<Boolean> callback) {
		this.callback = callback;
	}

}

package com.loudpacks.script;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;

import org.osbot.rs07.api.model.Item;
import org.osbot.rs07.script.ScriptManifest;

import com.loudpacks.api.LoudScript;
import com.loudpacks.gui.Settings;

@ScriptManifest(author = "LoudPacks", info = "", logo = "", name = "LoudCCTracker", version = 1.0)
public class main extends LoudScript {
	
	private long start = 0;
	
	public static InventoryMonitor monitor;
	
	@[member='Override']
	public void onStart() {
		Settings settings = new Settings(this);
		settings.setCallback(b -> {
			start = System.currentTimeMillis();
			//add tasks, etc it will hand here til your settings callback is set to true;
			
		});
	}

	@[member='Override']
	public void onExit() {

	}
	
	@[member='Override']
	public void onPaint(Graphics2D g){
		super.onPaint(g);
	}
	

}

Do something like this maybe.

Edited by LoudPacks

  • Author
package com.loudpacks.gui;
import org.osbot.rs07.script.Script;

public class Settings extends JFrame {
	
	private JPanel master;
	private Consumer<Boolean> callback;

	public Settings(Script script) {
		master = new JPanel();
		setTitle("Settings");
		setSize(300, 120);
		setResizable(false);
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setLocationRelativeTo(null);
		
		
		JPanel buttonPanel = new JPanel();
		buttonPanel.setLayout(new GridLayout(1, 1, 10, 10));
		buttonPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		JButton buttonStart = new JButton("Start");
		buttonStart.addActionListener(event -> {
			callback.accept(true);
			dispose();
		});
		
		buttonPanel.setMaximumSize(new Dimension(getWidth(), 100));
		buttonPanel.add(buttonStart);
		master.add(buttonPanel);

		master.setLayout(new BoxLayout(master, BoxLayout.Y_AXIS));
		add(master);
		setVisible(true);
	}


	public void setCallback(Consumer<Boolean> callback) {
		this.callback = callback;
	}

}

package com.loudpacks.script;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;

import org.osbot.rs07.api.model.Item;
import org.osbot.rs07.script.ScriptManifest;

import com.loudpacks.api.LoudScript;
import com.loudpacks.gui.Settings;

@ScriptManifest(author = "LoudPacks", info = "", logo = "", name = "LoudCCTracker", version = 1.0)
public class main extends LoudScript {
	
	private long start = 0;
	
	public static InventoryMonitor monitor;
	
	@[member='Override']
	public void onStart() {
		Settings settings = new Settings(this);
		settings.setCallback(b -> {
			start = System.currentTimeMillis();
			//add tasks, etc it will hand here til your settings callback is set to true;
			
		});
	}

	@[member='Override']
	public void onExit() {

	}
	
	@[member='Override']
	public void onPaint(Graphics2D g){
		super.onPaint(g);
	}
	

}

Do something like this maybe.

 

 

JavaFX doesn't work like that because the constructor of the Application class can't take an argument

 

JavaFX doesn't work like that because the constructor of the Application class can't take an argument

 

 

Ah, I've never used javaFX but I figured it was worth a shot.

  • Author

Ah, I've never used javaFX but I figured it was worth a shot.

 

It would make so much more sense if it could take arguments in its constructor, but noooooo

  • Author

Just so you know, because you are running JavaFX from a Swing application you don't need to extend the application class.

https://docs.oracle.com/javase/8/javafx/interoperability-tutorial/swing-fx-interoperability.htm

because you are running JavaFX from a Swing application

Swing application

Well, I wasn't doing that as far as I know. But that makes it like 20x better.

You sir, are a God.

 

happypepe.jpg

 

 

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.