Jump to content



Photo

Need help


  • Please log in to reply
9 replies to this topic

#1 ctl

ctl

    Seeker

  • Active Members
  • 26 posts

Posted 16 May 2012 - 02:28 PM

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

So i have made this code

Plain Text         
#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, 16 May 2012 - 02:31 PM.








#2 Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Active Members
  • PipPipPipPipPipPip
  • 745 posts

Posted 16 May 2012 - 03:16 PM

This looks like a program to log onto a website? It doesn't look like the forum rules allows for this kind of topic.

#3 ctl

ctl

    Seeker

  • Active Members
  • 26 posts

Posted 16 May 2012 - 03:19 PM

Not realy, i had open a thread here http://www.autoitscript.com/forum/topic/139848-copy-msgbox-text/page__p__981445#entry981445 about the same program.

#4 Melba23

Melba23

    Yes, me!

  • Moderators
  • 15,758 posts

Posted 16 May 2012 - 04:14 PM

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
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
RecFileListToArray- An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options
GUIListViewEx - Insert, delete, move, drag and sort ListView items

#5 ctl

ctl

    Seeker

  • Active Members
  • 26 posts

Posted 16 May 2012 - 04:23 PM

Thanks melba, yes i will be careful, and i will wait for someone to answer me ;)

#6 qsek

qsek

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 256 posts

Posted 16 May 2012 - 04:27 PM

"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

#7 Melba23

Melba23

    Yes, me!

  • Moderators
  • 15,758 posts

Posted 16 May 2012 - 04:27 PM

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
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
RecFileListToArray- An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options
GUIListViewEx - Insert, delete, move, drag and sort ListView items

#8 ctl

ctl

    Seeker

  • Active Members
  • 26 posts

Posted 16 May 2012 - 04:32 PM

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, 16 May 2012 - 04:38 PM.


#9 Melba23

Melba23

    Yes, me!

  • Moderators
  • 15,758 posts

Posted 16 May 2012 - 04:49 PM

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
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
RecFileListToArray- An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options
GUIListViewEx - Insert, delete, move, drag and sort ListView items

#10 ctl

ctl

    Seeker

  • Active Members
  • 26 posts

Posted 16 May 2012 - 07:46 PM

Ok, sorry, you should close this topic ;) i understand, thanks for the answers and for the understanding.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users