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()
[((1000, 1031), 'os.startfile', 'os.startfile', (['"""PortalClaro.exe"""'], {}), "('PortalClaro.exe')\n", (1012, 1031), False, 'import os\n'), ((1040, 1057), 'time.sleep', 'time.sleep', (['time1'], {}), '(time1)\n', (1050, 1057), False, 'import time\n'), ((1066, 1092), 'pyautogui.moveTo', 'pyautogui.moveTo', (['(571)', '(409)'], {}), '(571, 409)\n', (1082, 1092), False, 'import pyautogui\n'), ((1109, 1126), 'pyautogui.click', 'pyautogui.click', ([], {}), '()\n', (1124, 1126), False, 'import pyautogui\n'), ((1135, 1159), 'pyautogui.write', 'pyautogui.write', (['usuario'], {}), '(usuario)\n', (1150, 1159), False, 'import pyautogui\n'), ((1168, 1190), 'pyautogui.press', 'pyautogui.press', (['"""tab"""'], {}), "('tab')\n", (1183, 1190), False, 'import pyautogui\n'), ((1205, 1227), 'pyautogui.write', 'pyautogui.write', (['senha'], {}), '(senha)\n', (1220, 1227), False, 'import pyautogui\n'), ((1245, 1271), 'pyautogui.moveTo', 'pyautogui.moveTo', (['(672)', '(530)'], {}), '(672, 530)\n', (1261, 1271), False, 'import pyautogui\n'), ((1280, 1297), 'pyautogui.click', 'pyautogui.click', ([], {}), '()\n', (1295, 1297), False, 'import pyautogui\n'), ((1306, 1323), 'time.sleep', 'time.sleep', (['time2'], {}), '(time2)\n', (1316, 1323), False, 'import time\n'), ((1332, 1358), 'pyautogui.moveTo', 'pyautogui.moveTo', (['(556)', '(472)'], {}), '(556, 472)\n', (1348, 1358), False, 'import pyautogui\n'), ((1371, 1388), 'pyautogui.click', 'pyautogui.click', ([], {}), '()\n', (1386, 1388), False, 'import pyautogui\n'), ((1397, 1417), 'pyautogui.write', 'pyautogui.write', (['num'], {}), '(num)\n', (1412, 1417), False, 'import pyautogui\n'), ((1426, 1452), 'pyautogui.moveTo', 'pyautogui.moveTo', (['(683)', '(505)'], {}), '(683, 505)\n', (1442, 1452), False, 'import pyautogui\n'), ((1461, 1478), 'pyautogui.click', 'pyautogui.click', ([], {}), '()\n', (1476, 1478), False, 'import pyautogui\n'), ((1487, 1500), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (1497, 1500), False, 'import time\n'), ((1509, 1535), 'pyautogui.moveTo', 'pyautogui.moveTo', (['(576)', '(437)'], {}), '(576, 437)\n', (1525, 1535), False, 'import pyautogui\n'), ((1544, 1561), 'pyautogui.click', 'pyautogui.click', ([], {}), '()\n', (1559, 1561), False, 'import pyautogui\n'), ((139, 171), 'PySimpleGUI.Text', 'sg.Text', (['"""Usuário"""'], {'size': '(10, 0)'}), "('Usuário', size=(10, 0))\n", (146, 171), True, 'import PySimpleGUI as sg\n'), ((172, 209), 'PySimpleGUI.Input', 'sg.Input', ([], {'size': '(20, 0)', 'key': '"""usuario"""'}), "(size=(20, 0), key='usuario')\n", (180, 209), True, 'import PySimpleGUI as sg\n'), ((222, 252), 'PySimpleGUI.Text', 'sg.Text', (['"""Senha"""'], {'size': '(10, 0)'}), "('Senha', size=(10, 0))\n", (229, 252), True, 'import PySimpleGUI as sg\n'), ((252, 287), 'PySimpleGUI.Input', 'sg.Input', ([], {'size': '(20, 0)', 'key': '"""senha"""'}), "(size=(20, 0), key='senha')\n", (260, 287), True, 'import PySimpleGUI as sg\n'), ((301, 332), 'PySimpleGUI.Text', 'sg.Text', (['"""Número"""'], {'size': '(10, 0)'}), "('Número', size=(10, 0))\n", (308, 332), True, 'import PySimpleGUI as sg\n'), ((333, 366), 'PySimpleGUI.Input', 'sg.Input', ([], {'size': '(20, 0)', 'key': '"""num"""'}), "(size=(20, 0), key='num')\n", (341, 366), True, 'import PySimpleGUI as sg\n'), ((379, 409), 'PySimpleGUI.Text', 'sg.Text', (['"""Time1"""'], {'size': '(10, 0)'}), "('Time1', size=(10, 0))\n", (386, 409), True, 'import PySimpleGUI as sg\n'), ((409, 499), 'PySimpleGUI.Slider', 'sg.Slider', ([], {'range': '(0, 30)', 'default_value': '(0)', 'orientation': '"""h"""', 'size': '(10, 15)', 'key': '"""time1"""'}), "(range=(0, 30), default_value=0, orientation='h', size=(10, 15),\n    key='time1')\n", (418, 499), True, 'import PySimpleGUI as sg\n'), ((507, 537), 'PySimpleGUI.Text', 'sg.Text', (['"""Time2"""'], {'size': '(10, 0)'}), "('Time2', size=(10, 0))\n", (514, 537), True, 'import PySimpleGUI as sg\n'), ((537, 627), 'PySimpleGUI.Slider', 'sg.Slider', ([], {'range': '(0, 30)', 'default_value': '(0)', 'orientation': '"""h"""', 'size': '(10, 15)', 'key': '"""time2"""'}), "(range=(0, 30), default_value=0, orientation='h', size=(10, 15),\n    key='time2')\n", (546, 627), True, 'import PySimpleGUI as sg\n'), ((635, 656), 'PySimpleGUI.Button', 'sg.Button', (['"""Executar"""'], {}), "('Executar')\n", (644, 656), True, 'import PySimpleGUI as sg\n'), ((686, 717), 'PySimpleGUI.Window', 'sg.Window', (['"""Macro Portal CLARO"""'], {}), "('Macro Portal CLARO')\n", (695, 717), True, 'import PySimpleGUI as sg\n')]