Jump to content




[mc 1.6.x] Openperipheral


  • This topic is locked This topic is locked
1184 replies to this topic

#501 Mikeemoo

  • Members
  • 732 posts
  • LocationLondon, UK

Posted 11 July 2013 - 01:06 PM

Ah right, no. not possible. I'll try add something to 0.2.2 which makes this kinda thing possible.

#502 unobtanium

  • Members
  • 505 posts

Posted 11 July 2013 - 01:38 PM

Allright. I will wait with that freature tho.

#503 unobtanium

  • Members
  • 505 posts

Posted 11 July 2013 - 05:35 PM

I have got some colors together, which are looking fine to me. Saved them into a variable
local colorHex = {"#FFFFFF","#FF8800","#FF8CFF","#00FFFF","#FFF700","#00FF11","#F7B5DE","#BFBFBF","#65A1D6","#AF56B3","#0000FF","#754302","#004000","#FF0000","#000000"}
I made brackets around them, because lua was complaining about "For input string: ...", but it still messes up, when it tries to draw e.g. a box with a color out of the array. Does someone has a idea for that? (Sorry if this doesnt go here :S)
edit: Btw, the program just exits with no error or whatever. It is really weird..

#504 Thief^

  • Members
  • 29 posts

Posted 11 July 2013 - 05:52 PM

Put 0xFF0000 instead of #FF0000 (and no quotes)

#505 unobtanium

  • Members
  • 505 posts

Posted 12 July 2013 - 05:41 AM

Thanks! I really have no clue about the color codes :S
edit: For everybody who wants them:
local colorHex = {0xFFFFFF,0xFF8800,0xFF8CFF,0x00FFFF,0xFFF700,0x00FF11,0xF7B5DE,0xBFBFBF,0x65A1D6,0xAF56B3,0x0000FF,0x754302,0x004000,0xFF0000,0x000000}


#506 unobtanium

  • Members
  • 505 posts

Posted 12 July 2013 - 01:20 PM

Firstoff: I cant create a gradient box with .addGradientBox(...) :(

One more i am curious about:
I created multiple boxes over each other. One as background and the other one as a "progress bar". I add the background box first in the code and then add the progress bar. Sometimes one is in the background then the other one. Do i have to use setZIndex() to indicate which is in front of each other? Sometimes i wish the commands would be discribed better :S (at least for those, who dont have english as their native language ;D)

#507 Mikeemoo

  • Members
  • 732 posts
  • LocationLondon, UK

Posted 12 July 2013 - 01:43 PM

View PostUNOBTANIUM, on 12 July 2013 - 01:20 PM, said:

Firstoff: I cant create a gradient box with .addGradientBox(...) :(

You'll have to give more information, I'm afraid. What parameters are you using? and whats the error?

Quote

I created multiple boxes over each other. One as background and the other one as a "progress bar". I add the background box first in the code and then add the progress bar. Sometimes one is in the background then the other one. Do i have to use setZIndex() to indicate which is in front of each other? Sometimes i wish the commands would be discribed better :S (at least for those, who dont have english as their native language ;D)

Yes, setZIndex(). ZIndex is a very common thing used in a variety of languages/systems, so a very (very) quick google would've given you more information.

https://www.google.c...iw=1366&bih=643

#508 unobtanium

  • Members
  • 505 posts

Posted 12 July 2013 - 01:51 PM

For a normal box i am using this:
  local box = b.addBox(x+2,y+2,math.ceil((number/maxNumber)*(w-4)),h-4,cOne,tOne)
For a gradient box i used this, but it didnt worked, the program crashed.
  local box = b.addGradientBox(x+2,y+2,math.ceil((number/maxNumber)*(w-4)),h-4,cOne,tOne,cTwo,tTwo,2)
I made it by creating a normal box and adding the attributes with box.setColor2(cTwo) ect.

How does the ZIndex work? Does it change if i am creating a new object? Or do i have to set a variable which counts up everytime i create one?
-- would that be enough? How do i set the ZIndex directly?
local z = 1
for i=1,10 do
local text = bridge.addText(1,1,"TEXT",0xFFFFFF)
text.setZIndex(z)
z = z + 1
end


I am annoying you, right? :S

#509 Mikeemoo

  • Members
  • 732 posts
  • LocationLondon, UK

Posted 12 July 2013 - 02:43 PM

https://dl.dropboxus....1-preview2.jar

preview for MC 1.6.2

Would be good to get some feedback and bug reports..etc.

The only thing I know is missing is fuel() related stuff and the gauge from openccsensors

Would love some beta testers! NEI the recipes because they're not documented. And p.listMethods() is now p.listMethods(true) for the time being (but i'll fix that)

#510 giodamelio

  • Members
  • 3 posts

Posted 12 July 2013 - 04:44 PM

View PostMikeemoo, on 12 July 2013 - 02:43 PM, said:

https://dl.dropboxus....1-preview2.jar

preview for MC 1.6.2

Would be good to get some feedback and bug reports..etc.

The only thing I know is missing is fuel() related stuff and the gauge from openccsensors

Would love some beta testers! NEI the recipes because they're not documented. And p.listMethods() is now p.listMethods(true) for the time being (but i'll fix that)

Awesome, Ill play around with it right now.

You have a 1.6.2 build of NEI? I can't find one anywhere. Could I get a link?

#511 Russoul

  • Members
  • 14 posts

Posted 13 July 2013 - 06:49 AM

I have a great idea for your mod . CC has itself key event . You can try to add it to your glasses . So the event will be fired by a terminal bridge and all information about the player and a the key that was pressed will be send to the computer that is connected to term bridge . With this we could control anything in real time by pressing any keys on our keyboards ! Awesome idea !


It would be someting like a digging machine from powercraft but much more better ...

#512 unobtanium

  • Members
  • 505 posts

Posted 13 July 2013 - 09:26 AM

I created a program and i let it run for a while and get the error: "peripheral :62: Too long without yielding"
Any way to prevent this? :S

#513 unobtanium

  • Members
  • 505 posts

Posted 13 July 2013 - 12:40 PM

View PostRussoul, on 13 July 2013 - 06:49 AM, said:

I have a great idea for your mod . CC has itself key event . You can try to add it to your glasses . So the event will be fired by a terminal bridge and all information about the player and a the key that was pressed will be send to the computer that is connected to term bridge . With this we could control anything in real time by pressing any keys on our keyboards ! Awesome idea !
It would be someting like a digging machine from powercraft but much more better ...

A simple key press might interfere, when you are writing into the chat.
Nevertheless, you can use commands over the chat to do that/something.

#514 Twitch0889

  • Members
  • 6 posts

Posted 13 July 2013 - 01:26 PM

View PostUNOBTANIUM, on 13 July 2013 - 09:26 AM, said:

I created a program and i let it run for a while and get the error: "peripheral :62: Too long without yielding"
Any way to prevent this? :S

Usually that error comes from an endless loop that doesn't have some sort of pause in it. Ex. If you have a while loop that constantly updates a value, there needs to be some sort of sleep or yield inside of it (even if it's tiny).

#515 Bubba

    Use Code Tags!

  • Moderators
  • 1,142 posts
  • LocationRHIT

Posted 13 July 2013 - 01:39 PM

View PostTwitch0889, on 13 July 2013 - 01:26 PM, said:

View PostUNOBTANIUM, on 13 July 2013 - 09:26 AM, said:

I created a program and i let it run for a while and get the error: "peripheral :62: Too long without yielding"
Any way to prevent this? :S

Usually that error comes from an endless loop that doesn't have some sort of pause in it. Ex. If you have a while loop that constantly updates a value, there needs to be some sort of sleep or yield inside of it (even if it's tiny).

Indeed. The fastest way to handle this would be to throw an event and use coroutine.yield() directly after it in order to catch the event and continue.

#516 Bubba

    Use Code Tags!

  • Moderators
  • 1,142 posts
  • LocationRHIT

Posted 13 July 2013 - 02:39 PM

Hey Mikee, when you try to place or shift-click an OpenMech Warriror into the robot block, you get this error:

Pastebin

Spoiler


#517 Mikeemoo

  • Members
  • 732 posts
  • LocationLondon, UK

Posted 13 July 2013 - 02:48 PM

View PostBubba, on 13 July 2013 - 02:39 PM, said:

Hey Mikee, when you try to place or shift-click an OpenMech Warriror into the robot block, you get this error:

Pastebin

Spoiler

Oh! that's... odd!

Thanks a lot for the bug report :) :)

#518 Mikeemoo

  • Members
  • 732 posts
  • LocationLondon, UK

Posted 13 July 2013 - 02:52 PM

https://dl.dropboxus....1-preview3.jar

Hopefully fixes that issue :)

#519 Bubba

    Use Code Tags!

  • Moderators
  • 1,142 posts
  • LocationRHIT

Posted 13 July 2013 - 08:02 PM

View PostMikeemoo, on 13 July 2013 - 02:52 PM, said:

https://dl.dropboxus....1-preview3.jar

Hopefully fixes that issue :)/>

Indeed, it seems to have done so :) They are quite a bit of fun to play with, I must say. Unfortunately though I still don't know the recipes due to NEI not having been released yet. Are there any implemented yet?

#520 Yurij

  • Members
  • 18 posts

Posted 14 July 2013 - 06:36 PM

I wrote a simple program to figure out what sort of info about mobs you could get out of the sensor
http://pastebin.com/qnty0gUm

The problem is that it silently quits at the "local mobData = sensor.getMobData(id)" line
if I am riding a horse within the sensors range.
Horses not ridden within range works.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users