Jump to content

[Stable] OSBot 2.4.50 (BMG) - Widget Debugger, Script Analyzer, Bug Fixes


Alek

Recommended Posts

You can still just cache a text file with a unique key generated by you to track anonymously-ish.

getUsername() didn't map to the forum username anyways I think tongue.png

 

isMirrorMode

 

isVIP

 

deprecated sad.png

 

and yes getUsername() only returned "-username" exactly, but it's meant to be the forum login name.

 

Caching these values is a separate process from obtaining them. The obtaining methods, the 2 I'm most interested: isVIP isMirrorMode are deprecated now sad.png. Caching values is useless if you can't obtain them in the first place to cache them so I'm not sure what you are talking about.

Edited by DragonAlpha
Link to comment

isMirrorMode

 

isVIP

 

deprecated sad.png

 

and yes getUsername() only returned "-username" exactly, but it's meant to be the forum login name.

 

Caching these values is a separate process from obtaining them. The obtaining methods, the 2 I'm most interested: isVIP isMirrorMode are deprecated now sad.png. Caching values is useless if you can't obtain them in the first place to cache them so I'm not sure what you are talking about.

 

I was talking about tracking data for dynamic sigs and stuff like that.

 

isVIP... meh.

isMirror... sucks it's gone :/

Link to comment

I'm working on something that might be of interest: JObjectTable.

 

I've used a combination of Reflection, Annotations and Swing components to enhance the JTable and DefaultTableModel and make it simpler to implement views for object instances. The reflection allows for both the getting and setting of variables and the annotations define the parameters of the JTable.

 

beta_zpsupudgjmq.png

 

Implementation:

 

Main.java

public class Main extends JFrame {
	
	public static void main(String[] args) {
		
		JObjectTable<Animal> table = new JObjectTable<>(Animal.class);
		
		table.addValue(new Animal("Muddy", Animal.Type.CAT, 10, 10.99, "CatShop"));
		table.addValue(new Animal("Tip", Animal.Type.BIRD, 8, 59.99, "Beaks"));
		table.addValue(new Animal("Big Blue", Animal.Type.ELEPHANT, 7, 1092.00, "Exotic Now!"));
		table.addValue(new Animal("Bubbles", Animal.Type.FISH, 5, 5.10, "ShopCo"));
		table.addValue(new Animal("Cookie", Animal.Type.CAT, 12, 12.50, "ShopCo"));
		table.addValue(new Animal("Tag", Animal.Type.DOG, 15, 15.90, "ShopCo"));
		
		JFrame frame = new JFrame();
		
		frame.setTitle("Animals!");
		frame.setSize(512, 512);
		frame.setLocationRelativeTo(frame.getOwner());
		frame.setLayout(new BorderLayout());
		frame.add(table.getTableHeader(), BorderLayout.NORTH);
		frame.add(new JScrollPane(table), BorderLayout.CENTER);
                frame.setVisible(true);
		
	}

} 

 

Animal.java

public class Animal {
	
	public static final String TO_STRING_FORMAT = "{id=%s, name=%s, type=%s, age=%s}";
	
	private static int count = 0;
	
	@ColumnAttribute(index = 1, name = "ID", editable = false, nullable = false, unique = true)
	private final Integer id;
	@ColumnAttribute(index = 2, name = "Name", editable = true, nullable = false, unique = false)
	private String name;
	@ColumnAttribute(index = 3, name = "Type", editable = true, nullable = true, unique = false)
	private Type type;
	@ColumnAttribute(index = 4, name = "Age", editable = true, nullable = false, unique = false)
	private Integer age;
	@ColumnAttribute(index = 5, name = "Something", editable = true, nullable = false, unique = false)
	private Recipt recipt;

	public Animal(String name, Type type, Integer age, Double price, String company) {
		super();
		this.id = (count++);
		this.name = name;
		this.type = type;
		this.age = age;
		this.recipt = new Recipt(price, company);
	}
	
	@Override
	public String toString() {
		return String.format(TO_STRING_FORMAT, id, name, type, age);
	}

	public static enum Type { CAT, DOG, FISH, BIRD, ELEPHANT; }
} 

 

Recipt.java

public class Recipt {

	public static final String TO_STRING_FORMAT = "{id=%s, price=%s, company=%s}";
	
	private static int count;
	
	@ColumnAttribute(index = 0, name = "ID", editable = false, nullable = false, unique = true)
	private final Integer id;
	@ColumnAttribute(index = 2, name = "Price", editable = true, nullable = true, unique = false)
	private Double price;
	@ColumnAttribute(index = 1, name = "Company", editable = true, nullable = false, unique = false)
	private String company;
	
	public Recipt(double price, String company) {
		
		this.id = (count++);
		
		this.price = price;
		this.company = company;
	}
	
	@Override
	public String toString() {
		return String.format(TO_STRING_FORMAT, id, price, company);
	}
	
	public int getId() {
		return id;
	}
	
	public double getPrice() {
		return price;
	}
	
	public String getCompany() {
		return company;
	}
	
} 

 

I'm implementing editors to handle all data types. Primitive data is not yet supported, and If the data type is an object, the rendering results in a button which'll open up a new window with the properties of that object. If the object type is enum then there'll be a combo box, etc.

 

It might be something useful for Widgets. smile.png

Edited by liverare
  • Like 1
Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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