Error unexpected ahk

Just started using AutoHotkey 2 days ago, already expected with the endless possibilities.

mrvette134

Posts: 4
Joined: 15 May 2020, 00:20

Error: Unexpected «{«

Just started using AutoHotkey 2 days ago, already expected with the endless possibilities.

Sscreen shot of error attached.

Problem is in 2 parts, when I assigned a list of entries to be placed when I press F9 1) it sends it so fast that i need to slow it down, 2) and now i try to run the script and I get a pop-up error «Error: Unepcted «{«

Code: Select all

; ---- Admin Hot Keys

; DO NOT send commands too fast, Sleep 1-2 sec between each command
; ---------------------------------------------------------

F2::Send,{Enter} /tp -1600 70 1800{Enter}{Esc}  ;Union Base behind hills

F3::Send,{Enter} /tp -1325 85 1200{Enter}{Esc}  ;Union Apt # 1 Roof

F4::Send,{Enter} /tp 1927 70 1045{Enter}{Esc}   ;Sage Roof

F5::Send,{Enter} /tp 3276 -5 -789{Enter}{Esc}   ;Adders Tower

F6::Send,{Enter} /tp 2707 -40 -3063{Enter}{Esc} ;Blackrock Roof

F7::Send,{Enter} /tp -1605 -20 -2393{Enter}{Esc};Old Town Roof

F8::Send,{Enter} 	  ; Car Parts
 /give 2522 4{Enter} ;Spark plugs
Sleep, 1000
 /give 2569 {Enter} ;Small Carb
Sleep, 1000
 /give 2579{Enter} ;Long Oil Filter
Sleep, 1000
 /give 2578{Enter} ;Short Oil Filter
Sleep, 1000
 /give 2513{Enter} ;Fan Belt
Sleep, 1000
 /give 2501{Enter} ;Alternator
Sleep, 1000
 /give 2571{Enter}{Esc} ;Jerry Can

F9::Send,{Enter}; Generator Kit
Send, /give 4001 0{Enter};Generator
Send, /give 2569{Enter};Small Carburator
Send, /give 2522 4{Enter};Spark Plugs
Send, /give 2570 0{Enter};Pull Start
Send, /give 2532 0{Enter};Ext Cord
Send, /give 2506 10{Enter};Circuit Breakers
Send, /give 2571 0{Enter};Jerry Can
return

[Mod edit: [code][/code] tags added]

I’ve Googled, looked at the AHK help files, and now hoping for assistance here.
Keith

Attachments

Error Unexpected curly bracket.png
Error Unexpected curly bracket.png (15.74 KiB) Viewed 782 times

Rohwedder

Posts: 6454
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Error: Unexpected «{«

15 May 2020, 01:01

Hallo,
instead of:

Code: Select all

F8::Send,{Enter} ; Car Parts
/give 2522 4{Enter} ;Spark plugs
Sleep, 1000
/give 2569 {Enter} ;Small Carb
Sleep, 1000
/give 2579{Enter} ;Long Oil Filter
Sleep, 1000
/give 2578{Enter} ;Short Oil Filter
Sleep, 1000
/give 2513{Enter} ;Fan Belt
Sleep, 1000
/give 2501{Enter} ;Alternator
Sleep, 1000
/give 2571{Enter}{Esc} ;Jerry Can

use:

Code: Select all

F8::Send,{Enter} ; Car Parts
Send, /give 2522 4{Enter} ;Spark plugs
Sleep, 1000
Send, /give 2569 {Enter} ;Small Carb
Sleep, 1000
Send, /give 2579{Enter} ;Long Oil Filter
Sleep, 1000
Send, /give 2578{Enter} ;Short Oil Filter
Sleep, 1000
Send, /give 2513{Enter} ;Fan Belt
Sleep, 1000
Send, /give 2501{Enter} ;Alternator
Sleep, 1000
Send, /give 2571{Enter}{Esc} ;Jerry Can
Return ; you need this Return!

Helgef

Posts: 4693
Joined: 17 Jul 2016, 01:02

Contact:

Re: Error: Unexpected «{«

15 May 2020, 01:21

Your code is written for ahk v1.

In v2 you need to quote text and remove initial commas, eg,

Cheers.

Rohwedder

Posts: 6454
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Error: Unexpected «{«

15 May 2020, 01:35

I believe,
Just started using AutoHotkey 2 days ago
means:
Just started using AutoHotkey (2 days) ago

Helgef

Posts: 4693
Joined: 17 Jul 2016, 01:02

Contact:

Re: Error: Unexpected «{«

15 May 2020, 02:16

Hehe, I see, it is supposed to be …two days ago then.

Thanks for your continued support @Rohwedder :beer: .

Cheers.

mrvette134

Posts: 4
Joined: 15 May 2020, 00:20

Re: Error: Unexpected «{«

15 May 2020, 16:13

Hi guys,

FYI: AutoHotkey_1.1.32.00 (sorry if i confused it with AutoHotkey ver 2.

Thanks for the tip, i was not clearly seeing how i was writing both F8 & F9 different with the «Send, /give»
And, I’ve learned i have to put a space between {Enter} ,but before ;Spark plugs, or it included the comment in the output.

As of now, when I Save and Run, press F8 or F9, and I get is 1 carriage return ???

Current Code:

F8::Send,{Enter} ;Car Parts
Send, /give 2522 4 {Enter} ;Spark plugs
Send, /give 2569 0 {Enter} ;Small Carburetor
Send, /give 2579 0 {Enter} ;Long Oil Filter
Send, /give 2578 0 {Enter} ;Short Oil Filter
Send, /give 2513 0 {Enter} ;Fan Belt
Send, /give 2501 0 {Enter} ;Alternator
Send, /give 2571 0 {Enter}{Esc} ;Jerry Can
return

F9::Send,{Enter} ;Generator Kit
Send, /give 4001 {Enter} ;Generator
Send, /give 2569 {Enter} ;Small Carburetor
Send, /give 2522 {Enter} ;Spark Plugs
Send, /give 2570 {Enter} ;Pull Start
Send, /give 2532 {Enter} ;Ext Cord
Send, /give 2506 10{Enter} ;Circuit Breakers
Send, /give 2571 {Enter} ;Jerry Can
return

swagfag

Posts: 5799
Joined: 11 Jan 2017, 17:59

Re: Error: Unexpected «{«

15 May 2020, 16:17

should be

Code: Select all

F8::
	Send,{Enter} ;Car Parts
	Send, /give 2522 4 {Enter} ;Spark plugs
	Send, /give 2569 0 {Enter} ;Small Carburetor
	Send, /give 2579 0 {Enter} ;Long Oil Filter
	Send, /give 2578 0 {Enter} ;Short Oil Filter
	Send, /give 2513 0 {Enter} ;Fan Belt
	Send, /give 2501 0 {Enter} ;Alternator
	Send, /give 2571 0 {Enter}{Esc} ;Jerry Can
return

otherwise «the return is implicit»

mrvette134

Posts: 4
Joined: 15 May 2020, 00:20

Re: Error: Unexpected «{«

15 May 2020, 17:39

Hi Swag,

That got it to work. You’re a big help and thank you.

May i ask, as i tried using pause, to slow down the keystrokes or add a 1 sec pause between commands. It goes so fast, some of it gets skipped.

I was unaware that the indention of the lines between F8 to Return was a thing. I appreciate you pointing that out. Lesson learned.

WORKS (minus going so fast it skips a line or two)

F8::
Send,{Enter} ;Car Parts
Send, /give 2522 4 {Enter} ;Spark plugs
Send, /give 2569 1 {Enter} ;Small Carburetor
Send, /give 2579 1 {Enter} ;Long Oil Filter
Send, /give 2578 1 {Enter} ;Short Oil Filter
Send, /give 2513 1 {Enter} ;Fan Belt
Send, /give 2501 1 {Enter} ;Alternator
Send, /give 2571 1 {Enter}{Esc} ;Jerry Can
return

User avatar

boiler

Posts: 13611
Joined: 21 Dec 2014, 02:44

Re: Error: Unexpected «{«

15 May 2020, 18:41

Pause is not the command that causes it to wait for a certain period of time. That command is Sleep. The amount it waits is specified in msec, so a value of 1000 will cause it to wait for 1 second. If you want that amount of delay between your Send commands, it would be like this:

Code: Select all

F8::
	Send,{Enter} ;Car Parts
	Send, /give 2522 4 {Enter} ;Spark plugs
	Sleep, 1000
	Send, /give 2569 0 {Enter} ;Small Carburetor
	Sleep, 1000
	Send, /give 2579 0 {Enter} ;Long Oil Filter
	Sleep, 1000
	Send, /give 2578 0 {Enter} ;Short Oil Filter
	Sleep, 1000
	Send, /give 2513 0 {Enter} ;Fan Belt
	Sleep, 1000
	Send, /give 2501 0 {Enter} ;Alternator
	Sleep, 1000
	Send, /give 2571 0 {Enter}{Esc} ;Jerry Can
return

If you want to slow down how fast the individual characters are sent within a Send command, use SetKeyDelay. The default is 10 ms, so if you want to have the characters «typed» at about half the speed, you could put the line SetKeyDelay, 20 at the top of your script.

By the way, the indenting doesn’t affect the execution of the code, but it is good practice to do so because it visually groups the F8 hotkey subroutine’s commands (it becomes more helpful when working with larger scripts).

Regarding the space before the {Enter}, it doesn’t seem that it would be necessary. You might want to try it without to confirm that even though it doesn’t seem to hurt in this case.

mrvette134

Posts: 4
Joined: 15 May 2020, 00:20

Re: Error: Unexpected «{«

16 May 2020, 00:16

Praise everyone for their input. Everything is working and the sleep,20 helped. Also, i appreciate you guys explaining how the code works. I stumbled across this software and even with the YouTube tutorial i was left in the dark.

Thanks again and I am looking forward to learning more.


Return to “Ask for Help”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], noswall and 102 guests

I created a script to manage some raspberry pi units I have. It’s saying that the closing bracket near the end of the code for the loop isn’t correct. I’m not sure what to change it seems like an error. Specifically it’s the closing bracket after » octopicounter++» is incorrect.

I’m using the most current version of autohotkey

Can someone help me understand what’s wrong with this?

capslock & j::
InputBox,octopiinput,Select Octoprint Instance(1-3), Select Octoprint Instance(1-3),
octopicounter=0
loop, 4 
{
run "C:Program Files (x86)GoogleChromeApplicationchrome.exe"

sleep 300
 if octopicounter=0
{
sleep 100
	if octopiinput=3
	{
	
	run, C:Program Files (x86)GoogleChromeApplicationchrome.exe http://192.168.1.14
	 ;sendinput, ^lhttp://192.168.2.167{enter}
	}
	else if octopiinput=2
	{
   	 ;sendinput, ^lhttp://192.168.1.13/{enter}
   	 run, C:Program Files (x86)GoogleChromeApplicationchrome.exe http://192.168.1.13
	}
	 else if octopiinput=1
	{
	run C:Program Files (x86)GoogleChromeApplicationchrome.exe http://192.168.1.12
   	 ;sendinput, ^lhttp://192.168.1.12/{enter}
	}  
	} 
 if octopicounter=1
{
	if octopiinput=3	{
			 run C:Program Files (x86)GoogleChromeApplicationchrome.exe http://192.168.1.14:5001
;sendinput, ^lhttp://192.168.2.167:5001{enter}
}
	else if octopiinput=2
	{
   	 ;sendinput, ^lhttp://192.168.1.13/{enter}
   	 run C:Program Files (x86)GoogleChromeApplicationchrome.exe http://192.168.1.13:5001
	}
	 else if octopiinput=1
	{
	run C:Program Files (x86)GoogleChromeApplicationchrome.exe http://192.168.1.12:5001
   	 ;sendinput, ^lhttp://192.168.1.12/{enter}
	} 
} 
if octopicounter=2
{
if octopiinput=3
{
;sendinput, ^lhttp://192.168.2.167:5002{enter}
		 run C:Program Files (x86)GoogleChromeApplicationchrome.exe http://192.168.1.14:5002
}
	else if octopiinput=2
	{
   	 ;sendinput, ^lhttp://192.168.1.13/{enter}
   	 run C:Program Files (x86)GoogleChromeApplicationchrome.exe http://192.168.1.13:5002
	}
	 else if octopiinput=1
	{
	run C:Program Files (x86)GoogleChromeApplicationchrome.exe http://192.168.1.12:5002
   	 ;sendinput, ^lhttp://192.168.1.12/{enter}
	} 

}
if octopicounter=3
{
	if octopiinput=3
{
    ;sendinput, ^lhttp://192.168.2.167:5003{enter}
    		 run C:Program Files (x86)GoogleChromeApplicationchrome.exe http://192.168.1.14:5003

}
	else if octopiinput=2
	{
   	 ;sendinput, ^lhttp://192.168.1.13/{enter}
   	 run C:Program Files (x86)GoogleChromeApplicationchrome.exe http://192.168.1.13:5003
	}
	 else if octopiinput=1
	{
	run C:Program Files (x86)GoogleChromeApplicationchrome.exe http://192.168.1.12:5003
   	 ;sendinput, ^lhttp://192.168.1.12/{enter}
	}  


}

sleep 20
sendinput,{enter}
octopicounter++
}
if octopiinput=1
{
	
	winwait,Mini1 [OctoPrint]
	winwait,Mini2 [OctoPrint]
	winwait,Mini3 [OctoPrint]
	winwait,Mini4 [OctoPrint]
	sleep 1000
    winmove,Mini1 [OctoPrint],,0,0,960,1040
	winmove,Mini2 [OctoPrint],,960,0,960,1040
	winmove,Mini3 [OctoPrint],,1920,0,960,1040
	winmove,Mini4 [OctoPrint],,2880,0,960,1040
}
if octopiinput=2
{
	winwait,Mini5 [OctoPrint]
	winwait,Mini6 [OctoPrint]
	winwait,Mini7 [OctoPrint]
	winwait,Mini8 [OctoPrint]
    winmove,Mini5 [OctoPrint],,0,0,960,1040
	winmove,Mini6 [OctoPrint],,960,0,960,1040
	winmove,Mini7 [OctoPrint],,1920,0,960,1040
	winmove,Mini8 [OctoPrint],,2880,0,960,1040
}
if octopiinput=3
{
	winwait,I3-1 [OctoPrint]
	winwait,I3-2 [OctoPrint]
	winwait,I3-3 [OctoPrint]
	winwait,I3-4 [OctoPrint]
    winmove,I3-1 [OctoPrint],,0,0,960,1040
	winmove,I3-2 [OctoPrint],,960,0,960,1040
	winmove,I3-3 [OctoPrint],,1920,0,960,1040
	winmove,I3-4 [OctoPrint],,2880,0,960,1040
}
return
/* [script info] version = 3.4 description = goto line and highlight the error text (autohotkey only) author = davebrny source = https://gist.github.com/davebrny/ff6a00e55d9d81e4bea9fe1d852d84a9 */ #noEnv #persistent #singleInstance, force setTimer, sublime_goto_error, 1000 return ; end of auto-execute —— sublime_goto_error: if winExist(«ahk_class #32770«, «The script was not reloaded«) or winExist(«ahk_class #32770«, «The current thread will exit«) or winExist(«ahk_class #32770«, «The program will exit«) { setTimer, sublime_goto_error, off winGetTitle, sublime_title, ahk_exe sublime_text.exe winGetTitle, error_title, ahk_class #32770 if inStr(sublime_title, «« error_title) ;# get file path from focused file { stringGetPos, pos, sublime_title, , R stringMid, mid_title, sublime_title, pos, , L splitPath, mid_title, , file_dir, file_ext, name_no_ext stringSplit, split, file_ext, % a_space ; remove • from an unsaved file error_path := file_dir «« name_no_ext «.« split1 } winGetText, error_text, ahk_class #32770 ; only continue if error path is in the msgBox or the focused file if !inStr(error_text, «in #include file«) and (error_path = «») goTo, sublime_error_end ; ———————————— ;# move msgBox to the right winGetPos, , , error_width, , ahk_class #32770 sysGet, monitor_, MonitorWorkArea winMove, ahk_class #32770, , % monitor_right error_width winSet, alwaysOnTop, on, ahk_class #32770 ; keep msgBox on top ;# get sublime .exe path if winExist(«ahk_exe sublime_text.exe«) winGet, sublime_path, ProcessPath, ahk_exe sublime_text.exe else sublime_path := portable_apps «SublimeText3sublime_text.exe« if !fileExist(sublime_path) ; if invalid exe path goTo, sublime_error_end ; ————————————- ;# get file path from msgBox if inStr(error_text, «in #include file«) error_path := get_error_path(error_text) ;# get error text if inStr(error_text, «Specific«) line_text := specific_error(error_text) else if inStr(error_text, «Line Text:«) line_text := get_line_text(error_text) else if inStr(error_text, «Unexpected«) line_text := unexpected_error(error_text) else if inStr(error_text, «illegal character:«) line_text := get_illegal(error_text) ;# get line number if inStr(error_text, «—>«) line_number := get_arrow_line(error_text) else if inStr(error_text, «Error at line«) line_number := get_error_line(error_text) if (line_number != «») line_number := «:« . line_number ; ——————————————————————— run, % ««»« sublime_path ««»« a_space ««»« error_path ««»« line_number ; ——————————————————————— winWaitActive, ahk_exe sublime_text.exe, , 3 if winExist(«ahk_exe sublime_text.exe«) and (line_text != «») { fileRead, file_contents, % error_path strReplace(file_contents, line_text, , count) if inStr(file_contents, line_text) and (count = 1) { winActivate, ahk_exe sublime_text.exe send ^{f} ;# select the error text sleep 100 sendRaw % line_text sleep 700 send {esc} } } winSet, alwaysOnTop, off, ahk_class #32770 ; winActivate, ahk_class #32770 ; have the error msg lose focus once sublime text is focused on loop, ; wait for ahk error window to close sleep 1000 until !winExist(error_title « ahk_class #32770«) goTo, sublime_error_end } return sublime_error_end: file_contents := «» line_number := «» error_path := «» setTimer, sublime_goto_error, on return get_error_line(error_text) { stringGetPos, pos, error_text, % «Error at line« stringMid, text_after, error_text, pos + 1 stringGetPos, pos, text_after, `n, L1 stringMid, line_text, text_after,pos, , L line_text .= a_space stringGetPos, pos, line_text, % a_space, L4 stringMid, line_number, line_text, pos, , L return regExReplace(line_number, «[^0-9]«) } get_error_path(error_text) { stringGetPos, pos, error_text, % «in #include file« stringMid, text_after, error_text, pos + 19 stringGetPos, pos, text_after, % ««»«, L1 stringMid, path, text_after, pos, , L return path } get_line_text(error_text) { stringGetPos, pos, error_text, Line Text: stringMid, line_text, error_text, pos + 12 stringSplit, split, line_text, `n, % a_space return split1 } get_illegal(error_text) { stringGetPos, pos, error_text, illegal character: stringMid, illegal, error_text, pos + 21 stringGetPos, pos, illegal, % ««»«, R1 stringMid, illegal, illegal, pos, , L return illegal } get_arrow_line(error_text) { stringGetPos, pos, error_text, > stringMid, after_arrow, error_text, pos + 5 StringSplit, split, after_arrow, :, % a_space return trim(split1) } specific_error(error_text) { stringGetPos, pos, error_text, Specifically: stringMid, specific_text, error_text, pos + 15 stringSplit, split, specific_text, `n, % a_space if !inStr(error_text, «Action:«) return split1 } unexpected_error(error_text) { stringGetPos, pos, error_text, unexpected stringMid, unexpected, error_text, pos + 13 stringSplit, split, unexpected, ««»«, % a_space return split1 }

I hope i can help.

;#NoTrayIcon
#Persistent
#SingleInstance force
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Recommended for catching common errors.
#MaxHotkeysPerInterval 99000000
#HotkeyInterval 99000000
#KeyHistory 0
#UseHook
ListLines Off
Process, Priority, , H
SetBatchLines, -1
SetKeyDelay, -1, -1
SetMouseDelay, -1
SetDefaultMouseSpeed, 0
SetWinDelay, -1
SetControlDelay, -1
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.

OnExit(«cleanup_before_exit»)
SetFormat, Float, 0.3
global volLvlB0 = -36.0
global VMR_FUNCTIONS := {}
global VMR_DLL_DRIVE := «C:»
global VMR_DLL_DIRPATH := «Program Files (x86)VBVoicemeeter»
global VMR_DLL_FILENAME_32 := «VoicemeeterRemote.dll»
global VMR_DLL_FILENAME_64 := «VoicemeeterRemote64.dll»
global VMR_DLL_FULL_PATH := VMR_DLL_DRIVE . «» . VMR_DLL_DIRPATH . «»
Sleep, 500
if (A_Is64bitOS) {
VMR_DLL_FULL_PATH .= VMR_DLL_FILENAME_64
} else {
VMR_DLL_FULL_PATH .= VMR_DLL_FILENAME_32
}

; == START OF EXECUTION ==
; ========================

; Load the VoicemeeterRemote DLL:
; This returns a module handle
global VMR_MODULE := DllCall(«LoadLibrary», «Str», VMR_DLL_FULL_PATH, «Ptr»)
if (ErrorLevel || VMR_MODULE == 0)
die(«Attempt to load VoiceMeeter Remote DLL failed.»)

; Populate VMR_FUNCTIONS
add_vmr_function(«Login»)
add_vmr_function(«Logout»)
add_vmr_function(«RunVoicemeeter»)
add_vmr_function(«SetParameterFloat»)
add_vmr_function(«GetParameterFloat»)
add_vmr_function(«IsParametersDirty»)

; «Login» to Voicemeeter, by calling the function in the DLL named ‘VBVMR_Login()’…
login_result := DllCall(VMR_FUNCTIONS[«Login»], «Int»)
if (ErrorLevel || login_result < 0)
die(«VoiceMeeter Remote login failed.»)

; If the login returns 1, that apparently means that Voicemeeter isn’t running,
; so we start it; pass 1 to run Voicemeeter, or 2 for Voicemeeter Banana:
if (login_result == 1) {
DllCall(VMR_FUNCTIONS[«RunVoicemeeter»], «Int», 2, «Int»)
if (ErrorLevel)
die(«Attempt to run VoiceMeeter failed.»)
Sleep 2000
}

spoOpen := 0

; == HOTKEYS ==
; =============

loop{
WinGetTitle, spotifyname, ahk_class SpotifyMainWindow
if(spotifyname != «» && spoOpen = 0){
DllCall(VMR_FUNCTIONS[«SetParameterFloat»], «AStr», «Bus[0].mode.Repeat», «Float», 1.0, «Int»)
spoOpen := 1
} else if (spoOpen = 1 && spotifyname = «»){
DllCall(VMR_FUNCTIONS[«SetParameterFloat»], «AStr», «Bus[0].mode.Normal», «Float», 1.0, «Int»)
spoOpen := 0
} else {
;do nothing
}
Sleep, 5000
ToolTip
}

Volume_Up::
readVolLvl()
;volLvlB0 += 1
;adjustVolLvl()
return

Volume_Down::
readVolLvl()
;volLvlB0 -= 1
;adjustVolLvl()
return

; == Functions ==
; ===============
;DllCall(VMR_FUNCTIONS[«SetParameterFloat»], «AStr», «Strip[0].B1», «Float», 1.0, «Int»)

readVolLvl(){
DLLCall(VMR_FUNCTIONS[«IsParametersDirty»])
statusLvlB0 = DllCall(VMR_FUNCTIONS[«GetParameterFloat»], «AStr», «Bus[0].Gain», «Ptr», &volLvlB0, «Int»)
if (statusLvlB0 < 0){
MsgBox, Error: %statusLvlB0%
} else {
SetFormat, Float, 0.3
MsgBox, %volLvlB0%
}
}

adjustVolLvl() {
if (volLvlB0 > 12.0){
volLvlB0 = 12.0
} else if (volLvlB0 < -60.0) {
volLvlB0 = -60.0
}
DllCall(VMR_FUNCTIONS[«SetParameterFloat»], «AStr», «Bus[0].Gain», «Float», volLvlB0, «Int»)
}

add_vmr_function(func_name) {
VMR_FUNCTIONS[func_name] := DllCall(«GetProcAddress», «Ptr», VMR_MODULE, «AStr», «VBVMR_» . func_name, «Ptr»)
if (ErrorLevel || VMR_FUNCTIONS[func_name] == 0)
die(«Failed to register VMR function » . func_name . «.»)
}

cleanup_before_exit(exit_reason, exit_code) {
DllCall(VMR_FUNCTIONS[«Logout»], «Int»)
; OnExit functions must return 0 to allow the app to exit.
return 0
}

die(die_string:=»UNSPECIFIED FATAL ERROR.», exit_status:=254) {
MsgBox 16, FATAL ERROR, %die_string%
ExitApp exit_status
}

FHex( int, pad=8 ) { ; Function by [VxE]. Formats an integer (decimals are truncated) as hex. NOT IN USE FOR NOW
; «Pad» may be the minimum number of digits that should appear on the right of the «0x».
Static hx := «0123456789ABCDEF»
If !( 0 < int |= 0 )
Return !int ? «0x0» : «-» FHex( -int, pad )
s := 1 + Floor( Ln( int ) / Ln( 16 ) )
h := SubStr( «0x0000000000000000», 1, pad := pad < s ? s + 2 : pad < 16 ? pad + 2 : 18 )
u := A_IsUnicode = 1
Loop % s
NumPut( *( &hx + ( ( int & 15 ) << u ) ), h, pad — A_Index << u, «UChar» ), int >>= 4
Return h
}

The 2 red lines should solve your problem.

info out of the VoicemeeterRemote.h:
/**
@brief Check if parameters have changed.
Call this function periodically (typically every 10 or 20ms).
(this function must be called from one thread only)

@return: 0: no new paramters.
1: New parameters -> update your display.
-1: error (unexpected)
-2: no server.
*/

Don’t worry your script was very helpful to understand this API.
Thanks for it too.

Понравилась статья? Поделить с друзьями:
  • Error undefined при печати
  • Error undefined variable sass
  • Error undefined variable in expression clanids
  • Error undefined symbol wsregistercustomimagelistresolution
  • Error undefined reference to vtable