Skip to content

Commit

Permalink
fix: resolved issues (#20, #21, #22)
Browse files Browse the repository at this point in the history
  • Loading branch information
purpxd committed Jun 25, 2024
1 parent 1e4ec4d commit 47ce1b1
Show file tree
Hide file tree
Showing 63 changed files with 51 additions and 57 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ virtualenv/
*.ui
resource_rc.py
error.log
activate.bat
Empty file modified adb/AdbWinApi.dll
100755 → 100644
Empty file.
Empty file modified adb/AdbWinUsbApi.dll
100755 → 100644
Empty file.
29 changes: 23 additions & 6 deletions autoshop.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def toggle_start_stop(self):
else:
self.start(1000)
self.is_running = True


class MainWindow(QMainWindow):
def __init__(self):
Expand All @@ -97,7 +97,7 @@ def __init__(self):
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.shop_stopwatch = Stopwatch(self.ui.lobby_timer)
self.version = "2.0"
self.version = "2.1"
self.info = self.check()
self.settings = QSettings('E7autoshop', 'Settings')
sa.write_key = self.info['key']
Expand Down Expand Up @@ -218,14 +218,15 @@ def on_autoshop_start_btn_clicked(self):
self.ui.skystones_input.setEnabled(False)
self.autoshop_status = True
self.ui.lobby_timer.setText('00:00:00')
self.shop_stopwatch.toggle_start_stop()
self.shop_stopwatch.start(1000)
self.skystones = int(self.ui.skystones_input.text())
refreshes = self.skystones // 3
self.shop_thread = ShopThread(refreshes)
self.shop_thread.progress_updated.connect(self.update_shop_progress)
self.shop_thread.inventory.connect(self.update_inventory)
self.shop_thread.finished.connect(self.finished_run)
self.shop_thread.start()
self.ui.lobby_progress_bar.setProperty("value", 0)
self.ui.lobby_console.append(f"Starting {refreshes} runs")
self.currency(0, 0, 0, 0) # reset currency and colors
self.color_currency()
Expand All @@ -247,12 +248,14 @@ def on_autoshop_pause_btn_clicked(self):
self.shop_thread.resume()
self.ui.lobby_console.append("Resuming")

@pyqtSlot()
def on_autoshop_stop_btn_clicked(self):
self.ui.autoshop_start_btn.setEnabled(True)
self.ui.autoshop_pause_btn.setEnabled(False)
self.ui.autoshop_stop_btn.setEnabled(False)
self.ui.skystones_input.clear()
self.ui.skystones_input.setEnabled(True)
self.shop_stopwatch.time_elapsed = 0
self.shop_stopwatch.stop()
self.shop_thread.stop()
self.ui.lobby_console.append("Stopping")
Expand Down Expand Up @@ -328,15 +331,29 @@ def ads_progress(self, progress):
self.ui.lobby_console.append(f"Finished watching ad {progress}")

def finished_run(self, stash):
self.ui.autoshop_start_btn.setEnabled(True)
self.ui.autoshop_start_btn.setEnabled(False)
self.ui.autoshop_pause_btn.setEnabled(False)
self.ui.autoshop_stop_btn.setEnabled(False)
self.ui.skystones_input.clear()
self.ui.skystones_input.setEnabled(True)
self.shop_stopwatch.time_elapsed = 0
self.shop_stopwatch.stop()
Sessions.create_update(date=datetime.today().strftime("%Y-%m-%d"), covenants=stash['covenants'], mystics=stash["mystics"], gems=stash["gems_spent"], gold=stash["gold_spent"])
Sessions.create_update(date=datetime.today().strftime("%Y-%m-%d"),
covenants=stash['covenants'],
mystics=stash["mystics"],
gems=stash["gems_spent"],
gold=stash["gold_spent"])
if self.info['run_completed_t']:
sa.track(self.id, 'run_completed', {'application': 'E7AutoShop', 'status': 'finished', 'description': 'Finished autoshop cycle', 'covenents': stash['covenants'], 'mystics': stash["mystics"], 'gems_used': stash["gems_spent"], 'gold_used': stash["gold_spent"], 'duration': self.ui.lobby_timer.text()})
sa.track(self.id,
'run_completed', {
'application': 'E7AutoShop',
'status': 'finished',
'description': 'Finished autoshop cycle',
'covenents': stash['covenants'],
'mystics': stash["mystics"],
'gems_used': stash["gems_spent"],
'gold_used': stash["gold_spent"],
'duration': self.ui.lobby_timer.text()})
self.update_inventory(stash)
self.populate_table()

Expand Down
Empty file modified img/ads.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified img/arky.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified img/arky_loading.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified img/buymecoffee.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified img/cov.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified img/dark.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified img/field.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified img/gold.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified img/hunt.gif
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified img/hunt_done.gif
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified img/light.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified img/lobby.gif
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified img/mystic.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified img/skystone.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions models.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ def create_update(cls, date, covenants, mystics, gems, gold):
def get_data(cls):
return cls.select(orderBy='-date')



Sessions.createTable(ifNotExists=True)
Empty file modified requirements.txt
100755 → 100644
Empty file.
Empty file modified resource.qrc
100755 → 100644
Empty file.
16 changes: 8 additions & 8 deletions scripts/shop.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ def purchase(self, item):
subprocess.Popen(f"{self.adb} shell input tap {random.randint(1600, 1850)} {y}")
time.sleep(0.25)
subprocess.Popen(f"{self.adb} shell input tap {random.randint(1600, 1850)} {y}")
subprocess.Popen(f"{self.adb} shell input tap {random.randint(890, 1275)} {random.randint(740, 790)}")
subprocess.Popen(f"{self.adb} shell input tap {random.randint(1000, 1275)} {random.randint(740, 790)}")
time.sleep(0.5)
subprocess.Popen(f"{self.adb} shell input tap {random.randint(890, 1275)} {random.randint(740, 790)}")
subprocess.Popen(f"{self.adb} shell input tap {random.randint(1000, 1275)} {random.randint(740, 790)}")
time.sleep(0.5)
subprocess.Popen(f"{self.adb} shell input tap {random.randint(890, 1275)} {random.randint(740, 790)}")
subprocess.Popen(f"{self.adb} shell input tap {random.randint(1000, 1275)} {random.randint(740, 790)}")
time.sleep(0.5)
subprocess.Popen(f"{self.adb} shell input tap {random.randint(890, 1275)} {random.randint(740, 790)}")
subprocess.Popen(f"{self.adb} shell input tap {random.randint(1000, 1275)} {random.randint(740, 790)}")
time.sleep(1)

def screen(self):
Expand All @@ -109,9 +109,9 @@ def screen(self):
return screenshot

def swipe(self):
start_x = 1000
start_x = 1050
start_y = 500
end_x = 1200
end_x = 1250
end_y = 50
speed_range = 50
randomized_start_x = start_x + random.randint(-speed_range, speed_range)
Expand Down Expand Up @@ -214,11 +214,11 @@ def main(self):
self.refresh()
self.click_missions()
self.output.append(f"\n\n{self.inventory['session_refreshes']}")
time.sleep(1)
time.sleep(1.5)
screenshot = self.screen()
for n in range(1, 5):
self.capture(screenshot, n)
time.sleep(1)
time.sleep(0.5)
self.swipe()
time.sleep(1)
self.click_missions()
Expand Down
5 changes: 4 additions & 1 deletion scripts/watchads.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ def run(self):
while True:
if self.stopped:
break
time.sleep(3)
if count == 0:
time.sleep(10)
else:
time.sleep(5)
if count == 5:
break
cropped = self.screen()
Expand Down
Empty file modified tesseract-ocr/doc/AUTHORS
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/doc/COPYING
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/doc/README
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/doc/ReleaseNotes
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/doc/eurotext.tif
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/doc/phototest.tif
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/java/ScrollView.jar
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/configs/ambigs.train
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/configs/api_config
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/configs/bigram
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/configs/box.train
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/configs/box.train.stderr
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/configs/digits
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/configs/hocr
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/configs/inter
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/configs/kannada
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/configs/linebox
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/configs/logfile
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/configs/makebox
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/configs/quiet
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/configs/rebox
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/configs/strokewidth
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/configs/unlv
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/eng.cube.bigrams
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/eng.cube.fold
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/eng.cube.lm
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/eng.cube.lm_
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/eng.cube.nn
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/eng.cube.params
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/eng.cube.size
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/eng.cube.word-freq
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/eng.tesseract_cube.nn
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/eng.traineddata
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/tessconfigs/batch
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/tessconfigs/batch.nochop
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/tessconfigs/matdemo
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/tessconfigs/msdemo
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/tessconfigs/nobatch
100755 → 100644
Empty file.
Empty file modified tesseract-ocr/tessdata/tessconfigs/segdemo
100755 → 100644
Empty file.
54 changes: 14 additions & 40 deletions ui.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file './main.ui'
# Form implementation generated from reading ui file 'main.ui'
#
# Created by: PyQt5 UI code generator 5.15.10
# Created by: PyQt5 UI code generator 5.15.9
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
Expand Down Expand Up @@ -31,7 +31,7 @@ def setupUi(self, MainWindow):
self.lobby_mov.setMaximumSize(QtCore.QSize(16777215, 324))
self.lobby_mov.setText("")
self.lobby_mov.setObjectName("lobby_mov")
self.gridLayout_2.addWidget(self.lobby_mov, 1, 0, 1, 2)
self.gridLayout_2.addWidget(self.lobby_mov, 2, 0, 1, 2)
self.horizontalLayout_7 = QtWidgets.QHBoxLayout()
self.horizontalLayout_7.setObjectName("horizontalLayout_7")
self.lobby_timer = QtWidgets.QLabel(self.autoshop)
Expand Down Expand Up @@ -112,27 +112,19 @@ def setupUi(self, MainWindow):
self.lobby_horizontalLayout.addWidget(self.autoshop_stop_btn)
self.verticalLayout.addLayout(self.lobby_horizontalLayout)
self.horizontalLayout_7.addLayout(self.verticalLayout)
self.gridLayout_2.addLayout(self.horizontalLayout_7, 4, 0, 1, 1)
self.lobby_console_scrollarea = QtWidgets.QScrollArea(self.autoshop)
self.lobby_console_scrollarea.setWidgetResizable(True)
self.lobby_console_scrollarea.setObjectName("lobby_console_scrollarea")
self.scrollAreaWidgetContents = QtWidgets.QWidget()
self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 591, 179))
self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents")
self.lobby_console = QtWidgets.QTextEdit(self.scrollAreaWidgetContents)
self.lobby_console.setGeometry(QtCore.QRect(0, 0, 593, 181))
self.lobby_console.setReadOnly(True)
self.lobby_console.setObjectName("lobby_console")
self.lobby_console_scrollarea.setWidget(self.scrollAreaWidgetContents)
self.gridLayout_2.addWidget(self.lobby_console_scrollarea, 5, 0, 1, 1)
self.gridLayout_2.addLayout(self.horizontalLayout_7, 6, 0, 1, 1)
self.lobby_progress_bar = QtWidgets.QProgressBar(self.autoshop)
self.lobby_progress_bar.setProperty("value", 0)
self.lobby_progress_bar.setObjectName("lobby_progress_bar")
self.gridLayout_2.addWidget(self.lobby_progress_bar, 3, 0, 1, 2)
self.gridLayout_2.addWidget(self.lobby_progress_bar, 5, 0, 1, 2)
self.announcement = QtWidgets.QLabel(self.autoshop)
self.announcement.setText("")
self.announcement.setObjectName("announcement")
self.gridLayout_2.addWidget(self.announcement, 0, 0, 1, 1)
self.lobby_console = QtWidgets.QTextEdit(self.autoshop)
self.lobby_console.setReadOnly(True)
self.lobby_console.setObjectName("lobby_console")
self.gridLayout_2.addWidget(self.lobby_console, 7, 0, 1, 1)
self.stackedWidget.addWidget(self.autoshop)
self.page = QtWidgets.QWidget()
self.page.setObjectName("page")
Expand All @@ -142,14 +134,7 @@ def setupUi(self, MainWindow):
self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.verticalLayoutWidget_4)
self.verticalLayout_5.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_5.setObjectName("verticalLayout_5")
self.scrollArea_2 = QtWidgets.QScrollArea(self.verticalLayoutWidget_4)
self.scrollArea_2.setWidgetResizable(True)
self.scrollArea_2.setObjectName("scrollArea_2")
self.scrollAreaWidgetContents_3 = QtWidgets.QWidget()
self.scrollAreaWidgetContents_3.setGeometry(QtCore.QRect(0, 0, 617, 617))
self.scrollAreaWidgetContents_3.setObjectName("scrollAreaWidgetContents_3")
self.tableWidget = QtWidgets.QTableWidget(self.scrollAreaWidgetContents_3)
self.tableWidget.setGeometry(QtCore.QRect(0, 0, 619, 619))
self.tableWidget = QtWidgets.QTableWidget(self.verticalLayoutWidget_4)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
Expand All @@ -170,8 +155,7 @@ def setupUi(self, MainWindow):
self.tableWidget.setHorizontalHeaderItem(3, item)
item = QtWidgets.QTableWidgetItem()
self.tableWidget.setHorizontalHeaderItem(4, item)
self.scrollArea_2.setWidget(self.scrollAreaWidgetContents_3)
self.verticalLayout_5.addWidget(self.scrollArea_2)
self.verticalLayout_5.addWidget(self.tableWidget)
self.stackedWidget.addWidget(self.page)
self.gridLayout.addWidget(self.stackedWidget, 0, 1, 2, 1)
self.side_verticalLayout_outer = QtWidgets.QVBoxLayout()
Expand Down Expand Up @@ -270,28 +254,18 @@ def setupUi(self, MainWindow):
self.side_verticalLayout_inner.addLayout(self.horizontalLayout)
spacerItem12 = QtWidgets.QSpacerItem(20, 5, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
self.side_verticalLayout_inner.addItem(spacerItem12)
self.patch_scroll = QtWidgets.QScrollArea(self.centralwidget)
self.patch_scroll.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustToContents)
self.patch_scroll.setWidgetResizable(True)
self.patch_scroll.setObjectName("patch_scroll")
self.side_scroll_contents = QtWidgets.QWidget()
self.side_scroll_contents.setGeometry(QtCore.QRect(0, 0, 185, 314))
self.side_scroll_contents.setLayoutDirection(QtCore.Qt.LeftToRight)
self.side_scroll_contents.setObjectName("side_scroll_contents")
self.patch_edit = QtWidgets.QTextEdit(self.side_scroll_contents)
self.patch_edit.setGeometry(QtCore.QRect(0, 0, 189, 381))
self.patch_edit = QtWidgets.QTextEdit(self.centralwidget)
self.patch_edit.setReadOnly(True)
self.patch_edit.setObjectName("patch_edit")
self.patch_scroll.setWidget(self.side_scroll_contents)
self.side_verticalLayout_inner.addWidget(self.patch_scroll)
self.side_verticalLayout_inner.addWidget(self.patch_edit)
self.side_verticalLayout_outer.addLayout(self.side_verticalLayout_inner)
spacerItem13 = QtWidgets.QSpacerItem(20, 5, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
self.side_verticalLayout_outer.addItem(spacerItem13)
self.gridLayout.addLayout(self.side_verticalLayout_outer, 0, 0, 1, 1)
MainWindow.setCentralWidget(self.centralwidget)

self.retranslateUi(MainWindow)
self.stackedWidget.setCurrentIndex(0)
self.stackedWidget.setCurrentIndex(1)
QtCore.QMetaObject.connectSlotsByName(MainWindow)

def retranslateUi(self, MainWindow):
Expand Down

0 comments on commit 47ce1b1

Please sign in to comment.