eoakley / artifacthelper Goto Github PK
View Code? Open in Web Editor NEWHelps you pick cards in draft mode on Valve's Artifact game. Made with Python.
License: GNU General Public License v3.0
Helps you pick cards in draft mode on Valve's Artifact game. Made with Python.
License: GNU General Public License v3.0
Hello, I know that you're only supporting 16:9 right now but I managed to make it work on my own so here is some insight that may help you supporting 3440x1440 resolution (21:9).
First here is the debug image:
At first the error message itself wasn't displaying (cropped in the center):
I have hard-coded the top_border, left_border, right_border (why don't you rely on presets instead of your calculations?) and changed the root.geometry() values and it fixed it:
Please find my modifications and values in this commit.
It's my first time with a python project, but if I can help you in any way, let me know.
When I'm trying to run program nothing happenes.
At log file:
Traceback (most recent call last):
File "E:\Users\Gamer\AppData\Local\Artifact Helper\Artifact_Helper.launch.pyw", line 31, in
from artifact_helper import main
File "E:\Users\Gamer\AppData\Local\Artifact Helper\pkgs\artifact_helper.py", line 7
^
SyntaxError: invalid syntax
My system: windows 7, two monitors, resolutions: 1920x1080 and 1600x1200. Artifact on first one with resolution 1440x960 16:10 borderless.
good day! if the system includes scaling fonts, and at 4k is usually enabled, the program does not work. Thanks you
Still only workinng on version 0.6. Tried the new feature "Custom Grid" and it still doesnt detect cards.
Dont know if its intended but when i set a new custom grid it only shows a black screen, not like the png your guys showed.
Collected, 200 prices.
Collected, 237 prices.
Screenshot of the game
SS saved to file D:\l\ArtifactHelper2\screenshot_draft.png
Launching Grid Selector
Deleted file D:\l\ArtifactHelper2\custom_grid.npy
Creating overlay with size: 2560 1440
Detecting grid once... (1440, 2560, 3)
['Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card']
Borders: (360, 853, 1280)
Screenshot of the game
SS saved to file D:\l\ArtifactHelper2\screenshot_draft.png
Launching Grid Selector
Grid selected manually and saved to file "D:\l\ArtifactHelper2\custom_grid.npy"
It will be loaded automatically when you scan cards.
Creating overlay with size: 2560 1440
Custom Grid file exists: D:\l\ArtifactHelper2\custom_grid.npy
Using custom grid with borders: [110, 160, 1810]
['Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card']
Borders: [110, 160, 1810]
Using custom grid with borders: [110, 160, 1810]
['Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card']
Borders: [110, 160, 1810]
Using custom grid with borders: [110, 160, 1810]
['Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card']
Borders: [110, 160, 1810]
Using custom grid with borders: [110, 160, 1810]
['Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card']
Borders: [110, 160, 1810]
Using custom grid with borders: [110, 160, 1810]
Using custom grid with borders: [110, 160, 1810]
['Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card']
Borders: [110, 160, 1810]
Using custom grid with borders: [110, 160, 1810]
['Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card']
Borders: [110, 160, 1810]
Using custom grid with borders: [110, 160, 1810]
['Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card']
Borders: [110, 160, 1810]
Using custom grid with borders: [110, 160, 1810]
Using custom grid with borders: [110, 160, 1810]
['Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card']
Borders: [110, 160, 1810]
['Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card']
Borders: [110, 160, 1810]
Screenshot of the game
SS saved to file D:\l\ArtifactHelper2\screenshot_draft.png
Launching Grid Selector
Grid selected manually and saved to file "D:\l\ArtifactHelper2\custom_grid.npy"
It will be loaded automatically when you scan cards.
Creating overlay with size: 2560 1440
Custom Grid file exists: D:\l\ArtifactHelper2\custom_grid.npy
Using custom grid with borders: [105, 160, 1813]
['Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card']
Borders: [105, 160, 1813]
Using custom grid with borders: [105, 160, 1813]
['Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card']
Borders: [105, 160, 1813]
Using custom grid with borders: [105, 160, 1813]
['Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card']
Borders: [105, 160, 1813]
Creating overlay with size: 2560 1440
Custom Grid file exists: D:\l\ArtifactHelper2\custom_grid.npy
Using custom grid with borders: [105, 160, 1813]
['Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card']
Borders: [105, 160, 1813]
Using custom grid with borders: [105, 160, 1813]
['Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card']
Borders: [105, 160, 1813]
Using custom grid with borders: [105, 160, 1813]
['Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card']
Borders: [105, 160, 1813]
Using custom grid with borders: [105, 160, 1813]
['Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card']
Borders: [105, 160, 1813]
Using custom grid with borders: [105, 160, 1813]
['Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card', 'Empty Card']
Borders: [105, 160, 1813]
[EDIT]
Version 0.6 screen_shot_debugg.png
When I switching from the Launch Window to the overlay, the window doesn't move and so the overlay is offset towards the bottom right (depending on the position of the original window). These screenshots demonstrate it.
Notice the position of the top left corner of the launch window:
Notice the the overlay is starting at that same location:
(Also of note, the overlay is in the screenshot, so it covers up the names of some cards which aren't recognised. The overlay in this position would actually cause the right_border
to fail, but I hard coded that during theses tests.)
If I move the Launch Window, launch the Overlay, then close the Overlay, the Launch Window does return to its hard coded size/location.
It looks like this root.geometry()
call is failing to set the position. No matter what numbers I put in place of (100, 0)
, the overlay origin is always the same as the top left of the launch window.
As a workaround I position the launch window at (100, 0)
on line 280 and don't move it.
Still doesn't work on my computer.
My system: windows 7, two monitors, resolutions: 1920x1080 and 1600x1200. Artifact on first one with resolution 1440x960 16:10 borderless.
Now without any error messages, Only after push the button "Scan Cards" nothing happens.
the percentages are not one the cards. they divide the screen into 6 parts and each percentage has its own
I have some issues with "borderless window" mode (artifacthelper doesn't stay on top and disappear when clicking on cards). I tried to find why it wasn't working on "windowsed" mode.
In fact, on windowsed mode there is a little black offset captured with the screen that is messing up with the detection process:
Adding this offset to the grid positioning makes artifacthelper working on "windowsed" mode. :)
If those modes can't be detected by the app, maybe it could be interesting to provide an app-setting to handle both cases?
The new dragging feature could be improved to provide a fully user-configurable way of working. Instead of having a drag handle that is always visible, have a "configure" button that switches to "configure mode". While in configure mode, draw a box around the border of the windows and provide handles in the corners. Ask the user to position the box so that all of the cards are inside the box and the banner is above them. Then the detection algorithm can find the exact edges.
The top left handle could act like the drag currently does, and the bottom right handle could scale the rectangle, maintaining the aspect ratio.
This method should work for any configuration that cannot be predicted (like running in a small window) so it might be useful to have, even if all of the common configurations work out of the box.
Hey there,
I'm somewhat confused. In 232a59b you changed the tier list from a static text file to an URL.
In 0963c41 the file (which I though was obsolete now) was modified, but only the Jasper Daggers changed. What about the changes to the heroes?
https://raw.githubusercontent.com/eoakley/artifactscraping/master/tier_list.txt seems to be old as well.
Is there a reason for the existance of both files, or should one be removed?
File "artifact_helper.py", line 243, in main
root.iconbitmap(path('favicon.ico'))
i can now set up a custom grid that works, but only by dragging off the popup screen, which is too zoomed in
afterward it seems to detect cards properly, but doesn't display them in the right places
setup
"Error detecting cards. Are you on draft screen? Try Customizing Grind. Saved screenshot_debugg.png on installation dir."
Still doesn't work on my computer.
Did Grid about 20 times, cant find cards anyway.
It is difficult to make a grid, because the artifact application is under the grid, and you can’t see where to drag, you have to hold your finger to the point where to drag, which makes the process much less accurate.
Log file is empty, screenshots in attach.
My system: windows 7, two monitors, resolutions: 1920x1080 and 1600x1200. Artifact on first one with resolution 1440x960 16:10 borderless.
Case 1 Laptop: tried using both 1360x768 and 1280x720 resolutions (yes, borderless windowed was on), get an error either way
Case 2 Desktop: dual monitor setup, one monitor running on 1920x1080 (16:9) native, second monitor running on 1680x1050 (16:10) native, game is ran on the 16:9 monitor, I don't get any error message,but nothing happens either (note: there is no error message regardless on which screen I am)
As title, it works on my second monitor when i move artifact there, but not my primary one.
Both screens are running 1920x1080.
As a follow-up to #13, version v0.9 still isn't working. I tried running from master too (4eaecc0) and it's not working either. Here's the output I get from master (after the price collection) from starting the overlay and clicking on "Scan Cards" a couple of times:
Detecting grid once... (1080, 1920, 3)
It worked! At least one card is not empty.
['Empty Slot', 'Empty Slot', 'Empty Slot', 'Empty Slot', 'Empty Slot', 'Empty Slot', 'Empty Slot', 'Empty Slot', 'Empty Slot', 'Empty Slot', 'Empty Slot', 'Empty Slot'] (270, 640, 960)
It worked! At least one card is not empty.
['Empty Slot', 'Empty Slot', 'Empty Slot', 'Empty Slot', 'Empty Slot', 'Empty Slot', 'Empty Slot', 'Empty Slot', 'Empty Slot', 'Empty Slot', 'Empty Slot', 'Empty Slot'] (270, 640, 960)
It worked! At least one card is not empty.
['Empty Slot', 'Empty Slot', 'Empty Slot', 'Empty Slot', 'Empty Slot', 'Empty Slot', 'Empty Slot', 'Empty Slot', 'Empty Slot', 'Empty Slot', 'Empty Slot', 'Empty Slot'] (270, 640, 960)
#################################################################################################################################
#################################################################################################################################
#card name; tier; tier rank; custom rank
Abaddon;C;14;
Axe;S;1;
Beastmaster;B;2;
Bloodseeker;C;2;
Bounty Hunter;A;5;
Bristleback;B;1;
Centaur Warrunner;C;7;
Chen;B;5;
Crystal Maiden;D;1;
Dark Seer;C;1;
Debbi the Cunning;C;2;
Drow Ranger;S;2;
Earthshaker;B;14;
Enchantress;B;3;
Farvhan the Dreamer;C;5;
J'Muy the Wise;C;4;
Kanna;S;3;
Keefe the Bold;D;11;
Legion Commander;S;6;
Lich;S;4;
Lion;D;4;
Luna;B;4;
Lycan;A;2;
Magnus;B;8;
Mazzie;C;3;
Meepo;F;2;
Necrophos;C;6;
Ogre Magi;A;6;
Omniknight;A;3;
Outworld Devourer;F;4;
Phantom Assassin;A;2;
Prellex;C;13;
Pugna;D;3;
Rix;F;3;
Skywrath Mage;C;10;
Sniper;A;7;
Sorla Khan;A;1;
Storm Spirit;F;1;
Sven;C;9;
Tidehunter;D;12;
Timbersaw;C;10;
Tinker;S;3;
Treant Protector;A;8;
Ursa;B;7;
Venomancer;B;7;
Viper;D;9;
Winter Wyvern;C;3;
Zeus;B;8;
#################################################################################################################################
#card name; tier; tier rank; custom rank
...And One For Me;C;10;
Aghanim's Sanctum;A;6;
Altar of the Mad Moon;C;25;
Annihilation;S;4;
Arcane Assault;C;9;
Arcane Censure;F;12;
Arm the Rebellion;A;25;
Assassin's Apprentice;B;23;
Assassin's Shadow;B;38;
Assured Destruction;D;22;
At Any Cost;A;4;
Avernus' Blessing;C;19;
Bellow;D;28;
Better Late Than Never;D;12;
Bitter Enemies;D;21;
Bolt of Damocles;B;37;
Bronze Legionnaire;A;7;
Burning Oil;B;28;
Buying Time;D;13;
Call the Reserves;D;18;
Caught Unprepared;C;7;
Champion of the Ancient;B;2;
Cheating Death;B;12;
Cleansing Rite;F;13;
Clear The Deck;B;16;
Collateral Damage;D;25;
Combat Training;C;20;
Compel;B;6;
Conflagration;S;8;
Coordinated Assault;A;23;
Corrosive Mist;C;24;
Crippling Blow;D;7;
Cunning Plan;B;7;
Curse of Atrophy;C;27;
Cursed Satyr;C;17;
Defend the Weak;B;34;
Defensive Bloom;B;26;
Defensive Stance;F;1;
Diabolic Revelation;D;10;
Dimensional Portal;A;1;
Dirty Deeds;F;9;
Disciple of Nevermore;A;13;
Divine Intervention;B;14;
Divine Purpose;D;32;
Emissary of the Quorum;S;5;
Enough Magic!;B;29;
Escape Route;C;22;
Fight Through The Pain;D;1;
Fog of War;D;16;
Foresight;B;5;
Forward Charge;D;23;
Fractured Timeline;C;11;
Friendly Fire;A;8;
Gank;A;15;
Glyph of Confusion;D;19;
Grand Melee;F;2;
Grazing Shot;C;18;
Hellbear Crippler;B;39;
Heroic Resolve;D;3;
Hip Fire;B;13;
Homefield Advantage;B;31;
Howling Mind;D;14;
Incarnation of Selemene;B;10;
Intimidation;B;33;
Iron Branch Protection;D;29;
Iron Fog Goldmine;A;9;
Juke;D;27;
Keenfolk Golem;C;26;
Keenfolk Turret;B;15;
Legion Standard Bearer;A;29;
Lightning Strike;C;16;
Lodestone Demolition;F;10;
Lost in Time;B;32;
Marrowfell Brawler;A;18;
Mercenary Exiles;A;28;
Messenger Rookery;B;27;
Mist of Avernus;S;1;
Murder Plot;B;3;
New Orders;C;14;
Oglodi Catapult;F;8;
Oglodi Vandal;A;16;
Ogre Conscript;A;12;
Ogre Corpse Tosser;B;21;
Path of the Bold;D;5;
Path of the Cunning;F;11;
Path of the Dreamer;D;30;
Path of the Wise;D;15;
Payday;B;19;
Pick A Fight;C;15;
Pick Off;A;22;
Pit Fighter of Quoidge;B;22;
Poised to Strike;D;2;
Rampaging Hellbear;C;4;
Ravenhook;D;26;
Ravenous Mass;C;21;
Raze;D;8;
Rebel Decoy;B;1;
Rebel Instigator;C;2;
Red Mist Pillager;A;3;
Relentless Pursuit;B;9;
Relentless Zombie;C;3;
Remote Detonation;B;30;
Rend Armor;F;3;
Restoration Effort;F;14;
Revtel Convoy;A;27;
Revtel Investments;C;8;
Rising Anger;D;4;
Rolling Storm;F;6;
Roseleaf Rejuvenator;B;11;
Routed;D;9;
Rumusque Blessing;A;20;
Satyr Duelist;B;20;
Satyr Magician;B;8;
Selemene's Favor;B;18;
Self Sabotage;D;17;
Selfish Cleric;A;24;
Sister of the Veil;B;25;
Slay;B;4;
Smash Their Defenses!;B;35;
Smeevil Armsmaster;C;6;
Smeevil Blacksmith;D;31;
Soul of Spring;A;5;
Spot Weakness;C;23;
Spring the Trap;S;6;
Stars Align;C;13;
Steal Strength;A;19;
Steam Cannon;A;21;
Stonehall Elite;A;2;
Strafing Run;D;11;
Sucker Punch;C;5;
Temple of War;D;6;
The Cover of Night;C;28;
The Oath;A;10;
The Omexe Arena;B;17;
The Tyler Estate;D;24;
Thunderhide Alpha;B;24;
Thunderhide Pack;A;14;
Thunderstorm;A;11;
Time of Triumph;S;3;
Tower Barrage;B;36;
Trebuchets;D;20;
Tresdin's Standards;A;17;
Troll Soothsayer;A;26;
Tyler Estate Censor;S;7;
Unearthed Secrets;S;2;
Unsupervised Artillery;C;29;
Untested Grunt;C;30;
Ventriloquy;C;1;
Vhoul Martyr;C;12;
Watchtower;F;4;
Whispers of Madness;F;5;
Wrath of Gold;F;7;
#################################################################################################################################
#card name; tier; tier rank; custom rank
Apotheosis Blade;U;19;
Assassin's Veil;C;9;
Barbed Mail;U;2;
Blade of the Vigil;U;3;
Blink Dagger;A;2;
Book of the Dead;U;9;
Bracers of Sacrifice;B;8;
Broadsword;C;6;
Chainmail;U;4;
Claszureme Hourglass;B;2;
Claymore;U;13;
Cloak of Endless Carnage;U;12;
Demagicking Maul;B;1;
Fur-lined Mantle;C;3;
Golden Ticket;B;9;
Helm of the Dominator;B;1;
Hero's Cape;U;14;
Horn of the Alpha;B;4;
Jasper Daggers;B;6;
Keenfolk Musket;C;8;
Keenfolk Plate;U;7;
Leather Armor;C;11;
Nyctasha's Guard;U;20;
Obliterating Orb;U;10;
Phase Boots;C;2;
Platemail;U;15;
Poaching Knife;C;10;
Red Mist Maul;C;3;
Revtel Signet Ring;A;3;
Ring of Tarrasque;U;11;
Ristul Emblem;U;1;
Rumusque Vestments;U;8;
Seraphim Shield;C;6
Shield of Aquila;C;4;
Shield of Basilius;C;5;
Shiva's Guard;U;16;
Shop Deed;U;18;
Short Sword;B;5;
Stonehall Cloak;A;1;
Stonehall Pike;C;7;
Stonehall Plate;B;7;
Traveler's Cloak;A;4;
Vesture of the Tyrant;B;5;
Wingfall Hammer;U;17;
#################################################################################################################################
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.