Sign in to follow this  
Followers 0
metjumper

Send Limit

11 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

nope its not working.

gives me an error "if timeriff... variable used without being declard. when i press f3 at 4 time.

thanks for reply

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

nope its not working.

gives me an error "if timeriff... variable used without being declard. when i press f3 at 4 time.

thanks for reply

Umm, just noticed i missed a "Then" at the end of that line:

If TimerDiff($Timer)<1800000 Then
Edited by furrycow

Instant Lockerz Invite - www.instantlockerzinvite.co.uk

Share this post


Link to post
Share on other sites

i recognize it i did put then.

its give me error as i said before...

Share this post


Link to post
Share on other sites

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


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

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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

metjumper,

So replace SPACE with another key - the script works!

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

furrycow

Tnx for second code its working very well.

M23 i know u are one of the best coder autoit,i didnt mean your code is not workin but i changed key but it wont work probably my bad,

Thanks for all reply i appreciated.

Best Regards.

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