首页 > 解决方案 > 在 ComputerCraft 中使用 Lua 制作 API

问题描述

我正在尝试制作一个在 ComputerCraft 中加密字符串的 API。但是,我不确定如何让加密函数返回加密文本。我如何让函数返回一些东西?

标签: computercraft

解决方案


The syntax to make a function in lua is

function encrypt(text)
[you encrypting algorithm here]
return encrypteddata
end

Here are the documentation for the Strings in Lua (you'll need it to encrypt your text): https://www.tutorialspoint.com/lua/lua_strings.htm


推荐阅读