Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.2.6 #157

Merged
merged 10 commits into from
Nov 23, 2024
Merged

1.2.6 #157

Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/windows-exe-build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Build Windows Executable

env:
AAA_VERSION: "1.2.5.3"
AAA_VERSION: "1.2.6"

on:
workflow_dispatch:
Expand Down
92 changes: 70 additions & 22 deletions AzerothAuctionAssassin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import sys
from datetime import datetime

AAA_VERSION = "1.2.5.2"
AAA_VERSION = "1.2.6"

windowsApp_Path = None
try:
Expand Down Expand Up @@ -687,8 +687,9 @@ def make_ilvl_page(self, ilvl_page):
self.ilvl_page_layout.addWidget(self.ilvl_item_input_label, 0, 0, 1, 1)
self.ilvl_page_layout.addWidget(self.ilvl_item_input, 1, 0, 1, 1)

# Item Level inputs group
self.ilvl_input = QLineEdit(ilvl_page)
self.ilvl_input_label = QLabel("Item Level", ilvl_page)
self.ilvl_input_label = QLabel("Min Item Level", ilvl_page)
self.ilvl_input_label.setToolTip(
"Set the minimum item level (ilvl) you want to snipe. Ex: 400 ilvl."
)
Expand All @@ -697,31 +698,41 @@ def make_ilvl_page(self, ilvl_page):
self.ilvl_page_layout.addWidget(self.ilvl_input_label, 2, 0, 1, 1)
self.ilvl_page_layout.addWidget(self.ilvl_input, 3, 0, 1, 1)

self.ilvl_max_input = QLineEdit(ilvl_page)
self.ilvl_max_input_label = QLabel("Max Item Level", ilvl_page)
self.ilvl_max_input_label.setToolTip(
"Set the maximum item level (ilvl) you want to snipe. Ex: 500 ilvl."
)
self.ilvl_max_input_label.setFixedSize(120, 15)
self.ilvl_max_input.setFixedSize(120, 25)
self.ilvl_page_layout.addWidget(self.ilvl_max_input_label, 4, 0, 1, 1)
self.ilvl_page_layout.addWidget(self.ilvl_max_input, 5, 0, 1, 1)

cohenaj194 marked this conversation as resolved.
Show resolved Hide resolved
self.ilvl_price_input = QLineEdit(ilvl_page)
self.ilvl_price_input_label = QLabel("Buyout", ilvl_page)
self.ilvl_price_input_label.setToolTip(
"Set the maximum buyout you want to snipe."
)
self.ilvl_price_input_label.setFixedSize(120, 15)
self.ilvl_price_input.setFixedSize(120, 25)
self.ilvl_page_layout.addWidget(self.ilvl_price_input_label, 4, 0, 1, 1)
self.ilvl_page_layout.addWidget(self.ilvl_price_input, 5, 0, 1, 1)
self.ilvl_page_layout.addWidget(self.ilvl_price_input_label, 6, 0, 1, 1)
self.ilvl_page_layout.addWidget(self.ilvl_price_input, 7, 0, 1, 1)

self.ilvl_sockets = QCheckBox("Sockets", ilvl_page)
self.ilvl_sockets.setToolTip("Do you want the item to have Sockets?")
self.ilvl_page_layout.addWidget(self.ilvl_sockets, 6, 0, 1, 1)
self.ilvl_page_layout.addWidget(self.ilvl_sockets, 8, 0, 1, 1)

self.ilvl_speed = QCheckBox("Speed", ilvl_page)
self.ilvl_speed.setToolTip("Do you want the item to have Speed?")
self.ilvl_page_layout.addWidget(self.ilvl_speed, 7, 0, 1, 1)
self.ilvl_page_layout.addWidget(self.ilvl_speed, 9, 0, 1, 1)

self.ilvl_leech = QCheckBox("Leech", ilvl_page)
self.ilvl_leech.setToolTip("Do you want the item to have Leech?")
self.ilvl_page_layout.addWidget(self.ilvl_leech, 8, 0, 1, 1)
self.ilvl_page_layout.addWidget(self.ilvl_leech, 10, 0, 1, 1)

self.ilvl_avoidance = QCheckBox("Avoidance", ilvl_page)
self.ilvl_avoidance.setToolTip("Do you want the item to have Avoidance?")
self.ilvl_page_layout.addWidget(self.ilvl_avoidance, 9, 0, 1, 1)
self.ilvl_page_layout.addWidget(self.ilvl_avoidance, 11, 0, 1, 1)

self.ilvl_min_required_lvl_input = QLineEdit(ilvl_page)
self.ilvl_min_required_lvl_input_label = QLabel("Min Player Level", ilvl_page)
Expand All @@ -732,9 +743,9 @@ def make_ilvl_page(self, ilvl_page):
self.ilvl_min_required_lvl_input_label.setFixedSize(120, 15)
self.ilvl_min_required_lvl_input.setFixedSize(120, 25)
self.ilvl_page_layout.addWidget(
self.ilvl_min_required_lvl_input_label, 10, 0, 1, 1
self.ilvl_min_required_lvl_input_label, 12, 0, 1, 1
)
self.ilvl_page_layout.addWidget(self.ilvl_min_required_lvl_input, 11, 0, 1, 1)
self.ilvl_page_layout.addWidget(self.ilvl_min_required_lvl_input, 13, 0, 1, 1)

self.ilvl_max_required_lvl_input = QLineEdit(ilvl_page)
self.ilvl_max_required_lvl_input_label = QLabel("Max Player Level", ilvl_page)
Expand All @@ -745,9 +756,9 @@ def make_ilvl_page(self, ilvl_page):
self.ilvl_max_required_lvl_input_label.setFixedSize(120, 15)
self.ilvl_max_required_lvl_input.setFixedSize(120, 25)
self.ilvl_page_layout.addWidget(
self.ilvl_max_required_lvl_input_label, 12, 0, 1, 1
self.ilvl_max_required_lvl_input_label, 14, 0, 1, 1
)
self.ilvl_page_layout.addWidget(self.ilvl_max_required_lvl_input, 13, 0, 1, 1)
self.ilvl_page_layout.addWidget(self.ilvl_max_required_lvl_input, 15, 0, 1, 1)

self.add_ilvl_button = QPushButton("Add/Update Item", ilvl_page)
self.add_ilvl_button.setToolTip("Add/Update item to your snipe list.")
Expand Down Expand Up @@ -1290,13 +1301,15 @@ def check_for_settings(self):
self.ilvl_list = json.load(file)
# Process each item level data dictionary
for ilvl_dict_data in self.ilvl_list:
# Add missing 'item_ids' key if not present
# Add missing keys if not present
if "item_ids" not in ilvl_dict_data:
ilvl_dict_data["item_ids"] = []
if "required_min_lvl" not in ilvl_dict_data:
ilvl_dict_data["required_min_lvl"] = 1
if "required_max_lvl" not in ilvl_dict_data:
ilvl_dict_data["required_max_lvl"] = 999
if "max_ilvl" not in ilvl_dict_data:
ilvl_dict_data["max_ilvl"] = 10000
cohenaj194 marked this conversation as resolved.
Show resolved Hide resolved
# Create a formatted string with the item data
item_ids = ",".join(map(str, ilvl_dict_data["item_ids"]))
display_string = (
Expand All @@ -1308,7 +1321,8 @@ def check_for_settings(self):
f"Leech: {ilvl_dict_data['leech']}; "
f"Avoidance: {ilvl_dict_data['avoidance']}; "
f"MinLevel: {ilvl_dict_data['required_min_lvl']}; "
f"MaxLevel: {ilvl_dict_data['required_max_lvl']}"
f"MaxLevel: {ilvl_dict_data['required_max_lvl']}; "
f"Max ILvl: {ilvl_dict_data['max_ilvl']}"
)
# Insert the string into the display list
self.ilvl_list_display.insertItem(
Expand All @@ -1326,7 +1340,8 @@ def ilvl_list_double_clicked(self, item):
leech = item_split[6].split(";")[0]
avoidance = item_split[7].split(";")[0]
required_min_lvl = item_split[8].split(";")[0]
required_max_lvl = item_split[9]
required_max_lvl = item_split[9].split(";")[0]
ilvl_max = item_split[10].split(";")[0]
cohenaj194 marked this conversation as resolved.
Show resolved Hide resolved

self.ilvl_item_input.setText(item_id)
self.ilvl_price_input.setText(buyout)
Expand All @@ -1339,6 +1354,7 @@ def ilvl_list_double_clicked(self, item):
self.ilvl_input.setText(ilvl)
self.ilvl_min_required_lvl_input.setText(required_min_lvl)
self.ilvl_max_required_lvl_input.setText(required_max_lvl)
self.ilvl_max_input.setText(ilvl_max)

def realm_list_clicked(self, item):
realm_split = item.text().split(":")
Expand All @@ -1351,6 +1367,7 @@ def realm_list_clicked(self, item):

def add_ilvl_to_list(self):
ilvl = self.ilvl_input.text()
ilvl_max = self.ilvl_max_input.text()
price = self.ilvl_price_input.text()

if ilvl == "" or price == "":
Expand All @@ -1363,10 +1380,13 @@ def add_ilvl_to_list(self):

try:
ilvl_int = int(ilvl)
ilvl_max_int = int(ilvl_max)
price_int = int(price)
except ValueError:
QMessageBox.critical(
self, "Invalid Input", "Ilvl and price should be numbers."
self,
"Invalid Input",
"Min Ilvl, Max Ilvl, and price should be numbers.",
)
return False

Expand All @@ -1377,6 +1397,15 @@ def add_ilvl_to_list(self):
)
return False

# Check if ilvl_max is between ilvl and 10000
if not ilvl_int <= ilvl_max_int <= 10000:
QMessageBox.critical(
self,
"Incorrect Ilvl Max Value",
"Max Ilvl must be between Ilvl and a max of 10000.",
)
return False
cohenaj194 marked this conversation as resolved.
Show resolved Hide resolved

# Check if Price is between 1 and 10 million
if not 1 <= price_int <= 10000000:
QMessageBox.critical(
Expand All @@ -1395,12 +1424,12 @@ def add_ilvl_to_list(self):
map(int, item_ids_text.replace(" ", "").split(","))
)

# Check if all items are between 100k and 500k
# Check all item ids are between 1 and 500000
if any(not 1 <= item_id <= 500000 for item_id in item_ids_list):
QMessageBox.critical(
self,
"Invalid Item ID",
"All item IDs should be between 1 and 500k.",
"All item IDs should be between 1 and 500,000.",
)
return False
except ValueError:
Expand Down Expand Up @@ -1456,7 +1485,7 @@ def add_ilvl_to_list(self):
)
return False

# Create a dictionary with the data
# Create a dictionary with the data, including ilvl_max
ilvl_dict_data = {
"ilvl": ilvl_int,
"buyout": price_int,
Expand All @@ -1467,6 +1496,7 @@ def add_ilvl_to_list(self):
"item_ids": item_ids_list,
"required_min_lvl": int(required_min_lvl),
"required_max_lvl": int(required_max_lvl),
"max_ilvl": ilvl_max_int,
}

# Only append and display if the dictionary is not already in the list
Expand All @@ -1484,7 +1514,8 @@ def add_ilvl_to_list(self):
f"Leech: {ilvl_dict_data['leech']}; "
f"Avoidance: {ilvl_dict_data['avoidance']}; "
f"MinLevel: {ilvl_dict_data['required_min_lvl']}; "
f"MaxLevel: {ilvl_dict_data['required_max_lvl']}"
f"MaxLevel: {ilvl_dict_data['required_max_lvl']}; "
f"Max ILvl: {ilvl_dict_data['max_ilvl']}"
)

# Insert the formatted string into the display list
Expand Down Expand Up @@ -1519,6 +1550,11 @@ def remove_ilvl_to_list(self):
else:
required_max_lvl = int(self.ilvl_max_required_lvl_input.text())

if self.ilvl_max_input.text() == "":
ilvl_max = 10000
else:
ilvl_max = int(self.ilvl_max_input.text())

# Create a dictionary with the data
ilvl_dict_data = {
"ilvl": int(self.ilvl_input.text()),
Expand All @@ -1530,6 +1566,7 @@ def remove_ilvl_to_list(self):
"item_ids": item_ids_list,
"required_min_lvl": required_min_lvl,
"required_max_lvl": required_max_lvl,
"max_ilvl": ilvl_max,
}

# Check if the item data is already in the list
Expand All @@ -1545,7 +1582,8 @@ def remove_ilvl_to_list(self):
f"Leech: {ilvl_dict_data['leech']}; "
f"Avoidance: {ilvl_dict_data['avoidance']}; "
f"MinLevel: {ilvl_dict_data['required_min_lvl']}; "
f"MaxLevel: {ilvl_dict_data['required_max_lvl']}"
f"MaxLevel: {ilvl_dict_data['required_max_lvl']}; "
f"Max ILvl: {ilvl_dict_data['max_ilvl']}"
)

# Print the formatted string
Expand Down Expand Up @@ -1594,6 +1632,7 @@ def import_ilvl_data(self):
avoidance = ilvl_dict_data["avoidance"]
required_min_lvl = ilvl_dict_data.get("required_min_lvl", 1)
required_max_lvl = ilvl_dict_data.get("required_max_lvl", 999)
ilvl_max = ilvl_dict_data.get("max_ilvl", 10000)

# Check that all item IDs are valid integers, but allow list to be empty
if not all(
Expand All @@ -1614,6 +1653,14 @@ def import_ilvl_data(self):
raise ValueError(
f"Invalid ILvl {ilvl}.\nILvl must be an integer between 200-1000."
)
if not (200 <= ilvl_max <= 10000):
raise ValueError(
f"Invalid Max ILvl {ilvl_max}.\nMax ILvl must be an integer between 200-10000."
)
if not ilvl_max >= ilvl:
raise ValueError(
f"Max ILvl {ilvl_max} must be greater than ILvl {ilvl}."
)
cohenaj194 marked this conversation as resolved.
Show resolved Hide resolved

# Check that min and max levels are integers within range
if not (1 <= required_min_lvl <= 999):
Expand Down Expand Up @@ -1646,7 +1693,8 @@ def import_ilvl_data(self):
f"Leech: {leech}; "
f"Avoidance: {avoidance}; "
f"MinLevel: {required_min_lvl}; "
f"MaxLevel: {required_max_lvl}"
f"MaxLevel: {required_max_lvl}; "
f"Max ILvl: {ilvl_max}"
)
self.ilvl_list_display.insertItem(
self.ilvl_list_display.count(), string_with_data
Expand Down
6 changes: 4 additions & 2 deletions AzerothAuctionAssassinData/example_desired_ilvl_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@
{"ilvl": 483, "buyout": 700001, "sockets": false, "speed": false, "leech": false, "avoidance": true,"item_ids": [208426, 208427]},
{"ilvl": 483, "buyout": 1200001, "sockets": false, "speed": false, "leech": true, "avoidance": false,"item_ids": [208426, 208427]},
{"ilvl": 483, "buyout": 10001, "sockets": false, "speed": false, "leech": true, "avoidance": false},
{"ilvl": 400, "buyout": 100, "sockets": false, "speed": false, "leech": false, "avoidance": false, "item_ids": [224592], "required_min_lvl": 71, "required_max_lvl": 79}
]
{"ilvl": 400, "buyout": 100, "sockets": false, "speed": false, "leech": false, "avoidance": false, "item_ids": [224592], "required_min_lvl": 71, "required_max_lvl": 79},
{"ilvl": 545, "max_ilvl": 545, "buyout": 30000, "sockets": false, "speed": false, "leech": false, "avoidance": false, "item_ids": [224592], "required_min_lvl": 1, "required_max_lvl": 70},
{"ilvl": 545, "max_ilvl": 545, "buyout": 30000, "sockets": false, "speed": false, "leech": false, "avoidance": false, "item_ids": [224632, 224631, 224639, 224625], "required_min_lvl": 1, "required_max_lvl": 70}
]
4 changes: 4 additions & 0 deletions mega_alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,10 @@ def check_tertiary_stats_generic(
if ilvl < min_ilvl:
return False

# skip if ilvl is too high
if ilvl > DESIRED_ILVL_ITEMS["max_ilvl"]:
return False

# skip if required_lvl is too low
if required_lvl < DESIRED_ILVL_ITEMS["required_min_lvl"]:
return False
Expand Down
10 changes: 9 additions & 1 deletion utils/mega_data_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,11 @@ def __set_desired_ilvl(
ilvl_info["item_ids"] = ilvl_info.get("item_ids", [])
ilvl_info["required_min_lvl"] = ilvl_info.get("required_min_lvl", 1)
ilvl_info["required_max_lvl"] = ilvl_info.get("required_max_lvl", 1000)
ilvl_info["max_ilvl"] = ilvl_info.get("max_ilvl", 10000)

example = {
"ilvl": 360,
"max_ilvl": 10000,
"buyout": 50000,
"sockets": False,
"speed": True,
Expand All @@ -396,7 +398,13 @@ def __set_desired_ilvl(

snipe_info = {}
bool_vars = ["sockets", "speed", "leech", "avoidance"]
int_vars = ["ilvl", "buyout", "required_min_lvl", "required_max_lvl"]
int_vars = [
"ilvl",
"max_ilvl",
"buyout",
"required_min_lvl",
"required_max_lvl",
]
for key, value in ilvl_info.items():
if key in bool_vars:
if isinstance(ilvl_info[key], bool):
Expand Down
Loading