Jump to content

Help! call function from a running script


Go to solution Solved by JohnOne,

Recommended Posts

Posted (edited)

Hi,

The problem is that I want to run a function inside a running script.

I know that I could set a hotkey that trigger this function, but I'm looking for another option.

I tried using CmdLine and passing parameter to the script, but it only run the function in another instance of the script.

I thought of creating a gui and set it state to hidden, and then ControlClick some of its buttons, but it only work if the window is active.

Can someone help? :)

Edit:

Global $iFreq = 500

While 1
    Beep($iFreq,100)
    Sleep(1000)
WEnd

Func _IncFreq()
    $iFreq += 100
EndFunc

Func _DecFreq()
    $iFreq -= 100
EndFunc
Edited by oapjr
Posted (edited)

You can Call a Func by using  Call("name")

Not sure what you need.

Global $iFreq = 500

Call("_call")
Func _call()
While 1
    Beep($iFreq,100)
    Sleep(1000)
    If $iFreq = 500 Then
        Call("_DecFreq")
        EndIf
    Call("_IncFreq")
WEnd
EndFunc
Func _IncFreq()
    $iFreq += 100
    Sleep(1000)
    Call("_call")
EndFunc
Func _DecFreq()
    $iFreq -= 100
    Sleep(1000)
    Call("_call")
EndFunc
Edited by Elzie
  • 2 weeks later...
Posted

I have one too. Look at WM_COPYDATS in my signature.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...