aphesia Posted February 27, 2009 Posted February 27, 2009 Hello, i got two questions: 1.) I got a gui with a input (pw) and a button. how can i make the button "activated" already so u just have to enter pw + press enter to login. Now i would have to press tab or click with the mouse 2.) How can i check if someone is spamming the pw into the programm.. like doing 20 entry-trys in 5seconds or smth? Thought about timers.au3 but i dont think so? Thanks alot
Moderators Melba23 Posted February 27, 2009 Moderators Posted February 27, 2009 (edited) aphesia,Q1. Use the $BS_DEFPUSHBUTTON style. In this example the Enter key will always check the password (the button will too!)Q2. Use TimerInit and TimerDiff. The example gives you 3 attempts to get the correct password in 10 seconds or it exits:#include <ButtonConstants.au3> $password = "fred" GUICreate("Test", 200, 200) $Input = GUICtrlCreateInput("", 10,10,100,20) $hBut = GUICtrlCreateButton("Go", 10, 50, 80, 30, $BS_DEFPUSHBUTTON ) GUISetState() $count = 0 $begin = TimerInit() While 1 Switch GUIGetMsg() Case -3 Exit Case $hBut $count +=1 If $count > 3 And TimerDiff($begin) < 10000 Then Exit If GUICtrlRead($Input) = $password Then ExitLoop EndSwitch WEnd MsgBox(0,"","Password Correct!")I am sure you can customise it to your requirements.M23 Edited February 27, 2009 by Melba23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
aphesia Posted February 27, 2009 Author Posted February 27, 2009 (edited) "$BS_DEFPUSHBUTTON" the problem is: everytime i press enter and pw is wrong , it will make a webcam screenshot.. so your parameter always simulates a pressing of the button which is alot of webcam shots? and for the script: Thx i will try to fit it on my script @edit: without $BS_DEFPUSHBUTTON your script won´t work .. right? And i guess i can use this "$BS_DEFPUSHBUTTON".. so it won´t work for me But nice idea Edited February 27, 2009 by aphesia
Moderators Melba23 Posted February 27, 2009 Moderators Posted February 27, 2009 aphesia,If you do not ask the right question you will not get the right answer.Next time - give all the requirements at the beginning and not after someone has tried to answer your incomplete question.Then I will not waste my time producing something that is not wanted!"Click"M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
aphesia Posted February 27, 2009 Author Posted February 27, 2009 as i siad.. i need something to check if soemone is spamming the pw into my programm.. by clicking many times the enter button
Ealric Posted February 27, 2009 Posted February 27, 2009 #Include <Misc.au3> While 1 $msg = GUIGetMsg() Select Case $msg = $YourInputBoxVariable If (_IsPressed("0D")) Then ; Do something here EndIf EndSelect WEnd In addition to what was posted above, you can add another case within your while loop to search for a msg parameter when a key is pressed in the inputbox, in this case the enter key. If it's pressed, you can include what you want it to do where I provided an example. My Projects: [topic="89413"]GoogleHack Search[/topic], [topic="67095"]Swiss File Knife GUI[/topic], [topic="69072"]Mouse Location Pointer[/topic], [topic="86040"]Standard Deviation Calculator[/topic]
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now