Function are data/char limited ?

Ask for help, how to use AHK_H, etc.
scriptors
Posts: 201
Joined: 25 Feb 2016, 09:01

Function are data/char limited ?

14 Jan 2020, 10:52

Sorry for question, i'm not at home now so update after with exact error type

Problem are this:

Code: Select all

^!t::
MyFunction_H(1,2,3)
MyFunction_H(4,5,6)
MyFunction_H(7,8,9)
Return

MyFunction_H(data_1,data_2,data_3)
	{
	return AhkThread("
	(
	; ...
	; 80 line of script
;
	)")
}
this work perfectly ...

if i add some other line of script (other 20 line for example) i have error and script can't reloaded after save it :cry:

ps. other question, when i have 15 script session work "simultaneously", with 15 "H" logo into the windows icon bar ... all have the same name, :( ... it's possibile to give a specific name for every session ? (so if one have problem i know on wich NOX session i have problem ... usually are by pixel colour search)
swagfag
Posts: 3249
Joined: 11 Jan 2017, 17:59

Re: Function are data/char limited ?

14 Jan 2020, 11:24

so, dont add script lines that contain errors. what else am i supposed to say?

Menu Tray, Tip, ...
HotKeyIt
Posts: 1938
Joined: 29 Sep 2013, 18:35
Contact:

Re: Function are data/char limited ?

14 Jan 2020, 17:09

Check you script with MsgBox % Clipboard:="... and try to execute it separately, if you have an error in script there is nothing to restart.
Also you should have on AhkThread script and call the function, no need to create multiple Threads (each call to AhkThread will create new script).
scriptors
Posts: 201
Joined: 25 Feb 2016, 09:01

Re: Function are data/char limited ?

15 Jan 2020, 03:06

sorry but I am super cooled and I was unable to reproduce the error screen again

will try again tonight

ps. however, the script acts on 10 NOX sessions, windows of the same size, same game but different accounts and different screen position of course ;)
scriptors
Posts: 201
Joined: 25 Feb 2016, 09:01

Re: Function are data/char limited ?

15 Jan 2020, 12:35

Here the error:

Code: Select all

---------------------------
NOX.ahk
---------------------------
Error:  Expression too long

	Line#
…
…
...

--->	3969: Return,AhkThread("	CoordMode ,Pixel,Screen ;set this to use absolute coordinates and for specific thread

…
…
…

The script was not reloaded; the old version will remain in effect.
---------------------------
OK   
---------------------------
I try to put some PixelGetColor like Subroutine so reduce the lenght of script … post result after ;)
swagfag
Posts: 3249
Joined: 11 Jan 2017, 17:59

Re: Function are data/char limited ?

15 Jan 2020, 12:52

a line(incl. continuation sections and individual lines concatenated with the string concatenation operator) may not exceed 16k characters.
split ur script into 2 or more continuation sections and concatenate them. then launch the ahkthread.
scriptors
Posts: 201
Joined: 25 Feb 2016, 09:01

Re: Function are data/char limited ?

20 Jan 2020, 05:54

:thumbup: ok

I reduced the size of the text by merging/modify some pieces of script and using the GoSub command, now all work

But, how do i do to "split" one thread ? Have some example ?
swagfag
Posts: 3249
Joined: 11 Jan 2017, 17:59

Re: Function are data/char limited ?

20 Jan 2020, 07:08

i don't know what u mean by "do to split one thread"
HotKeyIt
Posts: 1938
Joined: 29 Sep 2013, 18:35
Contact:

Re: Function are data/char limited ?

20 Jan 2020, 16:02

Code: Select all

Script:="MsgBox first ~16834 characters"
Script.="MsgBox More lines up to 16834 characters"
Script.="MsgBox More lines ... and so on
"
scriptors
Posts: 201
Joined: 25 Feb 2016, 09:01

Re: Function are data/char limited ?

21 Jan 2020, 09:57

I feel a little stupid but I don't understand :oops:

Error are on: ---> 3969: Return,AhkThread(" .......

so, like this ?

Code: Select all

^!t::
MyFunction_H(1,2,3)
MyFunction_H(4,5,6)
MyFunction_H(7,8,9)
Return

MyFunction_H(data_1,data_2,data_3)
	{
	return AhkThread("
	(
	; ...
	; my script FIRST~16834 characters
	; ...
	)")
	return AhkThread("
	(
	; ...
	; my script SECOND ~16834 characters
	; ...
	)")
}
swagfag
Posts: 3249
Joined: 11 Jan 2017, 17:59

Re: Function are data/char limited ?

21 Jan 2020, 10:07

Code: Select all

MyFunction_H(data_1,data_2,data_3)
	{
	Script:="MsgBox first ~16834 characters"
Script.="MsgBox More lines up to 16834 characters"
Script.="MsgBox More lines ... and so on"
	return AhkThread(Script)
}

Return to “Ask For Help”

Who is online

Users browsing this forum: No registered users and 4 guests