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, 8, 27, 39), 'os.startfile', 'os.startfile', ({(27, 21, 27, 38): '"""PortalClaro.exe"""'}, {}), "('PortalClaro.exe')", False, 'import os\n'), ((28, 8, 28, 25), 'time.sleep', 'time.sleep', ({(28, 19, 28, 24): 'time1'}, {}), '(time1)', False, 'import time\n'), ((29, 8, 29, 34), 'pyautogui.moveTo', 'pyautogui.moveTo', ({(29, 25, 29, 28): '(571)', (29, 30, 29, 33): '(409)'}, {}), '(571, 409)', False, 'import pyautogui\n'), ((30, 8, 30, 25), 'pyautogui.click', 'pyautogui.click', ({}, {}), '()', False, 'import pyautogui\n'), ((31, 8, 31, 32), 'pyautogui.write', 'pyautogui.write', ({(31, 24, 31, 31): 'usuario'}, {}), '(usuario)', False, 'import pyautogui\n'), ((32, 8, 32, 30), 'pyautogui.press', 'pyautogui.press', ({(32, 24, 32, 29): '"""tab"""'}, {}), "('tab')", False, 'import pyautogui\n'), ((33, 8, 33, 30), 'pyautogui.write', 'pyautogui.write', ({(33, 24, 33, 29): 'senha'}, {}), '(senha)', False, 'import pyautogui\n'), ((34, 8, 34, 34), 'pyautogui.moveTo', 'pyautogui.moveTo', ({(34, 25, 34, 28): '(672)', (34, 30, 34, 33): '(530)'}, {}), '(672, 530)', False, 'import pyautogui\n'), ((35, 8, 35, 25), 'pyautogui.click', 'pyautogui.click', ({}, {}), '()', False, 'import pyautogui\n'), ((36, 8, 36, 25), 'time.sleep', 'time.sleep', ({(36, 19, 36, 24): 'time2'}, {}), '(time2)', False, 'import time\n'), ((37, 8, 37, 34), 'pyautogui.moveTo', 'pyautogui.moveTo', ({(37, 25, 37, 28): '(556)', (37, 30, 37, 33): '(472)'}, {}), '(556, 472)', False, 'import pyautogui\n'), ((38, 8, 38, 25), 'pyautogui.click', 'pyautogui.click', ({}, {}), '()', False, 'import pyautogui\n'), ((39, 8, 39, 28), 'pyautogui.write', 'pyautogui.write', ({(39, 24, 39, 27): 'num'}, {}), '(num)', False, 'import pyautogui\n'), ((40, 8, 40, 34), 'pyautogui.moveTo', 'pyautogui.moveTo', ({(40, 25, 40, 28): '(683)', (40, 30, 40, 33): '(505)'}, {}), '(683, 505)', False, 'import pyautogui\n'), ((41, 8, 41, 25), 'pyautogui.click', 'pyautogui.click', ({}, {}), '()', False, 'import pyautogui\n'), ((42, 8, 42, 21), 'time.sleep', 'time.sleep', ({(42, 19, 42, 20): '(1)'}, {}), '(1)', False, 'import time\n'), ((43, 8, 43, 34), 'pyautogui.moveTo', 'pyautogui.moveTo', ({(43, 25, 43, 28): '(576)', (43, 30, 43, 33): '(437)'}, {}), '(576, 437)', False, 'import pyautogui\n'), ((44, 8, 44, 25), 'pyautogui.click', 'pyautogui.click', ({}, {}), '()', False, 'import pyautogui\n'), ((9, 13, 9, 44), 'PySimpleGUI.Text', 'sg.Text', (), '', True, 'import PySimpleGUI as sg\n'), ((9, 46, 9, 81), 'PySimpleGUI.Input', 'sg.Input', (), '', True, 'import PySimpleGUI as sg\n'), ((10, 13, 10, 41), 'PySimpleGUI.Text', 'sg.Text', (), '', True, 'import PySimpleGUI as sg\n'), ((10, 43, 10, 76), 'PySimpleGUI.Input', 'sg.Input', (), '', True, 'import PySimpleGUI as sg\n'), ((11, 13, 11, 43), 'PySimpleGUI.Text', 'sg.Text', (), '', True, 'import PySimpleGUI as sg\n'), ((11, 45, 11, 76), 'PySimpleGUI.Input', 'sg.Input', (), '', True, 'import PySimpleGUI as sg\n'), ((12, 13, 12, 41), 'PySimpleGUI.Text', 'sg.Text', (), '', True, 'import PySimpleGUI as sg\n'), ((12, 43, 12, 125), 'PySimpleGUI.Slider', 'sg.Slider', (), '', True, 'import PySimpleGUI as sg\n'), ((13, 13, 13, 41), 'PySimpleGUI.Text', 'sg.Text', (), '', True, 'import PySimpleGUI as sg\n'), ((13, 43, 13, 125), 'PySimpleGUI.Slider', 'sg.Slider', (), '', True, 'import PySimpleGUI as sg\n'), ((14, 13, 14, 34), 'PySimpleGUI.Button', 'sg.Button', ({(14, 23, 14, 33): '"""Executar"""'}, {}), "('Executar')", True, 'import PySimpleGUI as sg\n'), ((17, 17, 17, 48), 'PySimpleGUI.Window', 'sg.Window', ({(17, 27, 17, 47): '"""Macro Portal CLARO"""'}, {}), "('Macro Portal CLARO')", True, 'import PySimpleGUI as sg\n')]