Jump to content

Trade API


TheScrub

Recommended Posts

just updated!

 

 

 

The Trade class

  Reveal hidden contents

 

TradeItem Class:

 

  Reveal hidden contents

 

 

 

Example useage;

  Reveal hidden contents

 

Edited by TheScrub
  • Like 1
Link to comment
Share on other sites

  On 11/25/2013 at 7:55 AM, TheScrub said:

 

  On 11/25/2013 at 7:50 AM, Mr Asshole said:

Stark is going to need this o.o

 

if you read the terms and conditions you may not use my code for any premium scripts..

 

do not be talking smack mr asshole

 

Problem is that you won't know if anyone uses it or not xd

 

Anyway, some notes:

public static int mytradescreen = 48;

use correct java naming conventions, if you are coding for yourself I wuldn't give a fuck, but if you are trying to write modular code api/library you need to use conventions or people will have a hard time understanding the code.

private Script script = Context.script;

Don't use static for the sake of god. You are supposed to use oop with osbot, if you use static the vars will be "shared" to all tabs withing the client. You should init this class with a Script argument instead.

	public Item[] getItems(int screen) throws InterruptedException {
		ArrayList<Item> array = new ArrayList<Item>();
		if (tradeScreenOpen()) {
			Item[] itemArray = Context.script.client.getInterface(335)
					.getItems(screen);
			for (Item i : itemArray) {
				if (i != null)
					array.add(i);
			}

		}
		return array.toArray(new Item[array.size()]);
	}

?????

getFirstScreenItemByInteger

*ById maybe

	public static int ourSecondScreen = 37;
	public static int otherPersonSecondScreen = 40;

There are 4 more childs for second screen messages

 

 

Only good thing worth mnetioning is the getItemsSecondaryScreen method that seems very clever

Link to comment
Share on other sites

  On 11/25/2013 at 11:23 AM, XavierM said:

 

  On 11/25/2013 at 7:55 AM, TheScrub said:

 

  On 11/25/2013 at 7:50 AM, Mr Asshole said:

Stark is going to need this o.o

 

if you read the terms and conditions you may not use my code for any premium scripts..

 

do not be talking smack mr asshole

 

Problem is that you won't know if anyone uses it or not xd

 

Anyway, some notes:

public static int mytradescreen = 48;

use correct java naming conventions, if you are coding for yourself I wuldn't give a fuck, but if you are trying to write modular code api/library you need to use conventions or people will have a hard time understanding the code.

private Script script = Context.script;

Don't use static for the sake of god. You are supposed to use oop with osbot, if you use static the vars will be "shared" to all tabs withing the client. You should init this class with a Script argument instead.

	public Item[] getItems(int screen) throws InterruptedException {
		ArrayList<Item> array = new ArrayList<Item>();
		if (tradeScreenOpen()) {
			Item[] itemArray = Context.script.client.getInterface(335)
					.getItems(screen);
			for (Item i : itemArray) {
				if (i != null)
					array.add(i);
			}

		}
		return array.toArray(new Item[array.size()]);
	}

?????

getFirstScreenItemByInteger

*ById maybe

	public static int ourSecondScreen = 37;
	public static int otherPersonSecondScreen = 40;

There are 4 more childs for second screen messages

 

 

Only good thing worth mnetioning is the getItemsSecondaryScreen method that seems very clever

 

 

thanks for the constructive feedback instead of the usual nice good work or i might use this

Link to comment
Share on other sites

  On 11/25/2013 at 9:16 PM, Stark said:

 

  On 11/25/2013 at 7:50 AM, Mr Asshole said:

Stark is going to need this o.o

Except my script has been complete for almost a week now, before this post was made. It's been pending in SDN upload requests for 5 days.

 

 

Please no Trolling/Flaming on thread both of you two idc about this crap i'm here to code and to improve my java knowledge!

 

 

(I know stark your defending yourself but just don't reply to him look at his name...)

Link to comment
Share on other sites

  On 11/28/2013 at 11:21 PM, zScripz said:

Hi scrub, you might be interested in this method:

http://osbot.org/api/org/osbot/script/MethodProvider.html#stripFomatting%28java.lang.String%29

 

This is what I used in my personal API.

 

lol gg me... but i guess the good thing about mine is it's not api dependent to osbot

Link to comment
Share on other sites

  On 11/29/2013 at 2:14 AM, TheScrub said:

 

  On 11/28/2013 at 11:21 PM, zScripz said:

Hi scrub, you might be interested in this method:

http://osbot.org/api/org/osbot/script/MethodProvider.html#stripFomatting%28java.lang.String%29

 

This is what I used in my personal API.

 

lol gg me... but i guess the good thing about mine is it's not api dependent to osbot

 

 

Lol yea, that is valuable.. and knowledge is the most important tbh :P

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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