TASEmulators / TASEmulators/BizHawk

Lua Functions: On Copy of a Row Remove C Style Comment / Maybe Change Parameter Name in Ex

Open
#2,516 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Meta Repro: Affects 2.5.2 Tool: Lua Console
Dominant language
C#
Stars
2.8k
Forks
468
PR merge metrics
No merged PRs in 30d

Description

In the Lua Functions grid if you right-click and copy the row to get a quick example it is copied in a format that is not completely compatible with Lua. "//" should be replaced with "--" otherwise a user gets NLua.Exceptions.LuaScriptException: [string "main"]:51: unexpected symbol near '/'.

A couple other things I have to question. The "Frame name" is the event name if you want to use that function name to remove, but the name should most likely be "Event Name" in these examples. local "steveonm" seems an odd variable name as well to me for something would contain a GUID for an event in case you wanted to identify it later such as for removal later with the event unregisterbyid.

image

//event.onmemoryexecute(nluafunc luaf, uint  address, [string name = null], [string scope = null])
local steveonm = event.onmemoryexecute(
	function()
		console.log( "Fires after the given address is executed by the core" );
	end
	, 0x200, "Frame name", "System Bus" );

--another example of a copy below

//event.onsavestate(nluafunc luaf, [string name = null])
local steveons = event.onsavestate(
	function()
		console.log( "Fires after a state is saved" );
	end
	, "Frame name" );

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Lua Functions grid and reproduce the issue by right-clicking a row and copying its example. Verify that the copied examples use Lua-compatible comments and that the displayed parameter labels and local variable names accurately describe their purpose.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, lua
Domain
desktop, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.