Have a nice afternoon (well, that depends on where you both live);
Anyways, bye
Alex.
There have been 63 items by Cross_Sans (Search limited from 10-February 22)
Posted by
Cross_Sans
on 03 January 2018 - 12:56 PM
in
Ask a Pro
Posted by
Cross_Sans
on 03 January 2018 - 11:41 AM
in
Ask a Pro
... = arguments; -- This is not possible, but then how CraftOS did set this ?
local env = { ... };
setmetatable(env, { __index = getfenv() });
local initFn, err = assert(loadfile(path, env));
-- check and run
Posted by
Cross_Sans
on 21 December 2017 - 04:27 PM
in
Programs
Posted by
Cross_Sans
on 20 December 2017 - 05:11 PM
in
Programs

for i = 1, 14 do
term.setBackgroundColor(colors.black);
write(" ");
term.setPaletteColor(2 ^ i, colors.rgb8(i * 6 / 100, i * 6 / 100, i * 6 / 100));
term.setBackgroundColor(2 ^ i);
for i = 1, 14 do
term.setTextColor(2 ^ i);
write(string.char(127));
end
print();
end
Posted by
Cross_Sans
on 13 May 2017 - 06:53 PM
in
Operating Systems
Posted by
Cross_Sans
on 13 May 2017 - 10:26 AM
in
Ask a Pro
Posted by
Cross_Sans
on 12 May 2017 - 06:45 PM
in
Ask a Pro
SquidDev, on 12 May 2017 - 06:14 PM, said:
function Nature.Thread.Switch()
if ThreadMode then
error("Nature.Thread.Switch: Cannot switch because Thread Mode is already activated");
end
Nature.Logger.LogLine("THRD", "Switching to ThreadMode...");
ThreadMode = true;
while #Nature.Thread.List > 0 do
local Event = Nature.Thread.GetEvent() or {};
for Index, ThreadItem in ipairs(Nature.Thread.List) do
if Nature.Thread.List[Index] ~= nil then
repeat
local CanResume, Parameter = coroutine.resume(ThreadItem.Thread, unpack(Event));
write("Thread #" .. Index .. " is running... ");
write(tostring(coroutine.status(ThreadItem.Thread)));
print(" - " .. tostring(Parameter));
if CanResume == false then
Nature.Logger.LogLine("THRD", "Error while running thread ID " .. Index .. ": " .. Parameter);
table.remove(Nature.Thread.List, Index);
break;
elseif coroutine.status(Nature.Thread.List[Index].Thread) == "dead" then
table.remove(Nature.Thread.List, Index);
break;
end
until true
end
end
end
end
Posted by
Cross_Sans
on 12 May 2017 - 06:07 PM
in
Ask a Pro
SquidDev, on 12 May 2017 - 05:54 PM, said:
--# Note the arguments are flipped and the -1. This says "start at the length and continue to 1". for Index = #Nature.Thread.List, 1, -1 do --# Whatever you had before. if CanResume == false then --# Removing is actually the same here too. table.remove(Nature.Thread.List, Index) end end
SquidDev, on 12 May 2017 - 05:54 PM, said:
Posted by
Cross_Sans
on 12 May 2017 - 05:02 PM
in
Ask a Pro

Posted by
Cross_Sans
on 12 May 2017 - 04:07 PM
in
Ask a Pro
Posted by
Cross_Sans
on 11 May 2017 - 06:25 PM
in
Ask a Pro
SquidDev, on 11 May 2017 - 06:18 PM, said:
Posted by
Cross_Sans
on 11 May 2017 - 06:14 PM
in
Ask a Pro
Posted by
Cross_Sans
on 11 May 2017 - 03:59 PM
in
Ask a Pro
Posted by
Cross_Sans
on 09 May 2017 - 04:09 PM
in
Operating Systems
Posted by
Cross_Sans
on 08 May 2017 - 06:32 PM
in
Ask a Pro
Posted by
Cross_Sans
on 08 May 2017 - 01:00 PM
in
Ask a Pro
Posted by
Cross_Sans
on 08 May 2017 - 12:36 PM
in
Operating Systems
Posted by
Cross_Sans
on 07 May 2017 - 03:00 PM
in
Operating Systems
Posted by
Cross_Sans
on 07 May 2017 - 02:58 PM
in
Operating Systems
Posted by
Cross_Sans
on 09 March 2017 - 05:37 PM
in
APIs and Utilities
Posted by
Cross_Sans
on 09 March 2017 - 05:31 PM
in
Operating Systems
function os.pullEvent(event, ...) local event = os.pullEventRaw(event); if event ~= "terminate" then return event, ...; end end
Posted by
Cross_Sans
on 09 March 2017 - 05:23 PM
in
Media
Posted by
Cross_Sans
on 09 March 2017 - 11:04 AM
in
Operating Systems
Posted by
Cross_Sans
on 04 February 2017 - 11:16 AM
in
Operating Systems
Exerro, on 04 February 2017 - 11:08 AM, said:
Redall, on 04 February 2017 - 10:30 AM, said:
Redall, on 04 February 2017 - 10:30 AM, said:
Posted by
Cross_Sans
on 04 February 2017 - 10:30 AM
in
Operating Systems
Exerro, on 04 February 2017 - 10:20 AM, said:
return not s:find "[^\t ]" or #s == 0That being said, your current function will also return true if only the start is whitespace (probably unintentional?), which'd be this:
return s:find "^[\t ]" or #s == 0
