From 81ae31ac20b14e7f6941369b352ceaccc1df3a13 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Sun, 17 Nov 2019 01:14:17 +0100 Subject: [PATCH] added the top 3 cheapest auctions and fixed a bug with the time left shown in minutes instead of seconds --- bin/main/Auction.class | Bin 3518 -> 3761 bytes bin/main/Main.class | Bin 12327 -> 13870 bytes bin/main/MainWindow$2.class | Bin 1646 -> 1646 bytes bin/main/MainWindow$3.class | Bin 921 -> 921 bytes bin/main/MainWindow$4.class | Bin 918 -> 918 bytes bin/main/MainWindow$5.class | Bin 1232 -> 1232 bytes bin/main/MainWindow$6.class | Bin 943 -> 943 bytes bin/main/MainWindow.class | Bin 8795 -> 8818 bytes src/main/Auction.java | 14 +++++++++-- src/main/Main.java | 48 ++++++++++++++++++++++++++++++------ src/main/MainWindow.java | 4 ++- 11 files changed, 56 insertions(+), 10 deletions(-) diff --git a/bin/main/Auction.class b/bin/main/Auction.class index cf85b93a64451ff191d114edcf0daeeecc8f38ab..c5d83cc1a880e2106654d8adb7d1bf4142a2f5d6 100644 GIT binary patch literal 3761 zcmZ`+S#uOs6#hDy%w}gXWI;rjV3tWIAz~>;6QY116GIRKQ8r^|(j<*DJ#nT7cSXe= zmsfrB$rr7XDl%ADW$CNG!v}r$)#W?4JDHwNhbrc-=iKjn=iKjhe*gE*F906GR|zy} z(2J(+j32J%UAyEY5Yy0c#k^{c7ffem{M6DFEAMKERjc;0hR)gg(!5)?os~%qY16Z{ ztg?ob?OMe}$1Ga(Tyf2^%T0?*Vyw;3!K%HoYE@jBSu~5Kszc{#Ws~;?T24cYGStv) zIkZc;c9AA#aZN*f%64pbTEpYntx&ek%*@P0Oy*{W7Z}pf(z2CCGrD!$jUJws9bQO7 z!%iLdV3&qO#d6Q8u)8A;^Y-r6ai8pMEmR_HZcCUB8jt;Lkpd*R6 ztPbh8%bOe4k@9*YI&`#ZXrHwmYpz;cvdU-7r2;AKoGsBJvC9DbZY-<#iF5Io@E_-r>gb#~ zQ_qFY`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_>xO6cQ6fEwE95CEr2RPifEm<$)vIYV=fQib&6V)$fG|7Y+E!r`;7INZuWG$% zWbJ{&MXyEh56!fGNf}sTyi&tD8t)sRvqHwqsM&$b0jfr)!-PL}@!M5HRY$$J1s;To zhfH<6y_9_1RL2fsz3MpB0I%Ev&SKE0MrrTjzo0#Sa6y`REz$Gm+ai2u=TA&g4mI^( zteX;r%g}}_BU+f4HGUtTs?G1@PthvR)D|RWb@D%D((sh%!CGIO#e*CEb2Q6Eg}%5L zpRFBj6I*)TLtp$FzV7i^(LgU;6T{34=rFwb68!iwdhij-!mk)P^eW}iYgC5!3=BI} z^ajnwk0$E+m}(A=s7wJ``<@*W6PsZtvCOBGq&!0#;WW8oCtgy z^odvrYE`C%X&Wg&eIq3m#>9|P#m?=VWq8FP!SH&rFS92AlRXK! delta 27 jcmbQnK8=0DXC}sHlfN(paK2#RWq8RT!SHIbFS92AlMe~C diff --git a/bin/main/MainWindow$5.class b/bin/main/MainWindow$5.class index 763a272f28dd5bba4c5cdfd9e3fbbeea9f912bc8..8c07c0c8b44e3ad453c2cbd77558d4714a7344ac 100644 GIT binary patch delta 23 fcmcb>d4Y3-8Vlpc$?7aAte+Wl7`{xNz~TS^Wcmmo delta 23 fcmcb>d4Y3-8Vlox$?7aAte+Tk7(P#)z~TS^WZeiI diff --git a/bin/main/MainWindow$6.class b/bin/main/MainWindow$6.class index 67319cd736ff21d0ed5319b56ba472d8fe1c05a0..42fb472e234d9f7e0c57f6c9a0421c7e42e20588 100644 GIT binary patch delta 37 scmZ3_zMg%^Vo&4(GvI1v71E?R`pP)ZbKHnW~ZJC{ML7-|vyg7T6C zL7Rf01hp9^k|wI5urNt*S1u${2_iFyB7@$t&E?z!_qpf1%dBL^cGty+h_eCQ{bE<$ zy!Zp#Bj1%sI9F!6csOxG?E-nfP+uvmGOFtt*BTz^4vN}DN!uvvejaKsk2K4K=6S3G zRMhiCZ}C(|c%~(uYlW&#@$aPDDJ1RR}RvKMicDVs*a%ZI3 zotKmwlooeW((axdqyy+#>&zZH!`AO|a*>S)Ra=rvK`BdCmCGbCN!vNO!saASZd**Q z26LUx`jKRZ^!l0F8viYsk|RNF^{vsS_}Or*0ov{}QR+~-BrWx286FRg(jI2?_q7}+ nCVgy?6Ks=y8ssD?$;^+R`G6>H#z3xjeUOrmF;T4 delta 423 zcmXYsPe{{o7{;IXeZRHlItbZp%5P3F`b|h^nqi(4MGwK|oE>(EI_xOeP3kc4Fj@^S z-$AENGw2d){%{sKZT+F5Ms?}Xx~xt-^FB+T_W7LizAVcuF6ytXrQ~nq*@Xfh#RB``a1e`p21OpieGcOR$MKL8 zSmq2$d=smD8;|%d%3Q=_F5@Xz@QmN%Ie*3r-oi`%iC02+EjB9BgEumWw-P~BF5sg~ z;gif@O;T8wIc&%+Y$xRozKMhH@&P;Y1$(lKU#boJs+%m;Pi<4)Sp&N!2d2&LO zF?fJ0ddUjWn11JN(tj+Q&KWwQ&-xF$FB_T7)1VIf?SX a.getHighest_bid_amount() / a.getItem_count()).sum(); if (count > 0) { + printCheapest(3, filterCT, CT, matchCase, filterSL, SL, filterTT, TT, filterHB, HB); consoleOut("Average: " + (sum / count) + " coins\n"); consoleOut("Maximum: " + (filterStream(data.stream(), filterCT, CT, matchCase, filterSL, SL, filterTT, TT, filterHB, HB) @@ -102,6 +103,19 @@ public static void filterData(boolean filterCT, String CT, boolean matchCase, bo updateConsoleOut(); } + private static void printCheapest(int topX, boolean filterCT, String CT, boolean matchCase, boolean filterSL, + int SL, boolean filterTT, int TT, boolean filterHB, int HB) { + long count = (filterStream(data.stream(), filterCT, CT, matchCase, filterSL, SL, filterTT, TT, filterHB, + HB).sorted(new CompHighestBidAsc())).filter(a -> a.getSeconds_left() > 5).count(); + for (int i = 0; i < topX && i < count; i++) { + Auction min = (filterStream(data.stream(), filterCT, CT, matchCase, filterSL, SL, filterTT, TT, filterHB, + HB).sorted(new CompHighestBidAsc())).filter(a -> a.getSeconds_left() > 5).skip(i).findFirst().get(); + String cheapestAuctioneer = getPlayerFromUUID(min.getAuctioneer()); + consoleOut("Minimum " + (i + 1) + ": " + min.getHighest_bid_amount() + " coins" + " by " + + cheapestAuctioneer + " " + min.getSeconds_left() + "sec left" + "\n"); + } + } + private static Stream filterStream(Stream s, boolean filterCT, String CT, boolean matchCase, boolean filterSL, int SL, boolean filterTT, int TT, boolean filterHB, int HB) { return s.filter(a -> !filterCT || (matchCase ? a.getItem_name().equalsIgnoreCase(CT) @@ -126,7 +140,7 @@ public void run() { } mw.getSp().getVerticalScrollBar().setValue(mw.getSp().getVerticalScrollBar().getMaximum()); mw.getSp().paint(mw.getSp().getGraphics()); - mw.getBtnFilterButton().setEnabled(true); + //mw.getBtnFilterButton().setEnabled(true); }; }; t.start(); @@ -149,7 +163,7 @@ private static void loadPage(int page) { JSONObject obj = new JSONObject(out); long timestamp = obj.getLong("lastUpdated"); max_pages = obj.getInt("totalPages"); - mw.getBtnFilterButton().setEnabled(false); + //mw.getBtnFilterButton().setEnabled(false); for (Auction a : data) { a.setTimestamp(timestamp); } @@ -160,13 +174,14 @@ private static void loadPage(int page) { String item_bytes = auction.getString("item_bytes"); int item_count = itemCountFromItemBytes(item_bytes); String uuid = auction.getString("uuid"); + String auctioneer = auction.getString("auctioneer"); long start = auction.getLong("start"); long end = auction.getLong("end"); long highest_bid_amount = auction.getLong("highest_bid_amount"); long starting_bid = auction.getLong("starting_bid"); // TODO maybe add more detail to the auction objects - Auction addition = new Auction(uuid, start, end, timestamp, item_name, highest_bid_amount, item_count, - starting_bid); + Auction addition = new Auction(uuid, auctioneer, start, end, timestamp, item_name, highest_bid_amount, + item_count, starting_bid); int tmp = data.indexOf(addition); if (tmp < 0) data.add(addition); @@ -176,7 +191,26 @@ private static void loadPage(int page) { data.get(tmp).setHighest_bid_amount(highest_bid_amount); } } - mw.getBtnFilterButton().setEnabled(true); + //mw.getBtnFilterButton().setEnabled(true); + } + + private static String getPlayerFromUUID(String uuid) { + URL url; + String out = ""; + try { + url = new URL("https://api.hypixel.net/player?key=" + api_key + "&uuid=" + uuid); + HttpsURLConnection con = (HttpsURLConnection) url.openConnection(); + out = getContent(con); + } catch (MalformedURLException e) { + consoleOut("[ FAILURE ] Some internet connection problem!\n"); + e.printStackTrace(); + } catch (IOException e) { + consoleOut("[ FAILURE ] Some internet connection problem!\n"); + e.printStackTrace(); + } + JSONObject obj = new JSONObject(out); + JSONObject player = obj.getJSONObject("player"); + return player.getString("playername"); } private static int itemCountFromItemBytes(String s) { diff --git a/src/main/MainWindow.java b/src/main/MainWindow.java index 976fcd5..bde4629 100644 --- a/src/main/MainWindow.java +++ b/src/main/MainWindow.java @@ -171,10 +171,11 @@ public void keyPressed(KeyEvent e) { panel_1.add(checkBox_SL, "cell 5 4"); spinner_SL = new JSpinner(); - spinner_SL.setModel(new SpinnerNumberModel(new Integer(10), new Integer(0), null, new Integer(1))); + spinner_SL.setModel(new SpinnerNumberModel(new Integer(1), new Integer(0), null, new Integer(1))); panel_1.add(spinner_SL, "cell 6 4 6 1,growx"); chckbxMinutesSL = new JCheckBox("Minutes"); + chckbxMinutesSL.setSelected(true); chckbxMinutesSL.setToolTipText(""); panel_1.add(chckbxMinutesSL, "cell 12 4 5 1"); @@ -338,6 +339,7 @@ private void enableButtons(boolean lock) { btn_multireq.setEnabled(lock); chckbxKeepOldData.setEnabled(lock); btnSendRequest.setEnabled(lock); + btnFilterButton.setEnabled(lock); } }