<<EN
Ok, my 2 days work is over. The result is modifyed original version of script.dll (i hope yoko didnt add any new features there in his release
) with include feature.
The way it works can be seen from examples.
<<RUS
Наконец-то я закончил свою 2-ух дневную работу. В результате получился модифицированный скриптовый модуль с поддержкой инклудов. Смотрите примеры использование и все поймете
.
C:\UO\Inject\Scripts\mainfunct.sc
Code:
<<include <funct1.sc>
<<include <\reserv\funct2.sc>
<<include <\reserv\out\funct3.sc>
sub main()
UO.Print("Hello from main function!")
FunctionInFunct1()
FunctionInFunct2()
FunctionInFunct3()
end sub
C:\UO\Inject\Scripts\funct1.sc
Code:
sub FunctionInFunct1()
UO.Print("Hello from funct1!")
end sub
C:\UO\Inject\Scripts\reserv\funct2.sc
Code:
sub FunctionInFunct2()
UO.Print("Hello from funct2!")
end sub
C:\UO\Inject\Scripts\reserv\out\funct3.sc
Code:
sub FunctionInFunct3()
UO.Print("Hello from funct3!")
end sub
<<EN
Ok, the examples are over and now some docs.
1) Syntax is
Code:
<<include <FILENAME>
2) FILENAME is a path to the included file FROM THE MAIN FILE.
That means that all includes are done looking on the dirs from the main script file.
Like if you open C:\main.sc and there is include "\funct\load.sc" then it will load the C:\funct\load.sc. AND if load.sc includes some "\dir\other.sc" then IT WILL NOT LOAD C:\funct\dir\other.sc . The file that will be loaded is C:\dir\other.sc because the main file is main.sc and it is on C:\ so that is the beginning of the search.
3) includes are fully recursive with the only limiting that is told about in N2.
4) Include includes files to the end of current script, so dunt try putting parts of functions in different files and then including them togather.
<<RU
Примеры закончились, теперь документация
1) Синтакс:
Code:
<<include <FILENAME>
2) FILENAME это полный относительный (от запускаемого файла) путь и имя файла.
Тоесть если INCLUDE сделать в друго заинклуженом файле, то путь указанный там будет относительно самого основного открытого в инжекте файле.
3) Инклуды полностью рекурсивные с единственным ограничением описанным в пункте 2.
4) Все заинклуженные файлы помещаються в конец текущего файла где-бы они не находились. Тоесть не пытайтесь разбить одну функцию по частям на файлы, а потом пробовать заинклудить вместе.
LINK:
http://beyonder.nm.ru/script.dll
ALTERNATIVE
LINK OR
DL Link.
PS. There is also Search and Replace feature included. Search for it by Ctrl+F.
ПС. Также встроенная функция поиска и замены в тексте скрипта. Вызываеться по Ctrl+F.