Skip to content

Hello World!

redstone edited this page Dec 31, 2023 · 5 revisions

Let's write a simple "Hello, World!" program to start with ScriptedHand.

Here's how to set this up:

  1. Navigate to ScriptedHand's mod directory
  2. Create a new folder called "Lua"

Note: the folder MUST be called Lua exactly, not lua, LUA, LUa, etc.

  1. Inside that folder, create a new file called helloworld.lua
  2. Open that file in a text editor of your choice (Notepad for example)

Now, in your text editor, add this:

function main()
    print("Hello, World!")
end

Save this file, and then run Stardew with your mods.

Finally, type this into the SMAPI console:

run_script helloworld.lua

You should see [ScriptedHand] Hello, World! appear in the console.

Clone this wiki locally