Commit 8c5067e4 authored by 12Ghast's avatar 12Ghast

Merge branch 'gloves' into 'master'

Added glove cases

- Included glove, clutch and hydra cases

See merge request !6
parents 21346904 10adffe3
Pipeline #83 passed with stages
in 2 minutes and 5 seconds
......@@ -5,7 +5,7 @@ psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-E
CREATE TABLE weapons (
name VARCHAR(64) UNIQUE NOT NULL,
weapon_type VARCHAR(16) NOT NULL,
subweapon_type VARCHAR(16) NOT NULL,
subweapon_type VARCHAR(32) NOT NULL,
exterior VARCHAR(16) NOT NULL,
rarity VARCHAR(16) NOT NULL,
price_daily REAL,
......
......@@ -53,7 +53,7 @@
<td class="column100 column6" data-column="column6">${{ '%0.2f' % data[case_name]["data"]["Covert"] }}</td>
<td class="column100 column7" data-column="column7">${{ '%0.2f' % data[case_name]["data"]["Special"] }}</td>
<td class="column100 column8" data-column="column8">${{ '%0.2f' % data[case_name]["meta"]["ev"] }}</td>
<td class="column100 column8" data-column="column8">{{ '%0.2f' % (data[case_name]["meta"]["roi"]*100) }}%</td>
<td class="column100 column9" data-column="column9">{{ '%0.2f' % (data[case_name]["meta"]["roi"]*100) }}%</td>
</tr>
{% endfor %}
</tbody>
......
......@@ -38,6 +38,7 @@ class Container():
self.skins = []
# Initialise all knives
for knife_type in [
"Bayonet",
......@@ -100,6 +101,7 @@ for case_name in [
"Chroma Case",
"Chroma 2 Case",
"Chroma 3 Case",
"Clutch Case",
"CS20 Case",
"Danger Zone Case",
"eSports 2013 Case",
......@@ -108,10 +110,12 @@ for case_name in [
"Falchion Case",
"Gamma Case",
"Gamma 2 Case",
"Glove Case",
"Horizon Case",
"Huntsman Weapon Case",
"Operation Bravo Case",
"Operation Breakout Weapon Case",
"Operation Hydra Case",
"Operation Phoenix Weapon Case",
"Operation Vanguard Weapon Case",
"Operation Wildfire Case",
......@@ -226,6 +230,26 @@ for weapon in [
Skin("Sawed-Off | Fubar", (0.4, 1)),
]:
Container.hashmap["Chroma 3 Case"].skins.append(weapon)
for weapon in [
Skin("M4A4 | Neo-Noir", (0, 0.9)),
Skin("MP7 | Bloodsport", (0, 0.65)),
Skin("USP-S | Cortex", (0, 1)),
Skin("AWP | Mortis", (0, 0.64)),
Skin("AUG | Stymphalian", (0, 0.63)),
Skin("Glock-18 | Moonrise", (0, 0.65)),
Skin("UMP-45 | Arctic Wolf", (0, 0.8)),
Skin("MAG-7 | SWAG-7", (0, 0.92)),
Skin("Negev | Lionfish", (0, 0.55)),
Skin("Nova | Wild Six", (0, 0.8)),
Skin("SG 553 | Aloha", (0, 0.55)),
Skin("MP9 | Black Sand", (0, 1)),
Skin("R8 Revolver | Grip", (0, 1)),
Skin("Five-SeveN | Flame Test", (0, 0.65)),
Skin("P2000 | Urban Hazard", (0, 1)),
Skin("PP-Bizon | Night Riot", (0, 0.8)),
Skin("XM1014 | Oxide Blaze", (0, 0.7)),
]:
Container.hashmap["Clutch Case"].skins.append(weapon)
for weapon in [
Skin("AWP | Wildfire", (0.01, 0.7)),
Skin("FAMAS | Commemoration", (0, 0.5)),
......@@ -372,6 +396,26 @@ for weapon in [
Skin("Five-SeveN | Scumbria", (0, 1)),
]:
Container.hashmap["Gamma 2 Case"].skins.append(weapon)
for weapon in [
Skin("M4A4 | Buzz Kill", (0, 0.7)),
Skin("SSG 08 | Dragonfire", (0, 0.5)),
Skin("FAMAS | Mecha Industries", (0, 0.5)),
Skin("P90 | Shallow Grave", (0, 0.75)),
Skin("Sawed-Off | Wasteland Princess", (0, 0.7)),
Skin("USP-S | Cyrex", (0, 0.55)),
Skin("M4A1-S | Flashback", (0, 1)),
Skin("Dual Berettas | Royal Consorts", (0, 1)),
Skin("Nova | Gila", (0, 0.3)),
Skin("G3SG1 | Stinger", (0, 0.7)),
Skin("Glock-18 | Ironwork", (0, 1)),
Skin("MP7 | Cirrus", (0, 0.75)),
Skin("Galil AR | Black Sand", (0, 1)),
Skin("P2000 | Turf", (0, 1)),
Skin("MP9 | Sand Scale", (0, 0.45)),
Skin("MAG-7 | Sonar", (0, 0.45)),
Skin("CZ75-Auto | Polymer", (0, 0.5)),
]:
Container.hashmap["Glove Case"].skins.append(weapon)
for weapon in [
Skin("AK-47 | Neon Rider", (0, 0.8)),
Skin("Desert Eagle | Code Red", (0, 1)),
......@@ -445,6 +489,26 @@ for weapon in [
Skin("Negev | Desert-Strike", (0, 0.5)),
]:
Container.hashmap["Operation Breakout Weapon Case"].skins.append(weapon)
for weapon in [
Skin("AWP | Oni Taiji", (0, 0.5)),
Skin("Five-SeveN | Hyper Beast", (0, 1)),
Skin("M4A4 | Hellfire", (0, 0.5)),
Skin("Galil AR | Sugar Rush", (0, 0.55)),
Skin("Dual Berettas | Cobra Strike", (0, 0.6)),
Skin("AK-47 | Orbit Mk01", (0, 0.55)),
Skin("P90 | Death Grip", (0, 1)),
Skin("P250 | Red Rock", (0, 1)),
Skin("SSG 08 | Death's Head", (0, 0.51)),
Skin("P2000 | Woodsman", (0, 0.8)),
Skin("USP-S | Blueprint", (0, 0.86)),
Skin("M4A1-S | Briefing", (0, 0.8)),
Skin("MAG-7 | Hard Water", (0, 0.45)),
Skin("Tec-9 | Cut Out", (0, 1)),
Skin("MAC-10 | Aloha", (0, 0.65)),
Skin("FAMAS | Macabre", (0, 0.6)),
Skin("UMP-45 | Metal Flowers", (0, 0.7)),
]:
Container.hashmap["Operation Hydra Case"].skins.append(weapon)
for weapon in [
Skin("AWP | Asiimov", (0.18, 1)),
Skin("AUG | Chameleon", (0, 0.5)),
......@@ -659,10 +723,16 @@ for weapon in [
Container.hashmap[].skins.append(weapon)
'''
def add_knives(case_name: str, knife_skin: List[str], knife_type: List[str]) -> None:
for skin in knife_skin:
for knife in knife_type:
Container.hashmap[case_name].skins.append(Skin.hashmap[f"{knife} | {skin}"])
def add_skins(case_name: str, skins_primary: List[str], skins_secondary: List[str] = None) -> None:
# "Weapon | Skin"
if skins_secondary is None:
for skin in skins_primary:
Container.hashmap[case_name].skins.append(Skin.hashmap[skin])
# "Weapon" & "Skin"
else:
for skin in skins_primary:
for knife in skins_secondary:
Container.hashmap[case_name].skins.append(Skin.hashmap[f"{knife} | {skin}"])
skins_og13 = [
"Fade",
......@@ -741,46 +811,116 @@ for case in [
"Revolver Case",
"Winter Offensive Weapon Case",
]:
add_knives(case, skins_og13, knives_og5)
add_knives("Falchion Case", skins_og13, ["Falchion Knife"])
add_knives("Huntsman Weapon Case", skins_og13, ["Huntsman Knife"])
add_knives("Operation Breakout Weapon Case", skins_og13, ["Butterfly Knife"])
add_knives("Operation Wildfire Case", skins_og13, ["Bowie Knife"])
add_knives("Shadow Case", skins_og13, ["Shadow Daggers"])
add_skins(case, skins_og13, knives_og5)
add_skins("Falchion Case", skins_og13, ["Falchion Knife"])
add_skins("Huntsman Weapon Case", skins_og13, ["Huntsman Knife"])
add_skins("Operation Breakout Weapon Case", skins_og13, ["Butterfly Knife"])
add_skins("Operation Wildfire Case", skins_og13, ["Bowie Knife"])
add_skins("Shadow Case", skins_og13, ["Shadow Daggers"])
skins_og13_ns = skins_og13.copy()
skins_og13_ns.remove("Night")
skins_og13_ns.append("Night Stripe")
add_knives("CS20 Case", skins_og13_ns, ["Classic Knife"])
add_knives("Shattered Web Case", skins_og13_ns, knives_idk)
add_skins("CS20 Case", skins_og13_ns, ["Classic Knife"])
add_skins("Shattered Web Case", skins_og13_ns, knives_idk)
for case in [
"Spectrum Case",
"Spectrum 2 Case",
]:
add_knives(case, skins_chroma, knives_spectrum)
add_skins(case, skins_chroma, knives_spectrum)
for case in [
"Prisma Case",
"Prisma 2 Case"
]:
add_knives(case, skins_chroma, knives_prisma)
add_skins(case, skins_chroma, knives_prisma)
for case in [
"Danger Zone Case",
"Horizon Case",
]:
add_knives(case, skins_og13_ns, knives_prisma)
add_skins(case, skins_og13_ns, knives_prisma)
for case in [
"Chroma Case",
"Chroma 2 Case",
"Chroma 3 Case",
]:
add_knives(case, skins_chroma, knives_og5)
add_skins(case, skins_chroma, knives_og5)
for case in [
"Gamma Case",
"Gamma 2 Case",
]:
add_knives(case, skins_gamma, knives_og5)
\ No newline at end of file
add_skins(case, skins_gamma, knives_og5)
# initialise all gloves
gloves_og = [
"Bloodhound Gloves | Guerrilla",
"Bloodhound Gloves | Charred",
"Bloodhound Gloves | Snakebite",
"Bloodhound Gloves | Bronzed",
"Driver Gloves | Crimson Weave",
"Driver Gloves | Lunar Weave",
"Driver Gloves | Diamondback",
"Driver Gloves | Convoy",
"Hand Wraps | Slaughter",
"Hand Wraps | Badlands",
"Hand Wraps | Leather",
"Hand Wraps | Spruce DDPAT",
"Moto Gloves | Spearmint",
"Moto Gloves | Cool Mint",
"Moto Gloves | Boom!",
"Moto Gloves | Eclipse",
"Specialist Gloves | Crimson Kimono",
"Specialist Gloves | Emerald Web",
"Specialist Gloves | Foundation",
"Specialist Gloves | Forest DDPAT",
"Sport Gloves | Pandora's Box",
"Sport Gloves | Superconductor",
"Sport Gloves | Hedge Maze",
"Sport Gloves | Arid",
]
gloves_clutch = [
"Driver Gloves | King Snake",
"Driver Gloves | Imperial Plaid",
"Driver Gloves | Overtake",
"Driver Gloves | Racing Green",
"Hand Wraps | Cobalt Skulls",
"Hand Wraps | Overprint",
"Hand Wraps | Duct Tape",
"Hand Wraps | Arboreal",
"Hydra Gloves | Case Hardened",
"Hydra Gloves | Emerald",
"Hydra Gloves | Mangrove",
"Hydra Gloves | Rattler",
"Moto Gloves | POW!",
"Moto Gloves | Polygon",
"Moto Gloves | Turtle",
"Moto Gloves | Transport",
"Specialist Gloves | Fade",
"Specialist Gloves | Crimson Web",
"Specialist Gloves | Mogul",
"Specialist Gloves | Buckshot",
"Sport Gloves | Vice",
"Sport Gloves | Amphibious",
"Sport Gloves | Omega",
"Sport Gloves | Bronze Morph"
]
for glove in gloves_og + gloves_clutch:
Skin(glove, (0.06, 0.8))
for case in [
"Glove Case",
"Operation Hydra Case",
]:
add_skins(case, gloves_og)
for case in [
"Clutch Case",
]:
add_skins(case, gloves_clutch)
......@@ -208,6 +208,24 @@ def scrape_csgobackpack():
price_weekly, price_monthly, timestamp, price_daily, price_weekly,
price_monthly, timestamp)
)
elif itemdict["type"] == "Gloves":
weapon_type = itemdict["type"]
subweapon_type = name.split("|")[0].strip()[2:]
exterior = name.split("(")[1].split(")")[0].strip()
cursor.execute("INSERT INTO weapons(name, weapon_type, subweapon_type, \
exterior, rarity, price_daily, price_weekly, price_monthly, last_updated)\
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s) ON CONFLICT (name) DO \
UPDATE SET price_daily=%s, price_weekly=%s, price_monthly=%s,\
last_updated=%s;",
(name, weapon_type, subweapon_type, exterior, rarity, price_daily,
price_weekly, price_monthly, timestamp, price_daily, price_weekly,
price_monthly, timestamp)
)
'''
Collectible
None
Key
'''
conn.commit()
logger.info(f"{gun_count} guns processed.")
......@@ -260,7 +278,7 @@ def calculate_evs():
#logger.debug(f"{name} does not match {weapon}")
continue
values_found += 1
if weapon_type == "Knife":
if weapon_type == "Knife" or weapon_type == "Gloves":
rarity = "Special"
temp_ev_value = 0
try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment