Thread: [PI] Grand Exchange Base Release

Page 1 of 11 123 ... LastLast
Results 1 to 10 of 104
  1. #1 [PI] Grand Exchange Base Release 
    Banned
    Join Date
    Dec 2011
    Posts
    8
    Thanks given
    0
    Thanks received
    17
    Rep Power
    0
    Hey,
    I decided to release this to r-s, since I learned a lot from everyone here.
    Please Note: This is a base and there are bugs which need to be fixed. This also requires SQL WITH remote sql connection or a SQL server on your host computer.


    Let's do client sided first:

    Spoiler for RSInterface.java:

    Not the best Interface but here you go:
    Sprites:
    Download Loyalty.rar @ UppIT
    AND
    Download Grand.Exchange.rar @ UppIT

    Add:
    Code:
    public static void MainGE(RSFont[] TDA) {
            //int c = 15651;
            RSInterface tab = addTabInterface(15651);
            addSprite(15652, 1, "Interfaces/GrandExchange/Main");
            addButton(15653, 0, "Interfaces/GrandExchange/BuyBut", "Buy Something from the Grand Exchange");
            addButton(15654, 0, "Interfaces/GrandExchange/SellBut", "Sell Something to the Grand Exchange");
            addHoverButton(15655, "Interfaces/Loyalty/BUTTON", 1, 64, 30, "View what you are buying", -1, 15656, 1);
            addHoveredButton(15656, "Interfaces/Loyalty/BUTTON", 2, 64, 30, 15657);
            addText(15658, "B Market", TDA, 1, 0xff9b00, true, true);
            addHoverButton(15659, "Interfaces/Loyalty/BUTTON", 1, 64, 30, "Cancel a buying offer", -1, 15660, 1);
            addHoveredButton(15660, "Interfaces/Loyalty/BUTTON", 2, 64, 30, 15661);
            addText(15662, "Cancel Buy", TDA, 1, 0xff9b00, true, true);
            addHoverButton(15663, "Interfaces/Loyalty/BUTTON", 1, 64, 30, "View what you are selling", -1, 15664, 1);
            addHoveredButton(15664, "Interfaces/Loyalty/BUTTON", 2, 64, 30, 15665);
            addText(15666, "S Market", TDA, 1, 0xff9b00, true, true);
            addHoverButton(15667, "Interfaces/Loyalty/BUTTON", 1, 64, 30, "Cancel a selling offer", -1, 15667, 1);
            addHoveredButton(15668, "Interfaces/Loyalty/BUTTON", 2, 64, 30, 15669);
            addText(15670, "Cancel Sell", TDA, 1, 0xff9b00, true, true);
            addHoverButton(15671, "Interfaces/Loyalty/BUTTON", 1, 64, 30, "Collect", -1, 15672, 1);
            addHoveredButton(15672, "Interfaces/Loyalty/BUTTON", 2, 64, 30, 15673);
            addText(15674, "Collect", TDA, 1, 0xff9b00, true, true);
            
            tab.totalChildren(18);//190 170
            tab.child(0, 15652, 50, 50);
            tab.child(1, 15653, 190, 155);
            tab.child(2, 15654, 250, 155);
            tab.child(3, 15655, 62, 120);
            tab.child(4, 15656, 62, 120);
            tab.child(5, 15658, 92, 125);
            tab.child(6, 15659, 62, 200);
            tab.child(7, 15660, 62, 200);
            tab.child(8, 15662, 92, 205);
            
            tab.child(9, 15663, 350, 120);
            tab.child(10, 15664, 350, 120);
            tab.child(11, 15666, 380, 125);
            
            tab.child(12, 15667, 350, 200);
            tab.child(13, 15668, 350, 200);
            tab.child(14, 15670, 380, 205);
            
            tab.child(15, 15671, 200, 255);
            tab.child(16, 15672, 200, 255);
            tab.child(17, 15674, 230, 260);
        }
        public static void BuyGE(RSFont[] TDA) {
            
            RSInterface tab = addTabInterface(15751);
            addSprite(15752, 0, "Interfaces/GrandExchange/Buy");
            addButton(15753, 0, "Interfaces/GrandExchange/Confirm", "Confirm Your Order");
            addButton(15754, 1, "Interfaces/GrandExchange/Small", "Add 1 more");
            addButton(15755, 1, "Interfaces/GrandExchange/Small", "Add 5 more");
            addButton(15756, 1, "Interfaces/GrandExchange/Small", "Add 25 more");
           //addButton(15757, 1, "Interfaces/GrandExchange/Small", 42, 28, "Add X more", 15757);
            //addButton(15758, 1, "Interfaces/GrandExchange/Small", 42, 28, "Set the price for each item", 15758);
            addButton(15759, 0, "Interfaces/GrandExchange/Minus", "Subtract one");
            addButton(15760, 0, "Interfaces/GrandExchange/Minus", "Subtract price");
            addButton(15761, 0, "Interfaces/GrandExchange/Plus", "Add one");
            addButton(15762, 0, "Interfaces/GrandExchange/Plus", "Increment Price");
            //addButton(15763, 1, "Interfaces/GrandExchange/Click", 44, 40, "Search Item", 15763);
            addText(15764, "1", TDA, 1, 0xff9b00, false, true);
            addText(15765, "5", TDA, 1, 0xff9b00, false, true);
            addText(15766, "25", TDA, 1, 0xff9b00, false, true);
            addText(15767, "Set", TDA, 1, 0xff9b00, false, true);
            addText(15768, "Set", TDA, 1, 0xff9b00, false, true);
            AddInterfaceButton(15769, 32, 15770, "Interfaces/clanCreation/SPRITE", 15, 13, "Close", 1);
            //addHoverButton1(10591, "Interfaces/clanCreation/SPRITE", 32, 15, 13, "Close", 10592, 1);
            addHoveredButton(15770, "Interfaces/clanCreation/SPRITE", 33, 15, 13, 15771);
            addButton(15772, 1, "Interfaces/GrandExchange/Back", "Go Back to the Main Interface");
            addHoverButton(15773, "Interfaces/GrandExchange/Click", 1, 44, 40, "Search an Item", 15763, 15773, 1);
            addHoveredButton(15774, "Interfaces/GrandExchange/Click", 1, 44, 40, 15775);
            addHoverButton(15775, "Interfaces/GrandExchange/Small", 1, 42, 28, "Add X More", 15757, 15776, 1);
            addHoveredButton(15776, "Interfaces/GrandExchange/Small", 1, 42, 28, 15777);
            addHoverButton(15778, "Interfaces/GrandExchange/Small", 1, 42, 28, "Set The Price", 15758, 15779, 1);
            addHoveredButton(15779, "Interfaces/GrandExchange/Small", 1, 42, 28, 15780);
            addText(15781, "...", TDA, 1, 0xff9b00, false, true);
            addText(15782, "...", TDA, 1, 0xff9b00, false, true);
            addText(15783, "...", TDA, 1, 0xff9b00, false, true);
            addText(15784, "A", TDA, 1, 0x00FF5C, false, true);
            
            tab.totalChildren(27);//for text add 15, 5
            tab.child(0, 15752, 10, 20);
            tab.child(1, 15753, 200, 265);
            tab.child(2, 15754, 75, 200);
            tab.child(3, 15755, 115, 200);
            tab.child(4, 15756, 155, 200);
            //tab.child(5, 15757, 195, 200);
            tab.child(5, 15775, 195, 200);
            tab.child(6, 15776, 195, 200);
            //tab.child(7, 15758, 350, 200);
            tab.child(7, 15778, 350, 200);
            tab.child(8, 15779, 350, 200);
            tab.child(9, 15759, 65, 180);
            tab.child(10, 15760, 280, 180);
            tab.child(11, 15761, 235, 180);
            tab.child(12, 15762, 450, 180);
            tab.child(13, 15773, 105, 95);//box
            tab.child(14, 15774, 105, 95);//box
            tab.child(15, 15764, 90, 205);
            tab.child(16, 15765, 130, 205);
            tab.child(17, 15766, 170, 205);
            tab.child(18, 15767, 205, 205);
            tab.child(19, 15768, 360, 205);
            tab.child(20, 15769, 487, 30);
            tab.child(21, 15770, 487, 30);
            tab.child(22, 15772, 35, 270);
            tab.child(23, 15781, 125, 180);
            tab.child(24, 15782, 329, 180);
            tab.child(25, 15783, 210, 237); 
            tab.child(26, 15784, 292, 115);
        }
        public static void SellGE(RSFont[] TDA) {
            
             RSInterface tab = addTabInterface(15951);
                addSprite(15952, 0, "Interfaces/GrandExchange/Sell");
                addButton(15953, 0, "Interfaces/GrandExchange/Confirm", "Confirm Your Order");
                addButton(15954, 1, "Interfaces/GrandExchange/Small", "Add 1 more");
                addButton(15955, 1, "Interfaces/GrandExchange/Small", "Add 5 more");
                addButton(15956, 1, "Interfaces/GrandExchange/Small", "Add 25 more");
               //addButton(15957, 1, "Interfaces/GrandExchange/Small", 42, 28, "Add X more", 15757);
                //addButton(15958, 1, "Interfaces/GrandExchange/Small", 42, 28, "Set the price for each item", 15758);
                addButton(15959, 0, "Interfaces/GrandExchange/Minus", "Subtract one");
                addButton(15960, 0, "Interfaces/GrandExchange/Minus", "Subtract price");
                addButton(15961, 0, "Interfaces/GrandExchange/Plus", "Add one");
                addButton(15962, 0, "Interfaces/GrandExchange/Plus", "Increment Price");
                //addButton(15963, 1, "Interfaces/GrandExchange/Click", 44, 40, "Search Item", 15763);
                addText(15964, "1", TDA, 1, 0xff9b00, false, true);
                addText(15965, "5", TDA, 1, 0xff9b00, false, true);
                addText(15966, "25", TDA, 1, 0xff9b00, false, true);
                addText(15967, "Set", TDA, 1, 0xff9b00, false, true);
                addText(15968, "Set", TDA, 1, 0xff9b00, false, true);
                AddInterfaceButton(15969, 32, 15970, "Interfaces/clanCreation/SPRITE", 15, 13, "Close", 1);
                //addHoverButton1(10591, "Interfaces/clanCreation/SPRITE", 32, 15, 13, "Close", 10592, 1);
                addHoveredButton(15970, "Interfaces/clanCreation/SPRITE", 33, 15, 13, 15971);
                addButton(15972, 1, "Interfaces/GrandExchange/Back", "Go Back to the Main Interface");
                addHoverButton(15973, "Interfaces/GrandExchange/Click", 1, 44, 40, "Search an Item", 15763, 15973, 1);
                addHoveredButton(15974, "Interfaces/GrandExchange/Click", 1, 44, 40, 15975);
                addHoverButton(15975, "Interfaces/GrandExchange/Small", 1, 42, 28, "Add X More", 15757, 15976, 1);
                addHoveredButton(15976, "Interfaces/GrandExchange/Small", 1, 42, 28, 15977);
                addHoverButton(15978, "Interfaces/GrandExchange/Small", 1, 42, 28, "Set The Price", 15758, 15979, 1);
                addHoveredButton(15979, "Interfaces/GrandExchange/Small", 1, 42, 28, 15980);
                addText(15981, "...", TDA, 1, 0xff9b00, false, true);
                addText(15982, "...", TDA, 1, 0xff9b00, false, true);
                addText(15983, "...", TDA, 1, 0xff9b00, false, true);
                addText(15984, "A", TDA, 1, 0x00FF5C, false, true);
    
                tab.totalChildren(27);//for text add 15, 5
                tab.child(0, 15952, 10, 20);
                tab.child(1, 15953, 200, 265);
                tab.child(2, 15954, 75, 200);
                tab.child(3, 15955, 115, 200);
                tab.child(4, 15956, 155, 200);
                //tab.child(5, 15957, 195, 200);
                tab.child(5, 15975, 195, 200);
                tab.child(6, 15976, 195, 200);
                //tab.child(7, 15958, 350, 200);
                tab.child(7, 15978, 350, 200);
                tab.child(8, 15979, 350, 200);
                tab.child(9, 15959, 65, 180);
                tab.child(10, 15960, 280, 180);
                tab.child(11, 15961, 235, 180);
                tab.child(12, 15962, 450, 180);
                tab.child(13, 15973, 105, 95);//box
                tab.child(14, 15974, 105, 95);//box
                tab.child(15, 15964, 90, 205);
                tab.child(16, 15965, 130, 205);
                tab.child(17, 15966, 170, 205);
                tab.child(18, 15967, 205, 205);
                tab.child(19, 15968, 360, 205);
                tab.child(20, 15969, 487, 30);
                tab.child(21, 15970, 487, 30);
                tab.child(22, 15972, 35, 270);
                tab.child(23, 15981, 125, 180);
                tab.child(24, 15982, 329, 180);      
                tab.child(25, 15983, 210, 237);
                tab.child(26, 15984, 292, 115);
            }
        public static void CancelGEBuy(RSFont[] TDA) {
            
             RSInterface tab = addTabInterface(16151);//180 180
             addSprite(16152, 46, "Interfaces/clanCreation/SPRITE");
    
                addHoverButton(16153, "Interfaces/clanCreation/SPRITE", 9, 60, 60, "Search an Item", 15763, 16154, 1);
                addHoveredButton(16154, "Interfaces/clanCreation/SPRITE", 8, 60, 60, 16155);
                addHoverButton1(16156, "Interfaces/clanCreation/SPRITE", 5, 129, 61, "Confirm Cancel", 16157, 1);
                addHoveredButton(16157, "Interfaces/clanCreation/SPRITE", 6, 129, 61, 16158);
                addText(16159, "Item ID: ", TDA, 1, 0x00FF5C, false, true);
                addText(16160, "Confirm Cancel", TDA, 1, 0x00FF5C, false, true);
                addText(16161, "Cancel Buy Offer", TDA, 3, 0x00FF5C, false, true);
                AddInterfaceButton(16162, 32, 16163, "Interfaces/clanCreation/SPRITE", 15, 13, "Close", 1);
                addHoveredButton(16163, "Interfaces/clanCreation/SPRITE", 33, 15, 13, 16164);
                
                tab.totalChildren(10);// 170
                tab.child(0, 16152, 3, 10);
                tab.child(1, 16153, 220, 130);
                tab.child(2, 16154, 220, 130);
                tab.child(3, 16156, 180, 280);
                tab.child(4, 16157, 180, 280);
                tab.child(5, 16159, 180, 200);
                tab.child(6, 16160, 210, 280);
                tab.child(7, 16161, 190, 70);
                tab.child(8, 16162, 485, 15);//close
                tab.child(9, 16163, 485, 15);//close
            }
        public static void CancelGESell(RSFont[] TDA) {
            
             RSInterface tab = addTabInterface(16351);
             addSprite(16352, 46, "Interfaces/clanCreation/SPRITE");
    
                addHoverButton(16353, "Interfaces/clanCreation/SPRITE", 9, 60, 60, "Search an Item", 15763, 16354, 1);
                addHoveredButton(16354, "Interfaces/clanCreation/SPRITE", 8, 60, 60, 16355);
                addHoverButton1(16356, "Interfaces/clanCreation/SPRITE", 5, 129, 61, "Confirm Cancel", 16357, 1);
                addHoveredButton(16357, "Interfaces/clanCreation/SPRITE", 6, 129, 61, 16358);
                addText(16359, "Item ID: ", TDA, 1, 0x00FF5C, false, true);
                addText(16360, "Confirm Cancel", TDA, 1, 0x00FF5C, false, true);
                addText(16361, "Cancel Sell Offer", TDA, 3, 0x00FF5C, false, true);
                AddInterfaceButton(16362, 32, 16363, "Interfaces/clanCreation/SPRITE", 15, 13, "Close", 1);
                addHoveredButton(16363, "Interfaces/clanCreation/SPRITE", 33, 15, 13, 16364);
                
                tab.totalChildren(10);// 170
                tab.child(0, 16352, 3, 10);
                tab.child(1, 16353, 220, 130);
                tab.child(2, 16354, 220, 130);
                tab.child(3, 16356, 180, 280);
                tab.child(4, 16357, 180, 280);
                tab.child(5, 16359, 180, 200);
                tab.child(6, 16360, 210, 280);
                tab.child(7, 16361, 190, 70);
                tab.child(8, 16362, 485, 15);//close
                tab.child(9, 16363, 485, 15);//close
                }
        
        public static void showGE(RSFont[] TDA){
             RSInterface tab = addTabInterface(16550);
             RSInterface scroll = addTabInterface(16650);
             addSprite(16551, 46, "Interfaces/clanCreation/SPRITE");
             addText(16552, "My Market", 0xffffcc, false, true, -1, TDA, 3);
             tab.totalChildren(3);
             tab.child(0, 16551, 3, 10);
             tab.child(1, 16552, 205, 15);
             tab.child(2, 16650, 155, 45);
             int num = 1;
             for(int i = 16650; i <= 16670; i++){
                 addText(i, "Num: " + num, 0xffffcc, false, true, -1, TDA, 3);
                 addText(i, "Num1: " + num, 0xffffcc, false, true, -1, TDA, 3);
                 num++;
             }
             scroll.totalChildren(21);
             int Child = 0;
             int Y = 30;
             for(int i = 16650; i <= 16670; i++){
                scroll.child(Child, i, 248, Y);
                 Child++;
                 Y += 10;
             }
                scroll.width = 315; scroll.height = 217; scroll.scrollMax = 300;
                scroll.newScroller = false;
             
        }


    Spoiler for Client.java:

    Add:
    Code:
    public int interfaceButtonAction = 0;
    
    void sendPacket(int packet) {
    		if (packet == 103) {
    		stream.createFrame(103);
    		stream.writeWordBigEndian(inputString.length() - 1);
    		stream.writeString(inputString.substring(2));
    		inputString = "";
    		promptInput = "";
    		interfaceButtonAction = 0;
    		}
    	}
    Find:
    Code:
                        if(friendsListAction == 1) {
                            long l = TextClass.longForName(promptInput);
                            addFriend(l);
                        }
    Under it add:
    Code:
    if(interfaceButtonAction == 15757 && promptInput.length() > 0)
                        {
                            inputString = "::tempamt "+promptInput;
                            sendPacket(103);
                        }
                        if(interfaceButtonAction == 15758 && promptInput.length() > 0)
                        {
                            inputString = "::tempprice "+promptInput;
                            sendPacket(103);
                        }
                        if(interfaceButtonAction == 15763 && promptInput.length() > 0)
                        {
                            inputString = "::tempid "+promptInput;
                            sendPacket(103);
                        }
    Find:
    Code:
                if(j == 202) {
                    inputTaken = true;
                    inputDialogState = 0;
                    messagePromptRaised = true;
                    promptInput = "";
                    friendsListAction = 2;
                    aString1121 = "Enter name of friend to delete from list";
                }
    Under it add:
    Code:
    if(j == 15757)//tempamt
            {
            inputTaken = true;
            messagePromptRaised = true;
            amountOrNameInput = "";
            inputDialogState = 0;
            interfaceButtonAction = 15757;
            aString1121 = "Please type how many you want to buy/sell";
            } 
            if(j == 15758)//tempprice
            {
            inputTaken = true;
            messagePromptRaised = true;
            amountOrNameInput = "";
            inputDialogState = 0;
            interfaceButtonAction = 15758;
            aString1121 = "Please type how much u wanna buy it for";
            } 
            if(j == 15763)
            {
            inputTaken = true;
            messagePromptRaised = true;
            amountOrNameInput = "";
            inputDialogState = 0;
            interfaceButtonAction = 15763;
            aString1121 = "Please type in the item id you wish to buy/sell";
            }


    Now Server Sided:


    First make GrandExchange.java

    Code:
    package server.model.players;
    
    import java.sql.*;
    
    import server.model.players.Client;
    import server.util.*;
    
    public class GrandExchange {
        /**
         * Author: TheElite
         * Msn: PM ME FOR MSN (NOT EVERYONE IS GETTING IT :) )
         */
    
        public GrandExchange (Client c) {
            
        }
    
            public static Connection con = null;
            public static Statement stm;
            private static boolean check = true;
            
            public static void createConnection() { // is the connection made? yes i can add to ge and sell but cant collect
                try {
                    Class.forName("com.mysql.jdbc.Driver").newInstance();
                    con = DriverManager.getConnection("jdbc:mysql://HOST/DB NAME", "DB USERNAME", "DB PASS");
                    stm = con.createStatement();
                    Misc.println("Grand Exchange Connected");
                } catch (Exception e) {
                    e.printStackTrace();
                    con = null;
                    stm = null;
                }
            }
            
            public static boolean checkBeforeBuy(final Client c, final int itemid, final int itemamt, final int itemprice){
                try {
                    Statement statement = con.createStatement();
                    String query = "SELECT * FROM sell";
                    ResultSet rs = query(query);
                    if(rs.next()){
                        int listedid = Integer.parseInt(rs.getString("itemid"));
                        int listedamt = Integer.parseInt(rs.getString("amount"));
                        int listedprice = Integer.parseInt(rs.getString("price"));
                        /**Buying 100 arrows at 10m....selling 50 arrows at 5m each**/
                        if(itemid == listedid && itemprice >= listedprice){
                            return true;//&& itemamt <= listedamt
                        } else{//means no buyer
                            return false;
                        }
                    }else 
                        return false;
                } 
                catch (Exception sqlEx) {
                    sqlEx.printStackTrace();
                }
                    return false;
                }
            public static boolean checkBeforeSell(final Client c, final int itemid, final int itemamt, final int itemprice){
                try {
                    Statement statement = con.createStatement();
                    String query = "SELECT * FROM buy";
                    ResultSet rs = query(query);
                    if (rs.next()){
                        int listedid = Integer.parseInt(rs.getString("itemid"));
                        int listedamt = Integer.parseInt(rs.getString("amount"));
                        int listedprice = Integer.parseInt(rs.getString("price"));
                        /**Buying 100 arrows at 10m....selling 50 arrows at 5m each**/
                        if(itemid == listedid && itemprice <= listedprice){
                            return true;// && itemamt >= listedamt
                        } else{//means no buyer
                            return false;
                        }
                    } else
                        return false;
                } 
                catch (Exception sqlEx) {
                    sqlEx.printStackTrace();
                }
                return true;
                }
    
            public void run() {
                while(true) {        
                    try {
                        if(con == null)
                            createConnection(); 
                        else
                            ping();
                        Thread.sleep(10000);//10 seconds
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }
            
            public static void ping(){
                try {
                    String query = "SELECT * FROM buy WHERE itemid = 'null'";
                    query(query);
                } catch (Exception e) {
                    e.printStackTrace();
                    con = null;
                    stm = null;
                }
            }
            public static void process(Client c, int id, int amt, int price, String bos){
                
                if(bos.equals("sell")){
                    if(c.getItems().playerHasItem(id, amt)){
                        boolean sell = checkBeforeSell(c,id, amt, price);;
                        //checkBeforeSell(c,id, amt, price);
                        if (sell == true){
                            sellWithBuyer(c, id, amt, price);
                            c.sendMessage("Sell and true/buyer");
                        } else{
                            sellNoBuyer(c, id, amt, price);
                            c.sendMessage("Sell and false/nobuyer");
                        }
                    } else{
                        c.sendMessage("You don't have itemid: " + id + " Amt: " + amt);
                    }
                } else if(bos.equals("buy")){
                    int temp = amt* price;
                    if(c.getItems().playerHasItem(995, temp)){
                        boolean checkbuy = checkBeforeBuy(c, id, amt, price);
                        //checkBeforeBuy(c, id, amt, price);
                        if (checkbuy == true){
                            buyWithBuyer(c, id, amt, price);
                            c.sendMessage("Buy and true/buyer");
                        } else{
                            buyNoBuyer(c, id, amt, price);
                            c.sendMessage("Buy and false/nobuyer");
                        }
                    }else {
                        c.sendMessage("You don't have " + temp + " coins");
                    }
                }
            }
            /**public static  void checkBeforeBuy(final Client c, final int itemid, final int itemamt, final int itemprice){
                if(con == null){
                    if(stm != null){
                        try {
                            stm = con.createStatement();
                        } catch(Exception e){
                            con = null;
                            stm = null;
                            //put a sendmessage here telling them to relog in 30 seconds
                            return;
                        }
                    } else {
                        //put a sendmessage here telling them to relog in 30 seconds
                        
                    }
                }
                new Thread(){
                    @Override
                    public void run()
                    {
                        try {
                            String query = "SELECT * FROM sell";
                            ResultSet rs = query(query);
                                int listedid = Integer.parseInt(rs.getString("itemid"));
                                int listedamt = Integer.parseInt(rs.getString("amount"));
                                int listedprice = Integer.parseInt(rs.getString("price"));
                                /**Buying 100 arrows at 10m....selling 50 arrows at 5m each**/
                                /**if(itemid == listedid && itemamt <= listedamt && itemprice >= listedprice){
                                    check = true;
                                } else{//means no buyer
                                    check = false;
                                }
                            
                            
                        } catch (Exception e) {
                            e.printStackTrace();
                            con = null;
                            stm = null;
                        }
                    }
                }.start();
            }**/
            public static void buyNoBuyer(final Client c, final int id, final int amt, final int price){
                if(con == null){
                    if(stm != null){
                        try {
                            stm = con.createStatement();
                        } catch(Exception e){
                            con = null;
                            stm = null;
                            //put a sendmessage here telling them to relog in 30 seconds
                            return;
                        }
                    } else {
                        //put a sendmessage here telling them to relog in 30 seconds
                        
                    }
                }
                new Thread(){
                    @Override
                    public void run()
                    {
                        try {
                            if(c.getItems().playerHasItem(id, amt)){
                                query("INSERT INTO `buy` (`itemid`, `amount`, `price`, `bought`, `username`) VALUES ('"+id+"', '"+amt+"', '"+price+"', '', '"+c.playerName+"');");
                                int temp = price * amt;
                                c.getItems().deleteItem(995, temp);
                                c.sendMessage("Successfully added to the Grand Exchange Buy List");
                                //INSERT INTO `gedb`.`buy` (`itemid`, `amount`, `price`, `bought`, `username`) VALUES ('1', '1', '1', '', 'saad');
                            }else{
                                c.sendMessage("You dont have id: " + id + " Amt: " + amt);
                            }
                        } catch (Exception e) {
                            e.printStackTrace();
                            con = null;
                            stm = null;
                        }
                    }
                }.start();
            }
            public static void buyWithBuyer(final Client c, final int buyingid, final int buyingamt, final int buyingprice){
                if(con == null){
                    if(stm != null){
                        try {
                            stm = con.createStatement();
                        } catch(Exception e){
                            con = null;
                            stm = null;
                            //put a sendmessage here telling them to relog in 30 seconds
                            return;
                        }
                    } else {
                        //put a sendmessage here telling them to relog in 30 seconds
                        
                    }
                }
                new Thread(){
                    @Override
                    public void run()
                    {
                        try {
                            String query = "SELECT * FROM sell";
                            ResultSet rs = query(query);
                            while (rs.next()){
                                int sellingid = Integer.parseInt(rs.getString("itemid"));
                                int sellingamt = Integer.parseInt(rs.getString("amount"));
                                int sellingprice = Integer.parseInt(rs.getString("price"));
                                String player2 = rs.getString("username");
                                /**Buying 100 arrows at 10m....selling 50 arrows at 5m each**/
                                int temp = buyingprice * buyingamt;
                                if(c.getItems().playerHasItem(995, temp)){
                                    c.getItems().deleteItem(995, temp);
                                }else{
                                    c.sendMessage("@dre@You dont have enough money!");
                                    return;
                                }
                                if(sellingid != buyingid){
                                    c.sendMessage("Error. Please Report to staff");
                                    return;
                                }
                                if(sellingamt <= buyingamt){
                                    int amtleft = (buyingamt - sellingamt);
                                    
                                    if(sellingprice == buyingprice){
                                        writeCollect(c.playerName, buyingid, sellingamt);
                                        writeCollect(player2, 995, sellingprice * sellingamt);
                                        removeFromGEBuy(c.playerName, sellingid, sellingamt, sellingprice);
                                        if(amtleft != 0)
                                            buyNoBuyer(c, sellingid, amtleft, buyingprice);
                                    } else if(sellingprice <= buyingprice){//buying for 50m, selling for 25
                                        int tempprice = (buyingprice - sellingprice);
                                        
                                        writeCollect(c.playerName, buyingid, sellingamt);
                                        writeCollect(player2, 995, (sellingprice * sellingamt) + (tempprice * sellingamt));
                                        writeCollect(player2, 995, tempprice * sellingamt);
                                        removeFromGEBuy(c.playerName, sellingid, sellingamt, sellingprice);
                                        if(amtleft != 0)
                                            buyNoBuyer(c, sellingid, amtleft, buyingprice);
                                    }
                                    removeFromGESell(player2, sellingid, sellingamt, sellingprice);
                                } else if (sellingamt > buyingamt){
                                    int amtleft = (sellingamt - buyingamt);
                                    
                                    if(sellingprice == buyingprice){
                                        writeCollect(c.playerName, buyingid, buyingamt);
                                        writeCollect(player2, 995, sellingprice * buyingamt);
                                        removeFromGEBuy(c.playerName, sellingid, sellingamt, sellingprice);
                                        writeCollect(player2, sellingid, amtleft);
                                    } else if(sellingprice <= buyingprice){//buying for 50m, selling for 25
                                        int tempprice = (buyingprice - sellingprice);
                                        writeCollect(c.playerName, buyingid, buyingamt);
                                        writeCollect(player2, 995, sellingprice * buyingamt);
                                        removeFromGEBuy(c.playerName, sellingid, sellingamt, sellingprice);
                                        writeCollect(player2, sellingid, amtleft);
                                        writeCollect(player2, 995, tempprice * sellingamt);
                                    }
                                    removeFromGESell(player2, sellingid, sellingamt, sellingprice);
                                
                                    
                                } /*else if(sellingprice <= buyingprice){
                                
                                    int moneytobuyer = (buyingprice - sellingprice);
                                    if(sellingamt == buyingamt){
                                        writeCollect(c.playerName, buyingid, buyingamt);
                                        writeCollect(player2, 995, moneytobuyer * buyingamt);
                                        writeCollect(c.playerName, 995, moneytobuyer * buyingamt);
                                        removeFromGEBuy(c.playerName, sellingid, sellingamt, sellingprice);
                                    } else if (sellingamt < buyingamt){
                                        int amtleft = (buyingamt - sellingamt);
                                        writeCollect(c.playerName, buyingid, buyingamt);
                                        writeCollect(c.playerName, 995, moneytobuyer * sellingamt);
                                        writeCollect(player2, 995, buyingprice * sellingamt);
                                        removeFromGEBuy(c.playerName, sellingid, sellingamt, sellingprice);
                                        buyNoBuyer(c, sellingid, amtleft, buyingprice);
                                    }
                                    removeFromGESell(player2, sellingid, sellingamt, sellingprice);
                                }*/
                            
                            }
                            
                        } catch (Exception e) {
                            e.printStackTrace();
                            con = null;
                            stm = null;
                        }
                    }
                }.start();
            }
            public static void removeFromGESell(final String username, final int id, final int amt, final int price){
                if(con == null){
                    if(stm != null){
                        try {
                            stm = con.createStatement();
                        } catch(Exception e){
                            con = null;
                            stm = null;
                            //put a sendmessage here telling them to relog in 30 seconds
                            return;
                        }
                    } else {
                        //put a sendmessage here telling them to relog in 30 seconds
                        
                    }
                }
                new Thread(){
                    @Override
                    public void run()
                    {
                        try {
                            
                            query("DELETE FROM `sell` WHERE `username` = '"+ username + "' AND `itemid` = '"+id+"' AND `amount` = '"+amt+"' AND `price` = '"+price+"'");
                            
                        } catch (Exception e) {
                            e.printStackTrace();
                            con = null;
                            stm = null;
                        }
                    }
                }.start();
            }
            /**public static  void checkBeforeSell(final Client c, final int itemid, final int itemamt, final int itemprice){
                if(con == null){
                    if(stm != null){
                        try {
                            stm = con.createStatement();
                        } catch(Exception e){
                            con = null;
                            stm = null;
                            //put a sendmessage here telling them to relog in 30 seconds
                            return;
                        }
                    } else {
                        //put a sendmessage here telling them to relog in 30 seconds
                        
                    }
                }
                new Thread(){
                    @Override
                    public void run()
                    {
                        try {
                            String query = "SELECT * FROM buy";
                            ResultSet rs = query(query);
                                int listedid = Integer.parseInt(rs.getString("itemid"));
                                int listedamt = Integer.parseInt(rs.getString("amount"));
                                int listedprice = Integer.parseInt(rs.getString("price"));
                                /**Buying 100 arrows at 10m....selling 50 arrows at 5m each**/
                                /**if(itemid == listedid && itemamt >= listedamt && itemprice <= listedprice){
                                    check = true;
                                } else{//means no buyer
                                    check = false;
                                }
                            
                            
                        } catch (Exception e) {
                            e.printStackTrace();
                            con = null;
                            stm = null;
                        }
                    }
                }.start();
            }**/
            public static void sellWithBuyer(final Client c, final int sellingid, final int sellingamt, final int sellingprice){
                if(con == null){
                    if(stm != null){
                        try {
                            stm = con.createStatement();
                        } catch(Exception e){
                            con = null;
                            stm = null;
                            //put a sendmessage here telling them to relog in 30 seconds
                            return;
                        }
                    } else {
                        //put a sendmessage here telling them to relog in 30 seconds
                        
                    }
                }
                new Thread(){
                    @Override
                    public void run()
                    {
                        try {
                            String query = "SELECT * FROM buy";
                            ResultSet rs = query(query);
                            while(rs.next()){
                                int buyingid = Integer.parseInt(rs.getString("itemid"));
                                int buyingamt = Integer.parseInt(rs.getString("amount"));
                                int buyingprice = Integer.parseInt(rs.getString("price"));
                                String player2 = rs.getString("username");
                                /**Buying 100 arrows at 10m....selling 50 arrows at 5m each**/
                                if(c.getItems().playerHasItem(sellingid, sellingamt)){
                                    c.getItems().deleteItem(sellingid, sellingamt);
                                }else{
                                    c.sendMessage("You dont have id: " + sellingid + " Amt: " + sellingamt);
                                    return;
                                }
                                if(sellingid != buyingid){
                                    c.sendMessage("Error. Please Report to staff");
                                    return;
                                }
                                if(sellingamt >= buyingamt){//selling 100 but buyer wants 50
                                    int amtleft = (sellingamt - buyingamt);
                                    
                                    if(sellingprice == buyingprice){
                                        writeCollect(player2, buyingid, buyingamt);
                                        writeCollect(c.playerName, 995, buyingprice * buyingamt);
                                        removeFromGESell(c.playerName, sellingid, sellingamt, sellingprice);
                                        sellNoBuyer(c, sellingid, amtleft, sellingprice);
                                    } else if(sellingprice <= buyingprice){//buying for 50m, selling for 25
                                        int tempprice = (buyingprice - sellingprice);
                                        
                                        writeCollect(player2, buyingid, buyingamt);
                                        writeCollect(c.playerName, 995, tempprice * buyingamt);
                                        writeCollect(c.playerName, 995, buyingprice * buyingamt);
                                        removeFromGESell(c.playerName, sellingid, sellingamt, sellingprice);
                                        sellNoBuyer(c, sellingid, amtleft, sellingprice);
                                    }
                                    removeFromGEBuy(player2, buyingid, buyingamt, buyingprice);
                                }else if (sellingamt < buyingamt){
                                    int amtleft = (buyingamt - sellingamt);
                                    if(sellingprice == buyingprice){
                                        writeCollect(player2, buyingid, sellingamt);
                                        writeCollect(c.playerName, 995, buyingprice * sellingamt);
                                        removeFromGESell(c.playerName, sellingid, sellingamt, sellingprice);
                                        removeFromGEBuy(player2, buyingid, buyingamt, buyingprice);
                                    } else if(sellingprice <= buyingprice){//buying for 50m, selling for 25
                                        int tempprice = (buyingprice - sellingprice);
                                        writeCollect(player2, buyingid, sellingamt);
                                        writeCollect(c.playerName, 995, (tempprice * sellingamt) + (buyingprice * sellingamt));
                                        removeFromGESell(c.playerName, sellingid, sellingamt, sellingprice);
                                        removeFromGEBuy(player2, buyingid, buyingamt, buyingprice);
                                        writeCollect(player2, buyingid, amtleft);
                                    }
                                }
                            
                            }
                        } catch (Exception e) {
                            e.printStackTrace();
                            con = null;
                            stm = null;
                        }
                    }
                }.start();
            }
            public static void sellNoBuyer(final Client c, final int id, final int amt, final int price){
                if(con == null){
                    if(stm != null){
                        try {
                            stm = con.createStatement();
                        } catch(Exception e){
                            con = null;
                            stm = null;
                            //put a sendmessage here telling them to relog in 30 seconds
                            return;
                        }
                    } else {
                        //put a sendmessage here telling them to relog in 30 seconds
                        
                    }
                }
                new Thread(){
                    @Override
                    public void run()
                    {
                        try {
                            if(c.getItems().playerHasItem(id, amt)){
                                query("INSERT INTO `sell` (`itemid`, `amount`, `price`, `sold`, `username`) VALUES ('"+id+"', '"+amt+"', '"+price+"', '', '"+c.playerName+"');");
                                c.getItems().deleteItem(id, amt);
                                c.sendMessage("Successfully added to the Grand Exchange Sell list");
                                //INSERT INTO `gedb`.`buy` (`itemid`, `amount`, `price`, `bought`, `username`) VALUES ('1', '1', '1', '', 'saad');
                            }else{
                                c.sendMessage("You dont have id: " + id + " Amt: " + amt);
                            }
                        } catch (Exception e) {
                            e.printStackTrace();
                            con = null;
                            stm = null;
                        }
                    }
                }.start();
            }
            public static void removeFromGEBuy(final String username, final int id, final int amt, final int price){
                if(con == null){
                    if(stm != null){
                        try {
                            stm = con.createStatement();
                        } catch(Exception e){
                            con = null;
                            stm = null;
                            //put a sendmessage here telling them to relog in 30 seconds
                            return;
                        }
                    } else {
                        //put a sendmessage here telling them to relog in 30 seconds
                        
                    }
                }
                new Thread(){
                    @Override
                    public void run()
                    {
                        try {
                            
                            query("DELETE FROM `buy` WHERE `username` = '"+ username + "' AND `itemid` = '"+id+"' AND `amount` = '"+amt+"' AND `price` = '"+price+"'");
                            
                        } catch (Exception e) {
                            e.printStackTrace();
                            con = null;
                            stm = null;
                        }
                    }
                }.start();
            }
            public static void writeCollect(final String username, final int id, final int amt){
                if(con == null){
                    if(stm != null){
                        try {
                            stm = con.createStatement();
                        } catch(Exception e){
                            con = null;
                            stm = null;
                            //put a sendmessage here telling them to relog in 30 seconds
                            return;
                        }
                    } else {
                        //put a sendmessage here telling them to relog in 30 seconds
                        
                    }
                }
                new Thread(){
                    @Override
                    public void run()
                    {
                        try {
                            
                            query("INSERT INTO `collections` (`itemid`, `amount`, `collected`, `username`) VALUES ('"+id+"', '"+amt+"', '', '"+username+"');");
                            
                        } catch (Exception e) {
                            e.printStackTrace();
                            con = null;
                            stm = null;
                        }
                    }
                }.start();
            }
            /**public static void getCollect(final Client c, final String Username){
                if(con == null){
                    if(stm != null){
                        try {
                            stm = con.createStatement();
                        } catch(Exception e){
                            con = null;
                            stm = null;
                            //put a sendmessage here telling them to relog in 30 seconds
                            return;
                        }
                    } else {
                        //put a sendmessage here telling them to relog in 30 seconds
                        
                    }
                }
                new Thread(){
                    @Override
                    public void run()
                    {
                        try {
                            String query = "SELECT * FROM collections WHERE username = '"+ Username + "'";
                            ResultSet rs = query(query);
                            while (rs.next()){
                                int id = Integer.parseInt(rs.getString("itemid"));
                                int amt = Integer.parseInt(rs.getString("amount"));
                                String name = rs.getString("username");
                                //int listedprice = Integer.parseInt(rs.getString("price"));
                                if(name.equalsIgnoreCase(Username)){
                                    c.getItems().addItem(id, amt);
                                    c.SaveGame();
                                    c.sendMessage("Successfully collected GE Items.");
                                    query("DELETE FROM `collections` WHERE username = '"+ Username + "' AND `itemid` = '"+id+"' AND `amount` = '"+amt+"'");
                                }else{
                                    c.sendMessage("@dre@You have nothing to collect!");
                                }
                            }
                            
                        } catch (Exception e) {
                            e.printStackTrace();
                            con = null;
                            stm = null;
                        }
                    }
                }.start();
            }**/
            public static void getCollect(final Client c, final String Username){
                try {
                    String query = "SELECT * FROM collections";
                    ResultSet rs = query(query);
                    while(rs.next()){
                        int id = Integer.parseInt(rs.getString("itemid"));
                        int amt = Integer.parseInt(rs.getString("amount"));
                        String name = rs.getString("username");
                        if(name.equalsIgnoreCase(Username)){
                            c.getItems().addItem(id, amt);
                            c.sendMessage("<shad=65280>Successfully collected GE Items.");
                            query("DELETE FROM `collections` WHERE username = '"+ Username + "' AND `itemid` = '"+id+"' AND `amount` = '"+amt+"'");
                            }else{
                            c.sendMessage("<shad=16711680>You have nothing to collect!");
                        }
                    }
                    
                } catch (Exception e) {
                    e.printStackTrace();
                    con = null;
                    stm = null;
                }
            }
            public static void cancelBuy(final Client c, final int id){
                try {
                    String query = "SELECT * FROM buy";
                    ResultSet rs = query(query);
                    while(rs.next()){
                        int itemid = Integer.parseInt(rs.getString("itemid"));
                        int itemamt = Integer.parseInt(rs.getString("amount"));
                        int itemprice = Integer.parseInt(rs.getString("price"));
                        String name = rs.getString("username");
                        if(name.equalsIgnoreCase(c.playerName) && id == itemid){
                            c.getItems().addItem(995, (itemamt * itemprice));
                            removeFromGEBuy(c.playerName, itemid, itemamt, itemprice);
                            c.sendMessage("<shad=65280>Successfully removed from GE.");
                            }else{
                            c.sendMessage("<shad=16711680>You are not buying that Item!");
                        }
                    }
                    
                } catch (Exception e) {
                    e.printStackTrace();
                    con = null;
                    stm = null;
                }
            }
            public static void cancelSell(final Client c, final int id){
                try {
                    String query = "SELECT * FROM sell";
                    ResultSet rs = query(query);
                    while(rs.next()){
                        int itemid = Integer.parseInt(rs.getString("itemid"));
                        int itemamt = Integer.parseInt(rs.getString("amount"));
                        int itemprice = Integer.parseInt(rs.getString("price"));
                        String name = rs.getString("username");
                        if(name.equalsIgnoreCase(c.playerName) && id == itemid){
                            c.getItems().addItem(itemid, itemamt);
                            removeFromGESell(c.playerName, itemid, itemamt, itemprice);
                            c.sendMessage("<shad=65280>Successfully removed from GE.");
                            }else{
                            c.sendMessage("<shad=16711680>You are not selling that Item!");
                        }
                    }
                    
                } catch (Exception e) {
                    e.printStackTrace();
                    con = null;
                    stm = null;
                }
            }
            public static void writeInterfaceBuy(final Client c, final String Username){
                try {
                    String query = "SELECT * FROM buy";
                    ResultSet rs = query(query);
                    int line = 13592;
                    while(rs.next()){
                        int price = Integer.parseInt(rs.getString("price"));
                        int id = Integer.parseInt(rs.getString("itemid"));
                        int amt = Integer.parseInt(rs.getString("amount"));
                        String name = rs.getString("username");
                        if(name.equalsIgnoreCase(Username)){
                            c.getPA().sendFrame126("You are buying Item ID: " + id + " Amt: " + amt + " Total Price: " + price, line);
                            line++;
                        } else {
                            c.getPA().sendFrame126("You are buying nothing", line);
                        }
                    }
                    c.getPA().showInterface(13585);
                    c.flushOutStream();
                } catch (Exception e) {
                    e.printStackTrace();
                    con = null;
                    stm = null;
                }
            }
            
            
            public static void writeInterfaceSell(final Client c, final String Username){
                try {
                    String query = "SELECT * FROM sell";
                    ResultSet rs = query(query);
                    int line = 8147;
                    while(rs.next()){
                        int price = Integer.parseInt(rs.getString("price"));
                        int id = Integer.parseInt(rs.getString("itemid"));
                        int amt = Integer.parseInt(rs.getString("amount"));
                        String name = rs.getString("username");
                        if(name.equalsIgnoreCase(Username)){
                            c.getPA().sendFrame126("You are selling Item ID: " + id + " Amt: " + amt + " Total Price: " + price, line);
                        }
                    line++;
                    }
                    c.getPA().showInterface(8134);
                    c.flushOutStream();
                } catch (Exception e) {
                    e.printStackTrace();
                    con = null;
                    stm = null;
                }
            }
    
            /*public static void getCollect1(final Client c, final String Username){
                if(con == null){
                    if(stm != null){
                        try {
                            stm = con.createStatement();
                        } catch(Exception e){
                            con = null;
                            stm = null;
                            //put a sendmessage here telling them to relog in 30 seconds
                            return;
                        }
                    } else {
                        //put a sendmessage here telling them to relog in 30 seconds
                        
                    }
                }
                new Thread(){
                    @Override
                    public void run()
                    {
                        try {
                            String query = "SELECT * FROM collections WHERE username = '"+c.playerName+"'";
                            ResultSet rs = query(query);
                            /**while(rs.next()){
                            if (rs != null && rs.next()) {
                                int id = Integer.parseInt(rs.getString("itemid"));
                                int amt = Integer.parseInt(rs.getString("amount"));
                                String name = rs.getString("username");
                                //int listedprice = Integer.parseInt(rs.getString("price"));
                                /**Buying 100 arrows at 10m....selling 50 arrows at 5m each**/
                                /*if(name.equalsIgnoreCase(Username)){
                                    c.getItems().addItem(id, amt);
                                    c.sendMessage("Successfully collected GE Items.");
                                    query("DELETE FROM `collections` WHERE username = '"+ Username + "' AND `itemid` = '"+id+"' AND `amount` = '"+amt+"'");
                                    }else{
                                    c.sendMessage("@dre@You have nothing to collect!");
                                }
                            } else{
                                c.sendMessage("@dre@You have nothing to collect!");
                            }
                            
                        } catch (Exception e) {
                            e.printStackTrace();
                            con = null;
                            stm = null;
                        }
                    }
                }.start();
            }*/
            public static ResultSet query(String s) throws SQLException {//heres error
                try {
                    if (s.toLowerCase().startsWith("select")) {
                        if(stm == null) {
                            createConnection();
                        }
                        ResultSet rs = stm.executeQuery(s);
                        return rs;
                    } else {
                        if(stm == null) {
                            createConnection();
                        }
                        stm.executeUpdate(s);
                    }
                    return null;
                } catch (Exception e) {
                    e.printStackTrace();
                    con = null;
                    stm = null;
                    
                }
                return null;
            }
            
            public synchronized static void destroyConnection() {
                try {
                    stm.close();
                    con.close();
                } catch (Exception e) {
                    //e.printStackTrace();
                }
            }        
    }
    Change the HOST, DB NAME, DB USERBAME, DB PASS to your host, database name, database user, and the password respectively.

    Now In Clicking Buttons.java under:

    Code:
    switch(actionButtonID)
    ADD:

    Code:
    /*Grand Exchange*/
            case 61037://buy
                c.getPA().updateGE();
                c.getPA().showInterface(15751);
            break;    
            case 61038://sell
                c.getPA().updateGE();
                c.getPA().showInterface(15951);
            break;
            case 61138:
            case 62082:
                c.tempamt += 1;
                c.getPA().updateGE();
            break;    
            case 61139:
            case 62083:
                c.tempamt += 5;
                c.getPA().updateGE();
            break;    
            case 61140:
            case 62084:
                
                c.tempamt += 25;
                c.getPA().updateGE();
            break;
            case 61145:
            case 62089:
                c.tempamt += 1;
                c.getPA().updateGE();
            break;    
            case 61143:
            case 62087:
                c.tempamt -= 1;
                c.getPA().updateGE();
            break;
            case 61146:
            case 62090:
                c.tempprice += 1;
                c.getPA().updateGE();
            break;    
            case 61144:
            case 62088:
                c.tempprice -= 1;
                c.getPA().updateGE();
            break;    
            case 62100:
            case 61156:
                c.tempamt = 0;
                c.tempid = 0;
                c.tempprice = 0;
                c.getPA().showInterface(15651);
                c.getPA().updateGE();
            break;    
            case 61153:
            case 62097:
                c.tempamt = 0;
                c.tempid = 0;
                c.tempprice = 0;
                c.getPA().closeAllWindows();
                c.getPA().updateGE();
            break;    
            case 61137:
                c.getPA().updateGE();
                GrandExchange.createConnection();
                GrandExchange.process(c, c.tempid, c.tempamt, c.tempprice, "buy");
                c.tempamt = 0;
                c.tempid = 0;
                c.tempprice = 0;
                c.getPA().showInterface(15651);
                c.getPA().updateGE();
            break;    
            case 62081:
                c.getPA().updateGE();
                GrandExchange.createConnection();
                GrandExchange.process(c, c.tempid, c.tempamt, c.tempprice, "sell");
                c.tempamt = 0;
                c.tempid = 0;
                c.tempprice = 0;
                c.getPA().showInterface(15651);
                c.getPA().updateGE();
            break;    
            case 61047:
                GrandExchange.createConnection();
                GrandExchange.writeInterfaceSell(c, c.playerName);
            break;    
            case 61051:
                c.getPA().showInterface(16351);
            break;    
            case 61055:
                GrandExchange.createConnection();
                GrandExchange.getCollect(c, c.playerName);
            break;    
            case 61029:
                GrandExchange.createConnection();
                GrandExchange.writeInterfaceBuy(c, c.playerName);
            break;    
            case 61043:
                c.getPA().showInterface(16151);
            break;    
            case 63234:
            case 63034:
                c.getPA().closeAllWindows();
                c.tempid = 0;
            break;    
            case 63028:
                GrandExchange.createConnection();
                GrandExchange.cancelBuy(c, c.tempid);
                c.getPA().showInterface(15651);
            break;    
            case 63228:
                GrandExchange.createConnection();
                GrandExchange.cancelSell(c, c.tempid);
                c.getPA().showInterface(15651);
            break;
    In player.java declare:
    Code:
    public int tempid, tempamt, tempprice;
    In playersave.java:

    Code:
    }  else if(token.equals("tempid")) {
                            p.tempid = Integer.parseInt(token2);
                        }  else if(token.equals("tempamt")) {
                            p.tempamt = Integer.parseInt(token2);
                        }   else if(token.equals("tempprice")) {
                            p.tempprice = Integer.parseInt(token2);
                        }
    And
    Code:
    characterfile.newLine();
                characterfile.write("tempid=", 0, 7);
                characterfile.write(Integer.toString(p.tempid), 0, Integer.toString(p.tempid).length());
                characterfile.newLine();
                characterfile.newLine();
                characterfile.write("tempamt=", 0, 8);
                characterfile.write(Integer.toString(p.tempamt), 0, Integer.toString(p.tempamt).length());
                characterfile.newLine();
                characterfile.newLine();
                characterfile.write("tempprice=", 0, 10);
                characterfile.write(Integer.toString(p.tempprice), 0, Integer.toString(p.tempprice).length());
                characterfile.newLine();
    In the mysql database import:
    Download sql @ UppIT

    EDIT: I forrgot the updatege mehtod.

    In playerAsisstant.java add:

    Code:
     public void updateGE(){
                        	   int amtxprice = c.tempprice * c.tempamt;
                        	   c.getPA().sendFrame126("", 15781);
                        	   c.getPA().sendFrame126("", 15782);
                        	   c.getPA().sendFrame126("", 15783);
                        	   c.getPA().sendFrame126("", 15784);
                        	   c.getPA().sendFrame126("", 16359);
                        	   c.getPA().sendFrame126("Item ID: " + c.tempid, 16359);
                        	   c.getPA().sendFrame126("Amt: " + c.tempamt, 15781);
                        	   c.getPA().sendFrame126("Price: " + c.tempprice, 15782);
                        	   c.getPA().sendFrame126("Total: " + amtxprice, 15783);
                        	   c.getPA().sendFrame126("" + c.tempid, 15784);
                        	   c.getPA().sendFrame126("", 15981);
                        	   c.getPA().sendFrame126("", 15982);
                        	   c.getPA().sendFrame126("", 15983);
                        	   c.getPA().sendFrame126("", 15984);
                        	   c.getPA().sendFrame126("", 16159);
                        	   c.getPA().sendFrame126("Item ID: " + c.tempid, 16159);
                        	   c.getPA().sendFrame126("Amt: " + c.tempamt, 15981);
                        	   c.getPA().sendFrame126("Price: " + c.tempprice, 15982);
                        	   c.getPA().sendFrame126("Total: " + amtxprice, 15983);
                        	   c.getPA().sendFrame126("" + c.tempid, 15984);
                           }
    If you want media:




    Credits:

    -All3n for his promt input tut.
    -All3n for some sprites
    -Jagex for sprites
    -That one person who dumped sprites
    -1776 for helping me with some errors
    -Martin for his auto donation system (this is based off that).
    -Me for making interfaces and the whole g.e base
    Reply With Quote  
     


  2. #2  
    Banned

    Join Date
    Nov 2010
    Age
    29
    Posts
    2,682
    Thanks given
    824
    Thanks received
    404
    Rep Power
    0
    Nice release bro.
    Reply With Quote  
     

  3. #3  
    I'm President Carter


    Join Date
    Jan 2011
    Posts
    1,204
    Thanks given
    17
    Thanks received
    222
    Rep Power
    144
    Won't use but good job


    Reply With Quote  
     

  4. #4  
    RevolutionX PK
    All3n's Avatar
    Join Date
    Jul 2010
    Posts
    1,172
    Thanks given
    1,380
    Thanks received
    527
    Rep Power
    982
    Won't use but looks nice ;] Should add a preview vid or pics.
    Also good to see my tut is actually being put to good use.
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Dec 2010
    Posts
    437
    Thanks given
    14
    Thanks received
    49
    Rep Power
    31
    Very nice

    Ill try this out.
    Reply With Quote  
     

  6. #6  
    GANGNAM STYLE!

    Ohad's Avatar
    Join Date
    Aug 2011
    Posts
    3,179
    Thanks given
    152
    Thanks received
    352
    Rep Power
    1671
    nice release!! good job
    hmmm i get this errors...(client sided..)
    am i suppose to already have those interfaces?
    Code:
    Java\RSInterface.java:5957: error: cannot find symbol
                addHoverButton1(16156, "Interfaces/clanCreation/SPRITE", 5, 129, 61,
     "Confirm Cancel", 16157, 1);
                ^
      symbol:   method addHoverButton1(int,String,int,int,int,String,int,int)
      location: class RSInterface
    Java\RSInterface.java:5984: error: cannot find symbol
                addHoverButton1(16356, "Interfaces/clanCreation/SPRITE", 5, 129, 61,
     "Confirm Cancel", 16357, 1);
                ^
      symbol:   method addHoverButton1(int,String,int,int,int,String,int,int)
      location: class RSInterface
    Note: Java\client.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    2 errors
    Press any key to continue . . .
    Reply With Quote  
     

  7. #7  
    Banned
    Join Date
    Dec 2011
    Posts
    8
    Thanks given
    0
    Thanks received
    17
    Rep Power
    0
    Thanks everyone
    Reply With Quote  
     

  8. #8  
    Registered Member
    Kobra's Avatar
    Join Date
    Dec 2009
    Posts
    652
    Thanks given
    215
    Thanks received
    84
    Rep Power
    88
    Oh Nice release.
    Reply With Quote  
     

  9. #9  
    Dr. Jaegon


    Join Date
    Sep 2011
    Posts
    2,132
    Thanks given
    407
    Thanks received
    441
    Rep Power
    2559
    Missing a few methods, but nice
    Reply With Quote  
     

  10. #10  
    Banned

    Join Date
    Jul 2011
    Age
    30
    Posts
    745
    Thanks given
    2,207
    Thanks received
    451
    Rep Power
    0
    Bravo dude
    Reply With Quote  
     

Page 1 of 11 123 ... LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 19
    Last Post: 10-21-2015, 03:37 PM
  2. Replies: 5
    Last Post: 09-11-2010, 09:45 PM
  3. 317 Grand Exchange 2.0 - The Mini Exchange
    By Bulby Strife in forum Show-off
    Replies: 34
    Last Post: 07-25-2010, 08:36 PM
  4. Grand Exchange base [508]
    By Sheddy in forum Requests
    Replies: 1
    Last Post: 12-15-2009, 06:56 AM
  5. ~~Base of Grand Exchange~~
    By green0981 in forum Tutorials
    Replies: 30
    Last Post: 10-24-2008, 02:30 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •