I made a small GTA San andreas menu that gives you a lot of money with tkinter and python, but whenver i press the button to give me money, the gui crashes but i get the money
heres my code:
from ReadWriteMemory import ReadWriteMemory
from tkinter import *
rwm = ReadWriteMemory
process = rwm().get_process_by_name(process_name="gta-sa.exe")
process.open()
# Money
baseaddress = 0x1F0000 0x118FD8
moneypointer = process.get_pointer(baseaddress, offsets=[0xB8])
def moneygive():
while 1:
process.write(moneypointer, 99999999999)
root = Tk()
root.title("GTA San Andreas Menu")
root.iconbitmap()
root.geometry("200x200")
MoneyButton = Button(root, text="Inf money!", padx=50, command=moneygive)
MoneyButton.pack()
root.mainloop()
also whenever i try to press the stop button, this error comes
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\####\AppData\Local\Programs\Python\Python310\lib\tkinter\__init__.py", line 1921, in __call__
return self.func(*args)
File "C:\Users\####\PycharmProjects\gtasa\main.py", line 17, in moneygive
process.write(moneypointer, 99999999999)
File "C:\Users\####\PycharmProjects\gtasa\venv\lib\site-packages\ReadWriteMemory\__init__.py", line 125, in write
ctypes.windll.kernel32.WriteProcessMemory(self.handle, lp_base_address, lp_buffer,
CodePudding user response:
Use after method of tkinter to create the loop. While loop will not work inside mainloop. Thanks!