Jump to content
Sign in to follow this  
Exoendables

Gui problem

Recommended Posts

Exoendables

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <WinHttp.au3>
#include <Array.au3>
#include <IE.au3>
#include-once

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 623, 442, 192, 124)
$Button1 = GUICtrlCreateButton("Lire mes E-mails !", 35, 296, 553, 73)
GUICtrlSetFont(-1, 20, 800, 4, "Comic Sans MS")
$Label1 = GUICtrlCreateLabel("Entrer votre Pseudo :", 32, 16, 108, 18, $SS_CENTER)
$Input1 = GUICtrlCreateInput("Pseudo", 24, 48, 241, 24, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER))
GUICtrlSetFont(-1, 8, 800, 0, "Comic Sans MS")
$Label2 = GUICtrlCreateLabel("Entrer votre Mot De Passe :", 32, 88, 131, 17, $SS_CENTER)
$Input2 = GUICtrlCreateInput("Mot De Passe", 24, 120, 241, 24, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER,$ES_PASSWORD))
GUICtrlSetFont(-1, 8, 800, 0, "Comic Sans MS")
$Progression = GUICtrlCreateProgress(35, 192, 553, 57, $WS_BORDER)
GUICtrlSetColor(-1, 0x004E98)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetCursor (-1, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


If FileExists("info_config.ini") Then
    GUICtrlSetData($Input1, IniRead("info_config.ini", "Login", "Pseudo", ""))
    GUICtrlSetData($Input2, IniRead("info_config.ini", "Login", "Pass", ""))
EndIf

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $button1
            $site = "**********"
        Case $GUI_EVENT_CLOSE
            Exit


    EndSwitch
WEnd

$pseudo = GUICtrlRead($Input1)
$pass = GUICtrlRead($Input2)
IniWrite("info_config.ini", "Login", "Email", $pseudo)
IniWrite("info_config.ini", "Login", "Pass", $pass)

$site = _IECreate("*******", 0, 0, 1)
$Input1  = _IEGetObjByName($site, "login_username")
_IEFormElementSetValue($Input1, $pseudo)
$Input2  = _IEGetObjByName($site, "login_password")
_IEFormElementSetValue($Input2, $pass)
$submit_Value  = _IEGetObjByName($site, "login_btn")
_IEAction($submit_Value, "Click")
Sleep(5000)

_IENavigate($site, "***********")
_IELoadWaitTimeout(7000)

So my adaptation is wrong but i can't find where, i hope you can help me and i have a question how do for the progressbar ? example when is tried to log we can read loggon down at the bar thx

sorry for my english

Share this post


Link to post
Share on other sites
wakillon

So my adaptation is wrong but i can't find where, i hope you can help me and i have a question how do for the progressbar ? example when is tried to log we can read loggon down at the bar thx

sorry for my english

Hi Exoendables ! Posted Image

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <WinHttp.au3>
#include <Array.au3>
#include <IE.au3>
#include-once

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 623, 442, 192, 124)
$Button1 = GUICtrlCreateButton("Lire mes E-mails !", 35, 296, 553, 73)
GUICtrlSetFont(-1, 20, 800, 4, "Comic Sans MS")
$Label1 = GUICtrlCreateLabel("Entrer votre Pseudo :", 32, 16, 108, 18, $SS_CENTER)
$Input1 = GUICtrlCreateInput("Pseudo", 24, 48, 241, 24, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER))
GUICtrlSetFont(-1, 8, 800, 0, "Comic Sans MS")
$Label2 = GUICtrlCreateLabel("Entrer votre Mot De Passe :", 32, 88, 131, 17, $SS_CENTER)
$Input2 = GUICtrlCreateInput("Mot De Passe", 24, 120, 241, 24, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER,$ES_PASSWORD))
GUICtrlSetFont(-1, 8, 800, 0, "Comic Sans MS")
$Progression = GUICtrlCreateProgress(35, 192, 553, 57, $WS_BORDER)
GUICtrlSetColor(-1, 0x004E98)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetCursor (-1, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

If FileExists("info_config.ini") Then
    GUICtrlSetData($Input1, IniRead("info_config.ini", "Login", "Pseudo", ""))
    GUICtrlSetData($Input2, IniRead("info_config.ini", "Login", "Pass", ""))
EndIf

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $button1
            _Open ( )
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func _Open ( )
    $pseudo = GUICtrlRead($Input1)
    $pass = GUICtrlRead($Input2)
    IniWrite("info_config.ini", "Login", "Email", $pseudo)
    IniWrite("info_config.ini", "Login", "Pass", $pass)
    $site = _IECreate("*******", 0, 0, 1)
    $Input1  = _IEGetObjByName($site, "login_username")
    _IEFormElementSetValue($Input1, $pseudo)
    $Input2  = _IEGetObjByName($site, "login_password")
    _IEFormElementSetValue($Input2, $pass)
    $submit_Value  = _IEGetObjByName($site, "login_btn")
    _IEAction($submit_Value, "Click")
    Sleep(5000)
    _IENavigate($site, "***********")
    _IELoadWaitTimeout(7000)
EndFunc

So, i suppose you want to say that your button doesn't react,

but if you attrib a function when it is clicked, your IE part can be launch...

I don't know the website you want open, so i can try this part,

and why do you want to put a progressbar ? ( Also see GUICtrlCreateProgress )

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
Exoendables

THANKS !!!

i don't have understand your question about my progres bar, can you explain me more about this ?

Share this post


Link to post
Share on other sites
wakillon

THANKS !!!

i don't have understand your question about my progres bar, can you explain me more about this ?

I just don't understand when you say "how do for the progressbar ?"

Be more precise.Posted Image


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
Exoendables

i want to top whent i have click on the button a message down at the bar like that :

_____________________________________________________

/ \ 0%

/_____________________________________________________\

connection in progress

And when i arrived on _IEAction($submit_Value, "Click")

_____________________________________________________

/ / \ 10%

/_________/____________________________________________\

Login successful

after the problem is the number of action do my scrip is never the same sometimes can do 2 or 3 and i want what my script adapt to this number example for a the end the bar been at 100%

Tell me if you have difficulty to understand

Edited by Exoendables

Share this post


Link to post
Share on other sites
wakillon

i want to top whent i have click on the button a message down at the bar like that :

_____________________________________________________

/ \ 0%

/_____________________________________________________\

connection in progress

And when i arrived on _IEAction($submit_Value, "Click")

_____________________________________________________

/ / \ 10%

/_________/____________________________________________\

Login successful

after the problem is the number of action do my scrip is never the same sometimes can do 2 or 3 and i want what my script adapt to this number example for a the end the bar been at 100%

Tell me if you have difficulty to understand

You can set progress by GUICtrlSetData ( $Progression, $_I ) for each step ( where $_I is incremented. )


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
Exoendables

"incremented" i don't have a good english ;) so can you explain me this word ? :)

Share this post


Link to post
Share on other sites
wakillon

"incremented" i don't have a good english ;) so can you explain me this word ? :)

C'est le meme mot qu'en français : incrementer

$_I = $_I + 10

T'as loupé des cours ? Posted Image


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
Exoendables

XD no only i am a shit in french !! ;)

But sometimes my script can do 3, 4 or 5 action is never the same how i can do for my bar do a progress in fonction of the number of action ? :) it's a loop

For $i = 0 To UBound($id_A) - 1

$perle =_IECreate ("*************************=" & $img_A[$i], 0, 0)

_IEImgClick($perle, "******************.gif")

_IELoadWait($perle, 5000)

ConsoleWrite($id_A[$i] & @CRLF)

_IEQuit($perle)

this is a loop and taht loop can work 5 or 4

Edited by Exoendables

Share this post


Link to post
Share on other sites
wakillon

XD no only i am a shit in french !! ;)

But sometimes my script can do 3, 4 or 5 action is never the same how i can do for my bar do a progress in fonction of the number of action ? :)

If you can't determine the number of actions you should set progress at each action :

action 1 set to 20

2 set to 40

3 set to 60

4 set to 80

5 set to 100

If it jump an action it will be set by the next...Posted Image


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites
Exoendables

Hum...

but in the scrip how i do that? :s Sorry i take your time

Merci :)

Share this post


Link to post
Share on other sites
wakillon

Hum...

but in the scrip how i do that? :s Sorry i take your time

Merci :)

It should more easy with a complete script but basically it should be like this

1° action

GUICtrlSetData ( $Progression, 20 )

2° action

GUICtrlSetData ( $Progression, 40 )

etc...until 100%

( And in your first post there was no loop ! Posted Image )


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×