Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package scripts.autoMerchanter;
- import org.tribot.api2007.Interfaces;
- import org.tribot.api2007.Inventory;
- import org.tribot.api2007.Player;
- import org.tribot.api2007.types.RSInterface;
- import org.tribot.api2007.types.RSItem;
- import org.tribot.api2007.types.RSTile;
- public class Check {
- public final String WAITING_MESSAGE = "Waiting for other player";
- public final String OTHER_ACCEPTED = "Other player has accepted.";
- public int buyingPrice;
- public int sellingPrice;
- public int startSellingSwitch;
- public int nextGoldAmount;
- public int totalTrades;
- public int profit = 0;
- public int exchanges = 0;
- public int itemsSold = 0;
- public int initialCoins = 0;
- public long startTime;
- public String status;
- public String currently;
- public String buyingMessage;
- public String sellingMessage;
- public String itemName;
- public String advertMessage;
- public String state;
- public String playerTraded;
- public String[] scamMessage = {
- "nope","wtf","lol kid","??", "nice",
- "almost got me lol", "You're cool dude",
- "Chenope"
- };
- public String[] successMessage = {
- "ty", "thanks", "ty:)", ":)",
- "ty dude", "tyyyy"
- };
- public RSTile originalTile;
- public Check() { }
- public String getPlayerTraded() {
- for (int l = 199; l > -1; l--) {
- RSInterface chatbox = Interfaces.get(137, 2).getChild(l);
- if (chatbox.getText().contains("wishes to trade with you.")) {
- int nameLength = chatbox.getText().length() - 26; //players name who has traded
- return chatbox.getText().substring(0, nameLength);
- }
- }
- return null;
- }
- public String getStatus() {
- return buying() ? "buying" : "selling";
- }
- public String getMessage() {
- return buying() ? buyingMessage : sellingMessage;
- }
- public boolean inTrade() {
- return Interfaces.isInterfaceValid(335) || Interfaces.isInterfaceValid(334);
- }
- public boolean inOriginalPosition() {
- return Player.getRSPlayer().getPosition().equals(originalTile);
- }
- private boolean buying() {
- //*
- /* Determines if we are buying or selling
- */
- RSItem[] coins = Inventory.find(995);
- RSItem[] itemsToSell = Inventory.find(itemName);
- return (coins.length > 0
- ? coins[0].getStack() >= buyingPrice
- && coins[0].getStack() >= startSellingSwitch : false)
- && itemsToSell.length <= 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement