Jump to content

Send Limit


 Share

Recommended Posts

HotKeySet("{F3}","Di")

func Di()

opt ("SendKeyDelay",50)

send("{Enter}")

Send("blabla")

send("{Enter}")

EndFunc

how can i add usage limit for func ?

exam: its might be allow 3 times press then it connot use for 30 min or smth like that.

Regards.

Edited by metjumper
Link to comment
Share on other sites

HotKeySet("{F3}","Di")

func Di()

opt ("SendKeyDelay",50)

send("{Enter}")

Send("blabla")

send("{Enter}")

EndFunc

how can i add usage limit for func ?

exam: its might be allow 3 times press then it connot use for 30 min or smth like that.

Regards.

I havent tried it or anything, and its not the prettiest coding ever but...might work:

$x=0
HotKeySet("{F3}","Di")


func Di()
    If $x<3 Then
        opt ("SendKeyDelay",50)
        send("{Enter}")
        Send("blabla")
        send("{Enter}")
        $x+=1
        $Timer=TimerInit()
    Else
        If TimerDiff($Timer)<1800000
            Msgbox(0,"","Please Wait "&((TimerDiff($Timer)/1000)/60)&" Minutes")
        Else
            $x=0
        EndIf
    EndIf
EndFunc
Instant Lockerz Invite - www.instantlockerzinvite.co.uk
Link to comment
Share on other sites

  • Moderators

metjumper,

This should do what you want - 3 presses and then a time-out:

HotKeySet("{SPACE}", "My_Function")

Global $iBegin = 0
Global $iCount = 0

While 1
    Sleep(100)
WEnd

Func My_Function()

    If $iCount = 3 Then
        If TimerDiff($iBegin) < 10000 Then; 10 secs for example
            ConsoleWrite("Returning " & Int(TimerDiff($iBegin) / 1000) & " secs elapsed" & @CRLF)
            Return
        Else
            $iCount = 0
        EndIf
    EndIf
    $iCount += 1
    ConsoleWrite("Function call " & $iCount & @CRLF)
    If $iCount = 3 Then $iBegin = TimerInit()

EndFunc  ;==>My_Function

Keep pressing Space and you will see the 3 function calls and then the timer running.

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

M23 whit your code

space key wont work even 1 time like disable space key :)

i tryed to make smthg but i could not able.

If M23's doesnt work, you could put Global $Timer in mine, as i think that is what the prob with mine was :)

Global $Timer

$x=0
HotKeySet("{F3}","Di")


func Di()
    If $x<3 Then
        opt ("SendKeyDelay",50)
        send("{Enter}")
        Send("blabla")
        send("{Enter}")
        $x+=1
        $Timer=TimerInit()
    Else
        If TimerDiff($Timer)<1800000 Then
            Msgbox(0,"","Please Wait "&((TimerDiff($Timer)/1000)/60)&" Minutes")
        Else
            $x=0
        EndIf
    EndIf
EndFunc
Instant Lockerz Invite - www.instantlockerzinvite.co.uk
Link to comment
Share on other sites

HotKeySet("{F3}","Di")
$i = 0
func Di()
If $i < 3 then  
opt ("SendKeyDelay",50)
    send("{Enter}")
    Send("blabla")
    send("{Enter}")
    EndFunc
$i += 1
else
msgbox(0,"","no more worky")
endif
endfunc

Edits: Forgot the endif and endfunc

Edited by youknowwho4eva

Giggity

Link to comment
Share on other sites

  • Moderators

metjumper,

So replace SPACE with another key - the script works!

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