Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Internal error" #23

Closed
cdeadlock opened this issue Jul 17, 2016 · 3 comments
Closed

"Internal error" #23

cdeadlock opened this issue Jul 17, 2016 · 3 comments

Comments

@cdeadlock
Copy link

I am trying to get Autohotkey_h v2 to work because I wanted to use multithreading
https://hotkeyit.github.io/v2/

Scite4AutoHotkey gives me an "internal error. do you want to continue running without debug?" and immediately closes my debug output window so I can't even see what the problem might be.

clipboard threaded.ahk

#SingleInstance, FORCE

Gui, Add, Text,, Downloading From Youtube
Gui, +LabelMainGUI

global workers := []
Percent1 := 0
Percent2 := 0
Percent3 := 0
Percent4 := 0
Percent5 := 0
Percent6 := 0
Percent7 := 0
Percent8 := 0
Percent9 := 0
Percent10 := 0
Loop, 10
{
    Gui, Add, Progress, w300 h20 cBlue vPercent%A_Index%
    GuiControl,, Percent%A_Index%, 0
    GuiControl, Hide, Percent%A_Index%
}
Gui, Show

OnClipboardChange("ClipChanged")
Loop
{
    Sleep, 1000
    toremove := []

    for i,w in workers
    {       
        percent := w.percent
        OutputDebug %percent%       
        if w.done
        {
            toremove.Push(i)            
            if i < 11
            {
                GuiControl,, Percent%i%, 0
                GuiControl, Hide, Percent%i%                
            }
        }
        else if i < 11 && percent > 0
        {           
            if Percent%i% = 0
            {
                GuiControl, Show, Percent%i%
            }
            GuiControl,, Percent%i%, %percent%
        }
    }

    Sort toremove, N R U
    for i,v in toremove
    {       
        OutputDebug removing
        OutputDebug toremove[i]
        workers.RemoveAt(toremove[i])
    }

}
return

ClipChanged(Type){  
    FoundPos := InStr(clipboard, "https://www.youtube.com/watch" , CaseSensitive = true)
    url := clipboard    
    OutputDebug %url%
    if FoundPos
    {       
        ;Create worker thread
        Thread := ThreadObj("#include" " ytdownload.ahk", url)  
        workers.Push(Thread)        
    }
}
return

GuiClose:
ExitApp 
return
ytdownload.ahk

#SingleInstance, off
OutputDebug ytdownload
shell := ComObjCreate("WScript.Shell")
SetWorkingDir "d:\utils\youtube"
exec := Shell.Exec("d:\utils\youtube\youtube-dl.exe -a -")
url := A_Args[1]
hash := RegExReplace(url, "[^a-zA-Z0-9]", "")
readcount := 60
percent := 0
done := false
close := false

OutputDebug %url%
exec.StdIn.Write(url)
exec.StdIn.Close()

while, !exec.StdOut.AtEndOfStream
{       
    line := exec.StdOut.Read(readcount)
    RegExMatch(line, " (\d+)\.\d+`%", p)
    OutputDebug %line%
    OutputDebug percent 
    OutputDebug %p1%    
    If p1 > percent
    {
        percent := p1           
    }      
}   
done := true
while !close
{
    sleep 100
}
return
@joedf
Copy link

joedf commented Jul 20, 2016

I am not sure SciTE4AHK actually supports AHK_H. Have you tried contacting @HotKeyIt directly?

@HotKeyIt
Copy link

It works fine for me, try this version with latest changes: https://autohotkey.com/boards/viewtopic.php?p=121305#p121305

@fincs
Copy link
Owner

fincs commented May 28, 2022

Closing this issue due to Lexikos's debugger changes being integrated.

@fincs fincs closed this as completed May 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants