Jump to content




[CC 1.5] [MC 1.4.6/1.4.7] [SMP] Xfel's peripherals - New cable appearance!

peripheral api

524 replies to this topic

#321 Xfel

    Peripheral Designer

  • Members
  • 515 posts

Posted 06 August 2012 - 07:58 AM

oh no, seems I have to fix that again. but as this is part of vanilla, I might do it statically.

#322 Marval

  • Members
  • 47 posts

Posted 06 August 2012 - 08:42 AM

Thanks a lot, can You post when you fix this?

Can you please write any help how move items from one digital chest to another?
I tried:

inv1 = inventory.get("left")
inv2 = inventory.get("right")
inventory.move(inv1,1,inv2,1)

where is computer on the center and digital chests on left and right side, that give me "Can't modify inventories from different peripherals"

#323 Corbald

  • Members
  • 19 posts

Posted 07 August 2012 - 01:28 AM

I updated to 1.8.1 and I'm getting something kinda strange here. No errors, seems to load fine. All the blocks can be placed and broken and have proper textures. Cables can be colored and attach as expected.

Strange thing is, since I updated to the new version, a program I was using before stopped working, giving me an error about a bad side. I replaced -everything- (computer, cables, DB, etc...) and tried again. No luck. I tried in console LUA mode a 'test = peripheral.wrap("back:red")' which ALSO threw the same 'bad side' error.

So I checked my install. I had deleted the previous folder and installed the zip into the /mods/ folder. I saw the /mods/arp/ folder had replaced it's self, as had the /mods/computercraft/ folder that I removed when I updated to CC1.4. I checked in the CC folder, and there's the apis/programs/help and other folders/files I would expect from ARP. I checked in the /mods/arp/ folder and there's /mods/arp/help and /mods/arp/lua... however, both of those contain -folders- like /mods/arp/help/database.txt/ or /mods/arp/lua/dumpinv.lua/. Please note that these are folders -not- files and that they are empty.

I'm running Ubuntu Linux with Gnome Shell (Gnome 3) in case that matters. Forge is 3.3.8.

#324 Xfel

    Peripheral Designer

  • Members
  • 515 posts

Posted 07 August 2012 - 06:34 AM

Seems that I forgot to change some mount points...

#325 Xfel

    Peripheral Designer

  • Members
  • 515 posts

Posted 07 August 2012 - 07:33 AM

Ok now it should work. I also updated the bukkit port.

#326 Corbald

  • Members
  • 19 posts

Posted 07 August 2012 - 07:45 AM

Thanks! Was trying to debug on my end in the meantime. Checked everything from user permissions (I use 'gksu nautilus' to manipulate files for my server's user) to bad logical links that I might have been creating by mistake. Glad you found the issue though ;P

Well, everything seems to work except the cables. "back:red" still give an invalid side, even though it's visibly connecting properly. They're loading up, obviously, as the physical cable blocks are there. Wasn't there some override in place for the old version that extended another stock api? Is there a new method for cable-to-color?

#327 Xfel

    Peripheral Designer

  • Members
  • 515 posts

Posted 07 August 2012 - 09:50 AM

You should have a file "peripheral" in your /rom/apis folder. if it's not there, than I don't know

#328 toxicwolf

  • Members
  • 201 posts
  • LocationUnited Kingdom

Posted 07 August 2012 - 01:11 PM

I have a problem where my computers are not registering an attached database. When I try to use a function from the db api, such as db.getItem(), it throws an error saying:
db:22: No database attached!

View PostXfel, on 07 August 2012 - 09:50 AM, said:

You should have a file "peripheral" in your /rom/apis folder. if it's not there, than I don't know
I don't have the peripheral file in the apis folder either, perhaps that is the problem?

EDIT: I just took a look into the db api and I know the problem. Calling peripheral.getType() on a side containing a database returns the name "database", whereas the db api is looking for the name "resource_database".

Edited by toxicwolf, 07 August 2012 - 02:48 PM.


#329 Xfel

    Peripheral Designer

  • Members
  • 515 posts

Posted 07 August 2012 - 03:58 PM

Yes, I restructured some things. Seems I forgot to change that.

#330 toxicwolf

  • Members
  • 201 posts
  • LocationUnited Kingdom

Posted 07 August 2012 - 04:43 PM

Also, how can you make the digital chest move items between adjacent inventories? I would like to move items from and to an inventory next to it, a Buffer from Immibis's mods to be exact. Or have I misread the OP?

#331 Corbald

  • Members
  • 19 posts

Posted 07 August 2012 - 08:51 PM

1.8.2 is still failing to create/load the peripheral api. Everything else seems to work fine. Connecting the peripherals directly to the sides of the computer functions properly, however, cables are still not able to route and throw 'Bad Side.'

#332 Xfel

    Peripheral Designer

  • Members
  • 515 posts

Posted 07 August 2012 - 08:58 PM

I'm currently quite busy, but I'll look into it.

#333 Corbald

  • Members
  • 19 posts

Posted 07 August 2012 - 09:08 PM

Np. Nothing pressing, just acting as an unofficial tester for you. I'm OK with the prev. version we're running on our server. (though, the Digital Chest looks sweet!)

Actually, I did think of a suggestion that's in line with your current items. A Digital Counter: It buffers a small amount of items from a BC pipe and when queried, returns type/count in table form, then passes the items to the other side's pipe. I would suggest making the count and flush as one method, to prevent uncounted items from entering between the count/flush.

dCounter = peripheral.wrap("back:red")
dType, dCount = dCounter.getWhatever()
-- db renaming from ID to type String
-- iterator start
print("You have collected "..dCount[iter].." of "..dTypeNamed[iter].." so far!n")
-- iter end

This would be great for counting the results from Quarries and similar items.

Additional methods:
dc.accepts(true) -- Can the DC accept more items?
dc.passThrough(false) -- Does the DC buffer the items for counting, or simply act as an additional pipe? (count calls would return nil)
dc.flush() -- flush w/o counting
dc.redstoneMode("none") -- Modes are: "none" - emits no redstone. "full" - emits redstone from the block when full. "empty" - and when empty. "any" - and when ANY item is in the buffer. "through" - and when any item is 'flushed' or moves through the DC when in passThrough mode. (these could also throw an event?)
and so on.


#334 Xfel

    Peripheral Designer

  • Members
  • 515 posts

Posted 08 August 2012 - 06:04 AM

The allocator can do most of it, and some of the other proposed things could be added to it. for counting it is ok already, it is using events.

#335 Corbald

  • Members
  • 19 posts

Posted 08 August 2012 - 07:02 AM

Ah, ok, cool. I wasn't doing anything advanced there, so I didn't really dig into it much.

#336 sylphio

  • Members
  • 20 posts

Posted 09 August 2012 - 02:10 AM

Hello Xfel,

i dont know if it is the correct place for incompability report but i was getting the following error after adding a storage cart under a railcraft loader.
The bug really look ARP related because it was 100% repro on my server until i removed the ARP plugin (The bug appeared just after the installation of ARP). Maybe related to some inventory hook.

Thank
Syl.

MCCP 177
Computercraft 1.41 bukkit
ARP 1.82 bukkit
Railcraft 5.3.3 bukkit

2012-08-08 20:49:58 [SEVERE] java.lang.NoSuchMethodError: railcraft.common.api.InventoryTools.getAdjacentInventoryMap(Lnet/minecraft/server/World;III)Ljava/util/Map;
2012-08-08 20:49:58 [SEVERE] at railcraft.common.utility.TileItemLoader.q_(TileItemLoader.java:138)
2012-08-08 20:49:58 [SEVERE] at net.minecraft.server.World.tickEntities(World.java:1189)
2012-08-08 20:49:58 [SEVERE] at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:559)
2012-08-08 20:49:58 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:457)
2012-08-08 20:49:58 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:492)
2012-08-08 20:49:58 [SEVERE] Unexpected exception
java.lang.NoSuchMethodError: railcraft.common.api.InventoryTools.getAdjacentInventoryMap(Lnet/minecraft/server/World;III)Ljava/util/Map;
at railcraft.common.utility.TileItemLoader.q_(TileItemLoader.java:138)
at net.minecraft.server.World.tickEntities(World.java:1189)
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:559)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:457)
at net.minecraft.server.ThreadServerApplication.run(SourceFile:492)

#337 Xfel

    Peripheral Designer

  • Members
  • 515 posts

Posted 09 August 2012 - 06:21 AM

Ah, seems that my version of the railcraft api is a bit deprecated. If you send me the latest railcraft bukkit file, I could patch it.

Meanwhile, just delete the railcraft folder in the arp.zip.

#338 Xfel

    Peripheral Designer

  • Members
  • 515 posts

Posted 10 August 2012 - 06:13 PM

btw I fixed the problem with the peripheral api. Was a copy-paste error.

#339 Marval

  • Members
  • 47 posts

Posted 10 August 2012 - 06:33 PM

Did You maybe fix the problem with the entries.special thing?

#340 Corbald

  • Members
  • 19 posts

Posted 10 August 2012 - 09:26 PM

1.8.3 is still not loading the peripheral api. Is it supposed to go somewhere into /mods/ComputerCraft? Regardless, it's not available on old or new computers within the game. Again, everything else loads properly, or at least seems to. If you can tell me which file within the archive is supposed to be coppied, I can do it manually, for the time being.

EDIT: After looking through the archive, I noticed that the only 'modified on' date that isn't Aug 7th, belongs to the licence.txt file. Did the 1.8.3 get copied to your dropbox? Perhaps it might be possible to include version numbers in the archive name?

EDIT: Found /lua/peripheralAPI.lua and arpturtleAPI.lua. I don't see a /mods/ComputerCraft/lua/rom/apis/* for those? I see one for allocator, db, inventory, workbench.

EDIT: Copied those files into the relevant CC folder and renamed them, now it works.

(instructions to get this working with the current version: Open the .zip file -> navigate to the /lua folder within the zip. -> extract peripheralAPI.lua and arpturtleAPI.lua into /mods/ComputerCraft/lua/rom/apis and rename them, removing the trailing API.lua from the file name.)

Anyway, it's working again, as you can see here:

Posted Image





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users