Comments (5)
I haven't played around with Lua in resource packs, so I have no idea, but what you say sounds logical to me. A simpler adjustment might be
assert(os.loadAPI("apis/startup") or os.loadAPI("/rom/apis/startup"))
My reasoning for trying the old way first is to still allow overwriting whatever is provided via resource packs.
Could you test this to see if it works?
from ccapis.
Ah - good points, and yes I'll test this and let you know.
Sadly there doesn't seem to be a way to suppress the 'file not found' message to the console from loadAPI.
I was hoping for a "command > /dev/null" equivalent but haven't found one yet.
Using 'protected mode' didn't help either e.g.
local state, value = pcall ( os.loadAPI, "apis/startup")
if ( state ) then ... else ... end
Happy New Year by the way!
On 1 Jan 2014, at 03:56, Florian Nücke [email protected] wrote:
I haven't played around with Lua in resource packs, so I have no idea, but what you say sounds logical to me. A simpler adjustment might be
assert(os.loadAPI("apis/startup") or os.loadAPI("/rom/apis/startup"))
My reasoning for trying the old way first is to still allow overwriting whatever is provided via resource packs.
Could you test this to see if it works?—
Reply to this email directly or view it on GitHub.
from ccapis.
Ah, right, that. I remember I was also annoyed by that just printing to the screen when it (I feel) shouldn't. An fs.exists check may be necessary or something along those lines...
And a happy new year to you, too!
from ccapis.
Hi Florian
I think I’ve fixed the issue, with minimal code changes, once I’ve tested properly I’ll send you a diff to look at?
Or should I fork / commit / send you a pull request in github?
The bios was loading the lama API on a freshly-created turtle, and the check in the main code path through the API for os.computerLabel() was failing the assert(). That led to the blank screen in the CC console as the bios doesn’t seem to like assert failures in os.loadAPI().
I moved all the main code path asserts into the init() code path, after the check for isInitialized, so they only get run once.
I’ve left the original apiPath definition alone, but added a manual search for valid locations if bapil is not available.
Sticking the lama API in /rom/apis/turtle/lama then hides it from computers, and I think it’s good to go.
Thanks for your help and gentle suggestions (which caused me to face palm myself for stupidity!)
Cheers
Mike
On 1 Jan 2014, at 14:36, Florian Nücke [email protected] wrote:
Ah, right, that. I remember I was also annoyed by that just printing to the screen when it (I feel) shouldn't. An fs.exists check may be necessary or something along those lines...
—
Reply to this email directly or view it on GitHub.
from ccapis.
Sounds good! A pull request would be the easiest for me, but you can make it a patch, if you prefer.
from ccapis.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ccapis.