import sys
import time
import pyautogui
import keyword
import win32api
import win32con
import threading
from PyQt5.QtWidgets import QApplication, QPushButton, QMainWindow, QWidget, QLabel
from PyQt5.QtGui import QIcon, QFont
class mainWindow(QWidget):
def __init__(self):
super().__init__()
self.setGeometry(500, 500, 400, 200)
self.setWindowTitle("SantaSouL Auto Upgrade V1")
self.setWindowIcon(QIcon("anvil.jpg"))
self.contents()
self.isRunning = False
self.show()
def contents(self):
self.btnStart = QPushButton(self)
self.btnStart.setText("START")
self.btnStart.setStyleSheet("background-color : green")
self.btnStart.setFont(QFont("arial", 12, QFont.Bold))
self.btnStop = QPushButton(self)
self.btnStop.setText("STOP")
self.btnStop.setStyleSheet("background-color : red")
self.btnStop.setFont(QFont("arial", 12, QFont.Bold))
self.btnStart.move(10, 10)
self.btnStop.move(100, 10)
self.btnStart.clicked.connect(self.start)
self.btnStop.clicked.connect(self.stop)
self.lblMesaj = QLabel("Upgrade Scroll Kagidini Inventoryden 28.Slota\nYani Sağ En Alt Slota Koyun.", self)
self.lblMesaj.setFont(QFont("arial", 12, QFont.Bold))
self.lblMesaj.move(45, 150)
self.lblNot = QLabel("Not:", self)
self.lblNot.setFont(QFont("arial", 12, QFont.Bold))
self.lblNot.move(10, 150)
self.lblNot.setStyleSheet("background-color: turquoise")
def start(self):
if not self.isRunning:
self.isRunning = True
self.worker_thread = threading.Thread(target=self.process)
self.worker_thread.start()
def stop(self):
self.isRunning = False
def process(self):
slot1x = 688
slot1y = 466
for i in range(7):
if not self.isRunning:
break
anvil()
slot(slot1x, slot1y)
slot1x += 50
slot1x = 688
slot1y = 515
for i in range(7):
if not self.isRunning:
break
anvil()
slot(slot1x, slot1y)
slot1x += 50
slot1x = 688
slot1y = 566
for i in range(7):
if not self.isRunning:
break
anvil()
slot(slot1x, slot1y)
slot1x += 50
slot1x = 688
slot1y = 615
for i in range(5):
if not self.isRunning:
break
anvil()
slot(slot1x, slot1y)
slot1x += 50
self.isRunning = False
def click(x, y):
win32api.SetCursorPos((x, y))
time.sleep(0.1)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, x, y, 0, 0)
time.sleep(0.1)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y, 0, 0)
def rightclick(x, y):
win32api.SetCursorPos((x, y))
time.sleep(0.1)
win32api.mouse_event(win32con.MOUSEEVENTF_RIGHTDOWN, x, y, 0, 0)
time.sleep(0.1)
win32api.mouse_event(win32con.MOUSEEVENTF_RIGHTUP, x, y, 0, 0)
def anvil():
click(536, 382)
time.sleep(0.1)
rightclick(536, 382)
time.sleep(0.1)
click(520, 395)
time.sleep(0.1)
def slot(slot1x, slot1y):
rightclick(slot1x, slot1y)
time.sleep(0.2)
rightclick(969, 610)
time.sleep(0.2)
click(751, 357)
time.sleep(0.2)
click(739, 481)
time.sleep(10)
click(1002, 61)
def windows():
app = QApplication(sys.argv)
win = mainWindow()
sys.exit(app.exec_())
windows()