Jump to content

Need help


Recommended Posts

Hi all again, i have some question, hope you could help me with this.

So i have made this code

#include <GuiConstantsEx.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>

$hGUI = GUICreate("Bine ai Venit               v.1.1", 600, 400) ; Store the handle here <<<<<<

LoginPassword()
Func LoginPassword()
    Local $VarWord, $RetWord, $Pass = '1234'

  While 1

       $RetWord = InputBox("user", "Introdu parola de acces:" , Default, "*", 200, 120, 370, 300)
  
    Select
       Case @error
      ExitLoop
       Case $RetWord = ''
      MsgBox(0, "", "Nu ai introdus nicio parola, incearca din nou.")
       Case $RetWord <> $Pass
      MsgBox(48, "", "Parola incorecta, incearca din nou.")
   Case Else
    
   GUICtrlCreateIcon("explorer.exe", 0, 175, 120)
GUICtrlCreateLabel("Icon", 180, 160, 50, 20)

$BrkEnd = GUICtrlCreateButton("&Exit", 200, 370, 80, 25)
$sites = GUICtrlCreateButton("&Site-uri", 100, 370, 80, 25)

$Google = GUICtrlCreateButton("&Google", 390, 10 , 80, 25)
$youtube = GUICtrlCreateButton("&Youtube", 390, 50, 80, 25)

GUISetState() ; set the GUI as Visible.
GUISetBkColor (0x333333)  ; will change background color
$sText =  @CRLF & "   Google" & @CRLF & "Username: ctl" & @CRLF & "Password: 1234"  
                ; And add the required styles to the edit control
                GUICtrlCreateEdit($sText, 50, 50, 300, 300, BitOr($ES_READONLY, $WS_VSCROLL, $ES_AUTOVSCROLL))
    GUICtrlSetColor(-1, 0x0066CC)
                GUISetState(@SW_SHOW)
    
    
    
    
    While 1 ; start loop, so the script continues and does not exit.

$msg = GUIGetMsg() ; listen for a message.


    If $msg = $GUI_EVENT_CLOSE Or $msg = $BrkEnd Then ; if exit is pressed, then exit the script.
  Exit
  
  ElseIf $msg = $sites then
  
  $o_IE = _IECreate ()
_IENavigate ($o_IE, "[url="http://www.google.ro"]http://www.google.ro[/url]")
$o_IE = _IECreate ()
_IENavigate ($o_IE, "[url="http://youtube.com"]http://youtube.com[/url]")
  
     ElseIf $msg = $Google then
  
  $o_IE = _IECreate ()
     _IENavigate ($o_IE, "[url="http://www.google.ro"]http://www.google.ro[/url]")
  
  ElseIf $msg = $Youtube Then
  
  $o_IE = _IECreate ()
        _IENavigate ($o_IE, "[url="http://www.youtube.com"]http://www.youtube.com[/url]")
  
  EndIf

WEnd ; end loop.
    
                While 1
                    Switch GUIGetMsg()
                        Case $GUI_EVENT_CLOSE
                            Exit
                        Case $GUI_EVENT_CLOSE
                            Exit
                    EndSwitch
                WEnd
        EndSelect
    WEnd
EndFunc   ;==>LoginPassword

Everything works great, but i was wondering if i could make some improvements.

First of all i want to copy the text under a button, so i want to creat a button for the username and a button for the password and when i click on the button with username to copy my username automaticaly and same to the password, this way the all thing its more quickly, something like this:

$ctl = GUICtrlCreateButton("&ctl", 390, 10 , 80, 25)
$1234 = GUICtrlCreateButton("&1234", 390, 50 , 80, 25)

    If $msg = $GUI_EVENT_CLOSE Or $msg = $BrkEnd Then ; if exit is pressed, then exit the script.
  Exit
  
  ElseIf $msg = $ctl then
    
       copy ctl

  Elseif $msg = $1234 then

     copy 1234

Hope you get the idea, i dont have any idea on how show i write that pice of code.

The second question is, that if i could somehow have the program to my pc at home, and at work, at home to have the sources and to make changes how i want, and at work to have the .exe, and whenever i make some changes on the home pc, thoes changes to take effect when i open the exe file at work, this could be possible ?

Thanks a lot.

Edited by ctl
Link to comment
Share on other sites

  • Moderators

Hi,

This thread has been reported as requesting help for a "log-in" script and thus prohibited by the Forum Rules. The prohibition covers "forum or site auto-login methods" - here the OP is using an InputBox to limit access to his own script. I see nothing in the script as it stands that suggests he is trying to automate a log-in to the sites opened within it.

I am happy with the thread as it stands. ;)

ctl,

Be careful not to stray into prohibited areas with this script as it progresses. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

"copy the text under a button"

if you mean by that "copy the text to the windows clipboard" yo might want to look in the Helpfile for ClipPut()

Teamspeak 3 User Viewer - Quick and functional TS3 Query script, which shows online users.Cached Screenshot Deleter - Deletes older Fraps Screenshots if they exceed a specified limit.Unresolved Topics:Intercept and modify dragdrop text behaviour in scite
Link to comment
Share on other sites

  • Moderators

ctl,

I will answer a little now. :)

Why do you want a button to add your username and password automatically? Surely that will defeat the object of having such a check if you can just press a button? ;)

And where are you going to copy the username? All I can see at the moment is an InputBox for a password. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Yes, that was exacly what i was loking for ;) its work thanks qsek

$ctl = GUICtrlCreateButton("&ctl", 390, 10 , 80, 25)
$password = GUICtrlCreateButton("&password", 390, 50 , 80, 25)

If $msg = $GUI_EVENT_CLOSE Or $msg = $BrkEnd Then ; if exit is pressed, then exit the script.
  Exit
  
     ElseIf $msg = $ctl then
  
  ClipPut("google")

     Elseif $msg = $password then

   ClipPut("1234")

Thanks a lot, one problem resolved, for the second question, someone has an answer ?

LE: @Melba23 sometimes when i copy the username or password from my edit box, i get some space at the begining or the end of my password, and when i paste the password into want site i want to log in, that space is like a character so the password doesent work, so it will be much easier for me to just press the button and automaticaly copy my password behind my button so all i have to do is press the button, and then go to my site and paste it there, hope you get the idea :)

Edited by ctl
Link to comment
Share on other sites

  • Moderators

ctl,

I understand. ;)

And I hope you understand what I said earlier because you are getting very close to the limit here - please do not automate the process any further :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...