Mana

mail@pastecode.io avatar
unknown
python
5 months ago
4.7 kB
2
Indexable
import pyautogui
from customtkinter import *
from tkinter import *
from PIL import Image
import pyautogui

pyautogui.useImageNotFoundException(False)
h = ''

janela = CTk()
janela.geometry("200x180")
janela.iconbitmap('projetos/Tibia_cur/core.ico')
set_appearance_mode('dark')

interface = CTkFrame(master=janela,
                     width=198,
                     height=178,
                     border_color="blue",
                     border_width=2)
interface.pack(anchor="center",
               )
def checando_status(x, y, rgb, button_name):
    lb_slider.configure(text='Checando mana...')
    if pyautogui.pixelMatchesColor(x, y, rgb):
        janela.after(500,ativar)
    else:
        pyautogui.press(button_name)
        janela.after(500, ativar)
def porcentagem(value):
    lb_slider2.configure(text=f'{int(bt_slider.get())} % de mana')

def ativar():
    global h
    h = ((bt_slider.get()*89)//100)+1768
    if bt_play_var.get() == 'on':    
        bt_play.configure(text='Ativo')
        checando_status(int(h), 323, (241, 97, 97), 'F1')
    elif bt_play_var.get() == 'off':
        bt_play.configure(text='Desativado')
        lb_slider.configure(text='Programa encerrado')

bt_slider = CTkSlider(master= interface,
                      number_of_steps=100,
                      from_= 0,
                      to=100,
                      width=150,
                      command=porcentagem
                      )
bt_slider.set(0)
bt_slider.place(relx = 0.1,
                rely = 0.1,
                anchor='w')

lb_slider = CTkLabel(master=interface,
            text='',
            wraplength=198)
lb_slider.place(rely = 0.8,
                relx = 0.2,
                anchor='w')
lb_slider2 = CTkLabel(master=interface,
            text='0 % de mana',
            wraplength=198,)
lb_slider2.place(rely = 0.3,
                relx = 0.5,
                anchor='center')

bt_play_var = StringVar(value="off")
bt_play = CTkSwitch(master=interface,
                    text="Desativado",
                    command=ativar,
                    variable=bt_play_var,
                    onvalue="on",
                    offvalue="off"
                    )
bt_play.place(rely =0.5,
              relx=0.2)

janela.mainloop()



import pyautogui
from customtkinter import *
from PIL import Image
import pyautogui

pyautogui.useImageNotFoundException(False)
h = ''

janela = CTk()
janela.geometry("200x180")
janela.iconbitmap('projetos/Tibia_cur/mana.ico')
set_appearance_mode('dark')

interface = CTkFrame(master=janela,
                     width=198,
                     height=178,
                     border_color="pink",
                     border_width=2)
interface.pack(anchor="center",
               )
def checando_status(x, y, rgb, button_name):
    lb_slider.configure(text='Checando vida...')
    if pyautogui.pixelMatchesColor(x, y, rgb):
        janela.after(500,ativar)
    else:
        pyautogui.press(button_name)
        janela.after(500, ativar)
def porcentagem(value):
    lb_slider2.configure(text=f'{int(bt_slider.get())} % de vida')

def ativar():
    global h
    h = ((bt_slider.get()*89)//100)+1768
    if bt_play_var.get() == 'on':    
        bt_play.configure(text='Ativo')
        checando_status(int(h), 309, (241, 97, 97), 'F1')
    elif bt_play_var.get() == 'off':
        bt_play.configure(text='Desativado')
        lb_slider.configure(text='Programa encerrado')

bt_slider = CTkSlider(master= interface,
                      number_of_steps=100,
                      from_= 0,
                      to=100,
                      width=150,
                      command=porcentagem
                      )
bt_slider.set(0)
bt_slider.place(relx = 0.1,
                rely = 0.1,
                anchor='w')

lb_slider = CTkLabel(master=interface,
            text='',
            wraplength=198)
lb_slider.place(rely = 0.8,
                relx = 0.2,
                anchor='w')
lb_slider2 = CTkLabel(master=interface,
            text='0 % de mana',
            wraplength=198,)
lb_slider2.place(rely = 0.3,
                relx = 0.5,
                anchor='center')

bt_play_var = StringVar(value="off")
bt_play = CTkSwitch(master=interface,
                    text="Desativado",
                    command=ativar,
                    variable=bt_play_var,
                    onvalue="on",
                    offvalue="off"
                    )
bt_play.place(rely =0.5,
              relx=0.2)

janela.mainloop()
Leave a Comment