21 posts
Location
C:\Windows\System32\
Posted 05 October 2015 - 01:36 PM
Thanks :D/> the program is awesome!
Im new to computercraft and i would like if someone tells me what is the:
function RCmaster()
and
RCmaster()
(at end) for, also about:
local sEvent, param = os.pullEvent("key")
.
Thanks! :)/>
8543 posts
Posted 05 October 2015 - 03:33 PM
I've split this from
here, to prevent unnecessary necromancy.
1852 posts
Location
Sweden
Posted 05 October 2015 - 03:56 PM
This line of code declares a new function called "RCMaster"
function RCMaster()
And this one calls the function "RCMaster"
RCMaster()
An example
--# Here we declare the function foo
--# when the function is called it will
--# run all the code the function contains
local function foo()
print( "bar" )
end
foo() --# Call the function "foo", it should output "bar"( without the quotes ofcourse )
And the final line
local sEvent, param = os.pullEvent( "key" )
This line calls the function os.pullEvent, with the parameter "key", which will make it only listen for key events.
When a key event has been pulled it returns the following variables: event, key.
I'd recommend you check out the wiki about os.pullEvent
here