Версия для печати темы

Нажмите сюда для просмотра этой темы в обычном формате

UoKit.com Форумы _ UO Pilot _ Script Lua in UoPilot

Автор: Kiel 20.4.2024, 23:24


Hey guys
I'm learning how to use UoPilot and would like to know how to run a Lua script through it.
Can you help me?
Thanks in advance.

==================

Привет, ребята
Я учусь использовать UoPilot и хотел бы знать, как запустить через него скрипт Lua.
Вы можете помочь мне?
Заранее спасибо.


Privet, rebyata
YA uchus' ispol'zovat' UoPilot i khotel by znat', kak zapustit' cherez nego skript Lua.
Vy mozhete pomoch' mne?
Заранее спасибо.

Автор: DarkMaster 20.4.2024, 23:42

first one you need to enable it. Put to 0 string:
--lua

In general its same. Just use brackets after function:
command()

and split params by comma
command(param1, param2)

swap set #var to
var = command(param1, param2)

swap = to == inside if, dont forget "then", not end_if, but just "end"

--lua
if var == 10 then
var = command(param1, param2)
end

useful links:
https://uopilot.uokit.com/wiki/index.php?title=%D0%92%D0%B2%D0%B5%D0%B4%D0%B5%D0%BD%D0%B8%D0%B5_%D0%B2_%D1%81%D0%B8%D0%BD%D1%82%D0%B0%D0%BA%D1%81%D0%B8%D1%81_Lua
https://github.com/xmury/Lua/blob/master/Lua_for_15_minutes%5BEN%5D.md

Автор: Kiel 21.4.2024, 15:13

Цитата(DarkMaster @ 20.4.2024, 17:42) *

first one you need to enable it. Put to 0 string:
--lua

In general its same. Just use brackets after function:
command()

and split params by comma
command(param1, param2)

swap set #var to
var = command(param1, param2)

swap = to == inside if, dont forget "then", not end_if, but just "end"

--lua
if var == 10 then
var = command(param1, param2)
end

useful links:
https://uopilot.uokit.com/wiki/index.php?title=%D0%92%D0%B2%D0%B5%D0%B4%D0%B5%D0%BD%D0%B8%D0%B5_%D0%B2_%D1%81%D0%B8%D0%BD%D1%82%D0%B0%D0%BA%D1%81%D0%B8%D1%81_Lua
https://github.com/xmury/Lua/blob/master/Lua_for_15_minutes%5BEN%5D.md



Thanks for answering.
I know to program in Lua. Before, I used ****, he use the Lua language, is discontinued
I need to know how I make the UoPilot code to run the.Lua script.
I'm from Brazil (Brazil) I speak little English and no Russian, sorry
Sorry if I can't make myself understood.
Grateful!

Автор: DarkMaster 21.4.2024, 18:45

Im not sure what you mean. Its same like old syntax. Same functions, but on lua syntax. List of functions https://uopilot.uokit.com/wiki/index.php?title=%D0%A1%D0%BF%D0%B8%D1%81%D0%BE%D0%BA_%D1%84%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D0%B9_(Lua)
Dont forget to enable lua! Put "--lua" into 0 string to enable it (without quotes). If its not enough for understanding, then explain what you dont understand.

// btw we use not main lua. We have a fork luajit. It have some more important functions like jit(yes, im captain), ffi, load dlls and etc.

Русская версия Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)