Page 1 of 1

Function are data/char limited ?

Posted: 14 Jan 2020, 10:52
by scriptors
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)

Re: Function are data/char limited ?

Posted: 14 Jan 2020, 11:24
by swagfag
so, dont add script lines that contain errors. what else am i supposed to say?

Menu Tray, Tip, ...

Re: Function are data/char limited ?

Posted: 14 Jan 2020, 17:09
by HotKeyIt
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).

Re: Function are data/char limited ?

Posted: 15 Jan 2020, 03:06
by scriptors
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 ;)

Re: Function are data/char limited ?

Posted: 15 Jan 2020, 12:35
by scriptors
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 ;)

Re: Function are data/char limited ?

Posted: 15 Jan 2020, 12:52
by swagfag
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.

Re: Function are data/char limited ?

Posted: 20 Jan 2020, 05:54
by scriptors
: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 ?

Re: Function are data/char limited ?

Posted: 20 Jan 2020, 07:08
by swagfag
i don't know what u mean by "do to split one thread"

Re: Function are data/char limited ?

Posted: 20 Jan 2020, 16:02
by HotKeyIt

Code: Select all

Script:="MsgBox first ~16834 characters"
Script.="MsgBox More lines up to 16834 characters"
Script.="MsgBox More lines ... and so on
"

Re: Function are data/char limited ?

Posted: 21 Jan 2020, 09:57
by scriptors
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
	; ...
	)")
}

Re: Function are data/char limited ?

Posted: 21 Jan 2020, 10:07
by swagfag

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)
}

Re: Function are data/char limited ?

Posted: 22 Jan 2020, 04:49
by scriptors
:thumbup: