User Input - Multiple Guis

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
kjones9999
Posts: 5
Joined: 07 Mar 2017, 19:11

User Input - Multiple Guis

07 Mar 2017, 19:21

Hi all.

I am willing to figure this out, but just not having any luck.

I have this countdown script working just the way it should:

Code: Select all

#SingleInstance ignore
Progress, m1 fs70 fm12 zh10 CTgreen w325, % "00:00",  Enter time and return
loop,4
    {
    Input x, L1,{esc}{enter},1,2,3,4,5,6,7,8,9,0
    w .= x , y := SubStr("000" w, -3)
    if (ErrorLevel = "Match")
        Progress, m1 fs70 fm12 zh10 CTgreen w325, % SubStr(y,1,2) ":" SubStr(y,3,2), Enter
    else if (Errorlevel = "EndKey:enter")
        break
    else
        exitapp
    }
startover:
t := 0, w := SubStr(y,1,2)*60 + SubStr(y,3,2)
settimer,label,1000
return
label:
++t
if (t < w)
    Progress, % 100*(w-t)/w, % SubStr("00" floor((w-t)/60),-1) ":" SubStr("00" mod(w-t,60),-1), Countdown to Start Streaming
else if (t = w)
    {
    Progress, m1 fs70 fm12 zh10 CTred w325, 0, Started!
    UrlDownloadToFile, http://127.0.0.1:8088/API/?Function=StartStreaming, createtemp
Sleep, 200
FileDelete, createtemprun
}

esc:: ExitApp
What I need is a window open up to take a user input string to replace the "http://127.0.0.1:8088/API/?Function=StartStreaming" prior to starting the countdown

But I am stuck on trying to create a "pre-gui". Anyone willing to point me in the right direction?
User avatar
boiler
Posts: 16931
Joined: 21 Dec 2014, 02:44

Re: User Input - Multiple Guis

07 Mar 2017, 20:33

What do you mean by a "pre-gui"? You just want the user to be able to enter a string of characters? Why not use the InputBox command?
kjones9999
Posts: 5
Joined: 07 Mar 2017, 19:11

Re: User Input - Multiple Guis

07 Mar 2017, 20:40

I am having trouble figuring out how to call the gui, take the input, enter it into script and then execute the rest of the script.
User avatar
boiler
Posts: 16931
Joined: 21 Dec 2014, 02:44

Re: User Input - Multiple Guis

07 Mar 2017, 20:43

So, why not use InputBox?
kjones9999
Posts: 5
Joined: 07 Mar 2017, 19:11

Re: User Input - Multiple Guis

07 Mar 2017, 21:11

I have part of it working, but it doesnt store/place the input from the inputbox:

Code: Select all

#SingleInstance ignore
InputBox, Enter, vMix API URL, (API URL), show 
if ErrorLevel
    MsgBox, CANCEL was pressed.
else
    
Progress, m1 fs70 fm12 zh10 CTgreen w325, % "00:00",  Enter time and return
loop,4
    {
    Input x, L1,{esc}{enter},1,2,3,4,5,6,7,8,9,0
    w .= x , y := SubStr("000" w, -3)
    if (ErrorLevel = "Match")
        Progress, m1 fs70 fm12 zh10 CTgreen w325, % SubStr(y,1,2) ":" SubStr(y,3,2), Enter
    else if (Errorlevel = "EndKey:enter")
        break
    else
        exitapp
    }
startover:
t := 0, w := SubStr(y,1,2)*60 + SubStr(y,3,2)
settimer,label,1000
return
label:
++t
if (t < w)
    Progress, % 100*(w-t)/w, % SubStr("00" floor((w-t)/60),-1) ":" SubStr("00" mod(w-t,60),-1), Countdown to Start Streaming
else if (t = w)
    {
    Progress, m1 fs70 fm12 zh10 CTred w325, 0, Started!
    UrlDownloadToFile, %UserInput%, createtemp
Sleep, 200
FileDelete, createtemprun
}

esc:: ExitApp
kjones9999
Posts: 5
Joined: 07 Mar 2017, 19:11

Re: User Input - Multiple Guis

07 Mar 2017, 21:31

Ahhh I have to declare the variable.....

Code: Select all

#SingleInstance ignore
InputBox, UserInput, Enter, vMix API URL, (API URL), show 
if ErrorLevel
    MsgBox, CANCEL was pressed.
else
    
Progress, m1 fs70 fm12 zh10 CTgreen w325, % "00:00",  Enter time and return
loop,4
    {
    Input x, L1,{esc}{enter},1,2,3,4,5,6,7,8,9,0
    w .= x , y := SubStr("000" w, -3)
    if (ErrorLevel = "Match")
        Progress, m1 fs70 fm12 zh10 CTgreen w325, % SubStr(y,1,2) ":" SubStr(y,3,2), Enter
    else if (Errorlevel = "EndKey:enter")
        break
    else
        exitapp
    }
startover:
t := 0, w := SubStr(y,1,2)*60 + SubStr(y,3,2)
settimer,label,1000
return
label:
++t
if (t < w)
    Progress, % 100*(w-t)/w, % SubStr("00" floor((w-t)/60),-1) ":" SubStr("00" mod(w-t,60),-1), Countdown to Start Streaming
else if (t = w)
    {
    Progress, m1 fs70 fm12 zh10 CTred w325, 0, Started!
    UrlDownloadToFile, %UserInput%, createtemp
Sleep, 200
FileDelete, createtemprun
}

esc:: ExitApp

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], scriptor2016 and 360 guests