Sign in to follow this  
Followers 0
aphesia

spamming + button question

6 posts in this topic

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 :P

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by Melba23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (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? :P

and for the script:

Thx i will try to fit it on my script :D

@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 :unsure:

But nice idea

Edited by aphesia

Share this post


Link to post
Share on other sites

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._______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

 

Share this post


Link to post
Share on other sites

as i siad.. i need something to check if soemone is spamming the pw into my programm.. by clicking many times the enter button

Share this post


Link to post
Share on other sites

#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]

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  
Followers 0