import PySimpleGUI as sg
import os
import time
import pyautogui

class TelaPython:
    def __init__(self):
        layout = [
            [sg.Text('Usuário',size=(10,0)), sg.Input(size=(20,0),key='usuario')],
            [sg.Text('Senha',size=(10,0)), sg.Input(size=(20,0),key='senha')],
            [sg.Text('Número',size=(10,0)), sg.Input(size=(20,0),key='num')],
            [sg.Text('Time1',size=(10,0)), sg.Slider(range=(0,30), default_value=0, orientation='h',size=(10,15),key='time1')],
            [sg.Text('Time2',size=(10,0)), sg.Slider(range=(0,30), default_value=0, orientation='h',size=(10,15),key='time2')],
            [sg.Button('Executar')]
        ]

        janela = sg.Window("Macro Portal CLARO").layout(layout)

        self.button, self.values = janela.read()

    def Iniciar(self):
        usuario = self.values['usuario']
        senha = self.values['senha']
        num = self.values['num']
        time1 = self.values['time1']
        time2 = self.values['time2']
        os.startfile('PortalClaro.exe')
        time.sleep(time1)
        pyautogui.moveTo(571, 409)#USUÁRIO
        pyautogui.click()
        pyautogui.write(usuario)
        pyautogui.press('tab')#SENHA
        pyautogui.write(senha)#Pjfa#412
        pyautogui.moveTo(672, 530)
        pyautogui.click()
        time.sleep(time2)
        pyautogui.moveTo(556, 472)#NUM
        pyautogui.click()
        pyautogui.write(num)
        pyautogui.moveTo(683, 505)
        pyautogui.click()
        time.sleep(1)
        pyautogui.moveTo(576, 437)
        pyautogui.click()



tela = TelaPython()
tela.Iniciar()
[(27, 'os.startfile', 'os.startfile', (['"""PortalClaro.exe"""'], {}), False, 'import os\n'), (28, 'time.sleep', 'time.sleep', (['time1'], {}), False, 'import time\n'), (29, 'pyautogui.moveTo', 'pyautogui.moveTo', (['(571)', '(409)'], {}), False, 'import pyautogui\n'), (30, 'pyautogui.click', 'pyautogui.click', ([], {}), False, 'import pyautogui\n'), (31, 'pyautogui.write', 'pyautogui.write', (['usuario'], {}), False, 'import pyautogui\n'), (32, 'pyautogui.press', 'pyautogui.press', (['"""tab"""'], {}), False, 'import pyautogui\n'), (33, 'pyautogui.write', 'pyautogui.write', (['senha'], {}), False, 'import pyautogui\n'), (34, 'pyautogui.moveTo', 'pyautogui.moveTo', (['(672)', '(530)'], {}), False, 'import pyautogui\n'), (35, 'pyautogui.click', 'pyautogui.click', ([], {}), False, 'import pyautogui\n'), (36, 'time.sleep', 'time.sleep', (['time2'], {}), False, 'import time\n'), (37, 'pyautogui.moveTo', 'pyautogui.moveTo', (['(556)', '(472)'], {}), False, 'import pyautogui\n'), (38, 'pyautogui.click', 'pyautogui.click', ([], {}), False, 'import pyautogui\n'), (39, 'pyautogui.write', 'pyautogui.write', (['num'], {}), False, 'import pyautogui\n'), (40, 'pyautogui.moveTo', 'pyautogui.moveTo', (['(683)', '(505)'], {}), False, 'import pyautogui\n'), (41, 'pyautogui.click', 'pyautogui.click', ([], {}), False, 'import pyautogui\n'), (42, 'time.sleep', 'time.sleep', (['(1)'], {}), False, 'import time\n'), (43, 'pyautogui.moveTo', 'pyautogui.moveTo', (['(576)', '(437)'], {}), False, 'import pyautogui\n'), (44, 'pyautogui.click', 'pyautogui.click', ([], {}), False, 'import pyautogui\n'), (9, 'PySimpleGUI.Text', 'sg.Text', (['"""Usuário"""'], {'size': '(10, 0)'}), True, 'import PySimpleGUI as sg\n'), (9, 'PySimpleGUI.Input', 'sg.Input', ([], {'size': '(20, 0)', 'key': '"""usuario"""'}), True, 'import PySimpleGUI as sg\n'), (10, 'PySimpleGUI.Text', 'sg.Text', (['"""Senha"""'], {'size': '(10, 0)'}), True, 'import PySimpleGUI as sg\n'), (10, 'PySimpleGUI.Input', 'sg.Input', ([], {'size': '(20, 0)', 'key': '"""senha"""'}), True, 'import PySimpleGUI as sg\n'), (11, 'PySimpleGUI.Text', 'sg.Text', (['"""Número"""'], {'size': '(10, 0)'}), True, 'import PySimpleGUI as sg\n'), (11, 'PySimpleGUI.Input', 'sg.Input', ([], {'size': '(20, 0)', 'key': '"""num"""'}), True, 'import PySimpleGUI as sg\n'), (12, 'PySimpleGUI.Text', 'sg.Text', (['"""Time1"""'], {'size': '(10, 0)'}), True, 'import PySimpleGUI as sg\n'), (12, 'PySimpleGUI.Slider', 'sg.Slider', ([], {'range': '(0, 30)', 'default_value': '(0)', 'orientation': '"""h"""', 'size': '(10, 15)', 'key': '"""time1"""'}), True, 'import PySimpleGUI as sg\n'), (13, 'PySimpleGUI.Text', 'sg.Text', (['"""Time2"""'], {'size': '(10, 0)'}), True, 'import PySimpleGUI as sg\n'), (13, 'PySimpleGUI.Slider', 'sg.Slider', ([], {'range': '(0, 30)', 'default_value': '(0)', 'orientation': '"""h"""', 'size': '(10, 15)', 'key': '"""time2"""'}), True, 'import PySimpleGUI as sg\n'), (14, 'PySimpleGUI.Button', 'sg.Button', (['"""Executar"""'], {}), True, 'import PySimpleGUI as sg\n'), (17, 'PySimpleGUI.Window', 'sg.Window', (['"""Macro Portal CLARO"""'], {}), True, 'import PySimpleGUI as sg\n')]