Patrick Martin
Patrick Martin

Reputation: 55

Making an API with Lua in ComputerCraft

I'm trying to make an API that encrypts strings in ComputerCraft. However, i'm not sure how I would make have the encryption function return the encrypted text. How would I have a function return something?

Upvotes: 0

Views: 222

Answers (1)

user9214016
user9214016

Reputation:

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

Upvotes: 0

Related Questions