Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Just a tiny little bit I wanted to share :) #2

Open
jojomoore2007 opened this issue Mar 16, 2019 · 3 comments
Open

Just a tiny little bit I wanted to share :) #2

jojomoore2007 opened this issue Mar 16, 2019 · 3 comments

Comments

@jojomoore2007
Copy link
Contributor

jojomoore2007 commented Mar 16, 2019

I actually recently started making a ComputerCraft API to make clickable buttons with functions tied to them, i.e. a new way to make buttons.

The only problem is to make it work requires you to wrap all your code into a main() function, then load the API at the very start of the code and run main() and btn.begin() parallel to each other using parallel.waitForAny(main, btn.begin) at the very end so the API can automatically run a function as soon as a button is clicked, without the need for any extra calls to btn.pullEvent() (Passthrough of os.pullEvent() but runs functions if it gets a "mouse_click" event with the X and Y positions being in the button's range) calls. If you choose to not include that at the end, you have to implement some way to call btn.pullEvent() or btn.pullEventRaw() (An exact copy of btn.pullEvent() but with os.pullEventRaw() instead of os.pullEvent()) every so often, or the functions will not be called.

That was a very long explanation.

TL;DR: I made a cool button API for CC that only works if you wrap your code in a function and run it parallel to btn.begin().

@nothjarnan
Copy link
Owner

That's pretty cool. I'm pretty active in the CC community as well, mainly on servers though.

@jojomoore2007
Copy link
Contributor Author

jojomoore2007 commented Jun 20, 2019

That's pretty cool. I'm pretty active in the CC community as well, mainly on servers though.

Yeah, I make lots of APIs and programs for CC.
I'm currently making a package manager kinda like NPM for CC (CCPM).
I have noticed they seem to be using RECAPTCHA V1 (Although someone got in somehow...) and I can't make an account... 😞

I was actually planning on making a GitHub pages site for CC where you could make posts, but I think I'm just gonna make a CC blog where I'll post the APIs and programs I make.

Welp, see ya around, I'm gonna go make a game engine for CC!

P.S.: I made a pull req. on your LOVE2D button API. I added the feature you mentioned in the README for you.

@nothjarnan
Copy link
Owner

Thank you, mad props for adding that feature. There is a new forum for computercraft found here: https://forums.computercraft.cc/

@nothjarnan nothjarnan pinned this issue Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants