This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
H4X0RZ's profile picture

YATAPI (Yet Another Turtle Application Programing Interface) [UNFINISHED] [UNRELEASED]

Started by H4X0RZ, 04 June 2013 - 10:41 AM
H4X0RZ #1
Posted 04 June 2013 - 12:41 PM
Hello com,
I've started programing a little API that modificates the inbuild turtle commands.
This modification makes the using smpler/usefuller!

Commands I have finished:
Spoiler
  • turtle.select()
  • turtle.forward()
  • turtle.detect()

Usage:
Spoiler

turtle.select(slotNum) 
--Selects the give slot and saves it in a variable

YATAPI.getSelect()
--return the selected slot

turtle.forward(length)
--goes <length> blocks forward.
--If it detects a block in the front, the turtle goes above it

turtle.detect(isPowered)
--returns true if a block is detected
--If isPowered is true, it returns 1. True if a block is detected. 2. True if the block is powered by redstone

Example:
Spoiler

os.loadAPI("YATAPI")
turtle.forward(10)

instead of

for i = 1,10 do
turtle.forward()
end

yea, It saves one line, and if you use it more times it's realy usefull!
thx for reading
-Freack100-
nutcase84 #2
Posted 04 June 2013 - 01:09 PM
This isn't really a mod, it's a API.
H4X0RZ #3
Posted 04 June 2013 - 01:30 PM
Mod = Modification
billysback #4
Posted 04 June 2013 - 01:57 PM
exactly… you're not modifying the main code your adding something that simplifies programs made with computercraft… an API.
but that's irrelevant, I don't quite see the purpose of this.
H4X0RZ #5
Posted 04 June 2013 - 02:11 PM
exactly… you're not modifying the main code your adding something that simplifies programs made with computercraft… an API.
but that's irrelevant, I don't quite see the purpose of this.
No, i'm editing the main code.
You don't use it so:
YATM.forward(length)

You use it so:
turtle.forward(length)

So, I'm editing the main…
nutcase84 #6
Posted 04 June 2013 - 03:58 PM
exactly… you're not modifying the main code your adding something that simplifies programs made with computercraft… an API.
but that's irrelevant, I don't quite see the purpose of this.
No, i'm editing the main code.
You don't use it so:
YATM.forward(length)

You use it so:
turtle.forward(length)

So, I'm editing the main…

So, your making a "mod" that goes into the rom folder. Lovely.
H4X0RZ #7
Posted 04 June 2013 - 04:13 PM
Why the rom folder?

You load it normal as an API and use the normal commands then(with my extensions).
TomyLobo #8
Posted 04 June 2013 - 04:21 PM
the rom folder, because that's where apis are loaded from.
you don't have the slightest hint of a clue of what you're doing, right?

saying that your thing is a mod is like saying HTML is a programming language.
Kingdaro #9
Posted 04 June 2013 - 04:22 PM
I've started programing a little API
You sure you still wanna call it a mod?

Terminology aside, the usefulness of this is questionable as a lot of turtle programs require specific behavior that shouldn't be implemented as an API.
H4X0RZ #10
Posted 04 June 2013 - 05:07 PM
I've started programing a little API
You sure you still wanna call it a mod?

Terminology aside, the usefulness of this is questionable as a lot of turtle programs require specific behavior that shouldn't be implemented as an API.
My API modificates the inbuild turtle API
TomyLobo #11
Posted 04 June 2013 - 06:06 PM
no it doesn't
that API is implemented in java. modifying it and distributing the modified class files is a breach of copyright
MudkipTheEpic #12
Posted 05 June 2013 - 12:23 AM
Does anyone get what he is saying????

He has a script that overrides the turtle functions (MODifying them)!

He is not redistributing anything from CC.
Not all APIs have to go in the rom/apis folder, you can os.loadAPI them.

Although I do agree that this is not enough of a overhaul to be a full class "modification"/mod.
TomyLobo #13
Posted 05 June 2013 - 07:14 AM
"A is overriding B" is the contradictory to "A is a modified B".
This isn't a mod. A mod of ComputerCraft would be, as I stated before, a breach of copyright. do you want to be a bad copyright breacher?
theoriginalbit #14
Posted 05 June 2013 - 07:41 AM
that API is implemented in java. modifying it and distributing the modified class files is a breach of copyright
Well actually the turtle API isn't implemented in Java, the turtle.native is. The currently existing API (turtle) just wraps those functions (turtle.native) in an event checker, waiting for the 'turtle_repsponse' event before allowing your code to continue (which is why any turtle call will clear the event queue, and also stop the `too long without yielding` error). So modifying the turtle API does not require changing any class files, thus not breaching any copyright.
Stop trying to get all technical with the words that this, clearly not native English speaker, is saying, for all you know it could have been Google Translate that picked that word.


the rom folder, because that's where apis are loaded from.
you don't have the slightest hint of a clue of what you're doing, right?
Be nice, because APIs can be loaded from anywhere, not just the `rom` folder.
Edited on 05 June 2013 - 05:41 AM
TomyLobo #15
Posted 05 June 2013 - 07:53 AM
google translate surely doesn't pick "modificates" unless someone has been a troll with the corrections
H4X0RZ #16
Posted 05 June 2013 - 08:02 AM
Ok, you don't have to talk about this missmatch!

I will edit it in a few moments…