Jump to content
Sign in to follow this  
mendrofa

i want switching from real account to virtual account

Recommended Posts

mendrofa

how to make script switching real account to virtual account
this my script

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>
#include <IE.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 203, 133, 192, 124)
$Combo1 = GUICtrlCreateCombo("VIRTUAL", 41, 8, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "REAL")
$Button1 = GUICtrlCreateButton("START", 8, 96, 179, 25)
$Label1 = GUICtrlCreateLabel("EMAIL", 8, 40, 36, 17)
$Label2 = GUICtrlCreateLabel("password", 8, 64, 49, 17)
$Input1 = GUICtrlCreateInput("marinus.mendrofa2121@gmail.com", 64, 36, 121, 21)
$input2 = GUICtrlCreateInput("Marinus123", 64, 64, 121, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Select
    case $nMsg = $Button1
       jalan()
        Case $nMsg = $GUI_EVENT_CLOSE
            Exit

    EndSelect
WEnd

func jalan()
   Local $url = "https://oauth.binary.com/oauth2/authorize?app_id=1&l=ID"
   $oie = _IECreate($url)
    $email1 = GUICtrlRead($input1)
    $password1 = GUICtrlRead($input2)
    Sleep(1000)
    Do
        $o_email = _iegetobjbyid($oie, "txtEmail")
        If $o_email = "invalid" Then
            Do
                $o_logout = _iegetobjbyid($oie, "btn_logout")
            Until IsObj($o_logout)
            _ieaction($o_logout, "click")
            Sleep(1000)
            _ieloadwait($oie)
            Sleep(3000)
            _ienavigate($oie, $url)
            _ieloadwait($oie)
            Sleep(2000)
        EndIf
    Until IsObj($o_email)
    _ieaction($o_email, "focus")
    $o_email.value = $email1
    Sleep(500)
    Do
        $o_password = _iegetobjbyid($oie, "txtPass")
    Until IsObj($o_password)
    _ieaction($o_password, "focus")
    $o_password.value = $password1
    Do
        $o_login = _iegetobjbyid($oie, "btnLogin")
    Until IsObj($o_login)
    _ieaction($o_login, "click")
    Sleep(1000)
    _ieloadwait($oie)
 if GUICtrlRead($combo1) = "VIRTUAL" Then

;??????????????????
; what must i do?

    EndIf
EndFunc

 

Share this post


Link to post
Share on other sites
AutoBert

what's a virtua account? If it's just a second account do same as you done with first account.

Share this post


Link to post
Share on other sites
pluto41

For starters you need to make some changes in the while 1 loop. See my example.

While 1
    $nMsg = GUIGetMsg()
    Select
    case $nMsg = $Button1
       Local $sComboRead = GUICtrlRead($Combo1)
       Select
           Case $sComboRead = "VIRTUAL"
               Msgbox ( 0, "VIRTUAL", "VIRTUAL SELECTED" )
               ; Call a Virtual () account function
           Case $sComboRead = "REAL"
               Msgbox (0, "REAL", "REAL SELECTED")
               ; call the  Jalan () function
        EndSelect
        Case $nMsg = $GUI_EVENT_CLOSE
            Exit
    EndSelect
WEnd

 

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.