From 74955e10bcdf5d3397382d8327eb5fa2b53101b2 Mon Sep 17 00:00:00 2001 From: Robert Jelic <36573031+NoryiE@users.noreply.github.com> Date: Mon, 25 Apr 2022 23:19:36 +0200 Subject: [PATCH] Updated Program (markdown) --- Program.md | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Program.md b/Program.md index 687072b..9a721ff 100644 --- a/Program.md +++ b/Program.md @@ -1,12 +1,9 @@ This is one of my favorite part
-With that object you are able to open programs like shell or worm or any custom program you've made. There is only 1 thing you have to make -sure: the program needs at least one os.sleep() or coroutine.yield() somewhere +With the program object you are able to open programs like shell or worm or any custom program you've made. There is only 1 thing you have to do: the program needs at least one os.sleep() or coroutine.yield() somewhere.

-One important note: this is currently in developement, if something doesn't work correctly feel free to tell me thx
-Here is a example of how to create a default program: ````lua -local mainFrame = NyoUI.createFrame("myFirstFrame"):show() +local mainFrame = basalt.createFrame("myFirstFrame"):show() local aProgram = mainFrame:addProgram("myFirstProgram"):show() ```` @@ -17,7 +14,7 @@ Here are all possible functions available for programs. Remember program inherit ## getStatus Sets the displayed button text ````lua -local mainFrame = NyoUI.createFrame("myFirstFrame"):show() +local mainFrame = basalt.createFrame("myFirstFrame"):show() local aProgram = mainFrame:addProgram("myFirstProgram"):show() NyoUI.debug(aProgram:getStatus()) -- returns "running", "normal", "suspended" or "dead" ```` @@ -27,7 +24,7 @@ NyoUI.debug(aProgram:getStatus()) -- returns "running", "normal", "suspended" or ## execute executes the given path (-program) ````lua -local mainFrame = NyoUI.createFrame("myFirstFrame"):show() +local mainFrame = basalt.createFrame("myFirstFrame"):show() local aProgram = mainFrame:addProgram("myFirstProgram"):show() aProgram:execute("rom/programs/fun/worm.lua") -- executes worm, have fuuuuuuuuuuuuuuun - only hard difficulty ok? ```` @@ -37,7 +34,7 @@ aProgram:execute("rom/programs/fun/worm.lua") -- executes worm, have fuuuuuuuuuu ## stop gives a terminate event to the program, which means if you are running a shell, and the shell executes a program by itself you have to call stop 2 times to entirely close the running program ````lua -local mainFrame = NyoUI.createFrame("myFirstFrame"):show() +local mainFrame = basalt.createFrame("myFirstFrame"):show() local aProgram = mainFrame:addProgram("myFirstProgram"):execute("rom/programs/shell.lua"):show() mainFrame:addButton("myFirstButton"):setText("close"):onClick(function() aProgram:stop() end):show()