Jump to content




[MC 1.2.5] - [CC 1.33] ccSensors [SMP/SSP]

peripheral java lua

454 replies to this topic

#421 Tiin57

    Java Lunatic

  • Members
  • 1,412 posts
  • LocationIndiana, United States

Posted 11 November 2012 - 11:36 AM

View PostPerkins, on 11 November 2012 - 11:03 AM, said:

Okay, i got it mostly working, and learned a fair bit abotu how MCP works. Only catch is there doesn't seem to be any sensor cards and the lua scripts are also not included for interacting with sensors...
Cloudy has only made frameworks for adding sensors. There are no actual sensors right now.

#422 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 11 November 2012 - 11:50 AM

View PostPerkins, on 11 November 2012 - 11:03 AM, said:

Okay, i got it mostly working, and learned a fair bit abotu how MCP works. Only catch is there doesn't seem to be any sensor cards and the lua scripts are also not included for interacting with sensors...

It is work in progress. I'm not at the stage of any release yet, hence why there isn't even a thread or a build script. There's also no sensor framework yet - I hope to get a sensor this week.

#423 Tiin57

    Java Lunatic

  • Members
  • 1,412 posts
  • LocationIndiana, United States

Posted 11 November 2012 - 12:02 PM

View PostCloudy, on 11 November 2012 - 11:50 AM, said:

View PostPerkins, on 11 November 2012 - 11:03 AM, said:

Okay, i got it mostly working, and learned a fair bit abotu how MCP works. Only catch is there doesn't seem to be any sensor cards and the lua scripts are also not included for interacting with sensors...

It is work in progress. I'm not at the stage of any release yet, hence why there isn't even a thread or a build script. There's also no sensor framework yet - I hope to get a sensor this week.
I stand corrected.

#424 LEOcab

  • Members
  • 13 posts

Posted 14 November 2012 - 06:59 PM

Bro, how the hell does the Lua API work? I'm using your mod with Tekkit. I was very excited to find out that it is able to detect player names, but I can't figure out how to code for it.

function pt(t) -- print table
  for k,v in pairs(t) do print(tostring(k).." = "..tostring(v)) end
end

sensors.setSensorRange("right", "Sensor", "16") -- short range so only I am detected

tTable = sensors.getAvailableTargetsforProbe("right", "Sensor", "LivingEntities")
pt(tTable) -- prints a living entity (me) and my coordinates

ent = tostring(tTable[1]) -- my name & coords are displayed, as expected

tTable = sensors.getSensorReadingAsDict("right", "Sensor", ent, "LivingEntities")
pt(tTable) -- EMPTY! NOTHING DISPLAYED!

It didn't work so I grabbed the ccSensors/console program, copied it to my computer, found the call to getSensorReadingAsDict() and made it display exactly what parameters were being passed to the function and then crash the program. Turns out the official ccSensors program is passing THE EXACT SAME PARAMETERS as my program passes to the same function, yet mine doesn't work. This is bizarre. I dun get. Has someone successfully coded for the ccSensors API? There's barely any information for it out there.

(I want to hook up a player name detector to my secret base so it can execute item evac via ender chests and then self destruct, in case someone ever finds it. LOL.)

#425 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 14 November 2012 - 10:44 PM

I'm close to a release of OpenCCSensors - first sensor will be an inventory sensor.

#426 Perkins

  • New Members
  • 19 posts

Posted 16 November 2012 - 03:06 PM

So if I were to assemble a couple sensors for it, would you have any interest in including them? I'll have a little free time this weekend and it seems like an okay way to learn a little java, and I really want to get a computer controlled reactor up and running :P/>

#427 snaipperi

  • New Members
  • 4 posts

Posted 16 November 2012 - 09:54 PM

View Postitsme, on 05 November 2012 - 05:43 AM, said:

Hello!

I installed the build 017pr2 (client and server) version of ccSensors, but the changed sensor names isn't saved. But the changelog says: "fixed: occasional custom sensor names not kept."

Is there a solution to this faulty behavior?

Thanks
Actually yes it is possible, some French dude made a bukkit plugin that gives a text command + right click which allows you to set the sensor name, I can't find the original web site anymore, but I do have the zip with the source code and the plugin. There's no readme included;

Source code: http://www.eiden.fi/ccSensorsFix.zip
Bukkit plugin: http://www.eiden.fi/ccSensorsFix.jar

To install: place ccSensorsFix.jar into your server's PLUGINS folder. Not mods. Plugins.
To use: stand in front of the sensor you want to rename and type /sensorname <newname> , replace <newname> with desired name. You will be prompted to right click the sensor you wish to rename. Do that, and you're done.

Note: You can completely ignore the original sensor renaming box. Whatever it reads doesn't matter.

As usual, backup your world before using. So far has worked fine on my server.

#428 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 16 November 2012 - 11:31 PM

View PostPerkins, on 16 November 2012 - 03:06 PM, said:

So if I were to assemble a couple sensors for it, would you have any interest in including them? I'll have a little free time this weekend and it seems like an okay way to learn a little java, and I really want to get a computer controlled reactor up and running :)/>

http://www.computerc...-openccsensors/

That's where I will be continuing this project.

#429 TheVarmari

  • Members
  • 70 posts
  • LocationFinland

Posted 17 November 2012 - 02:28 AM

View PostLEOcab, on 14 November 2012 - 06:59 PM, said:

Bro, how the hell does the Lua API work? I'm using your mod with Tekkit. I was very excited to find out that it is able to detect player names, but I can't figure out how to code for it.

function pt(t) -- print table
  for k,v in pairs(t) do print(tostring(k).." = "..tostring(v)) end
end

sensors.setSensorRange("right", "Sensor", "16") -- short range so only I am detected

tTable = sensors.getAvailableTargetsforProbe("right", "Sensor", "LivingEntities")
pt(tTable) -- prints a living entity (me) and my coordinates

ent = tostring(tTable[1]) -- my name & coords are displayed, as expected

tTable = sensors.getSensorReadingAsDict("right", "Sensor", ent, "LivingEntities")
pt(tTable) -- EMPTY! NOTHING DISPLAYED!

It didn't work so I grabbed the ccSensors/console program, copied it to my computer, found the call to getSensorReadingAsDict() and made it display exactly what parameters were being passed to the function and then crash the program. Turns out the official ccSensors program is passing THE EXACT SAME PARAMETERS as my program passes to the same function, yet mine doesn't work. This is bizarre. I dun get. Has someone successfully coded for the ccSensors API? There's barely any information for it out there.

(I want to hook up a player name detector to my secret base so it can execute item evac via ender chests and then self destruct, in case someone ever finds it. LOL.)
tTable seems to be a table. You did it right the first time, "tTable[1]", but now it seems like you're trying to print out the table, which you can't do.
EDIT: I'm an idiot.

#430 itsme

  • Members
  • 9 posts

Posted 20 November 2012 - 06:09 AM

View Postsnaipperi, on 16 November 2012 - 09:54 PM, said:

Actually yes it is possible, some French dude made a bukkit plugin that gives a text command + right click which allows you to set the sensor name, I can't find the original web site anymore, but I do have the zip with the source code and the plugin. There's no readme included;

Source code: http://www.eiden.fi/ccSensorsFix.zip
Bukkit plugin: http://www.eiden.fi/ccSensorsFix.jar

To install: place ccSensorsFix.jar into your server's PLUGINS folder. Not mods. Plugins.
To use: stand in front of the sensor you want to rename and type /sensorname <newname> , replace <newname> with desired name. You will be prompted to right click the sensor you wish to rename. Do that, and you're done.

Note: You can completely ignore the original sensor renaming box. Whatever it reads doesn't matter.

As usual, backup your world before using. So far has worked fine on my server.

Thank you very much!

I'm going to try it!

#431 IceNine

  • New Members
  • 1 posts

Posted 28 November 2012 - 04:04 AM

Is it possible to upgrade the server to PR2 while clients are still using PR1 for Tekkit SMP? I would really like to have the bug fixes for proximity sensors and log spam but Tekkit only provides PR1.

#432 fatsacktony

  • New Members
  • 3 posts

Posted 29 November 2012 - 04:59 PM

I found a solution to a problem I was having and want to share it. I loaded 2 other mods for technic and had the id resolver autoassign id's for every mod by deleting the config file and having it reconstruct the id maps. By doing this I think that ccsensors couldn't recognize its own sensor modules for its sensor. It wouldnt let me manually load them in the gui or by right clicking with the sensor module in hand.

SOLUTION
use a chest, wooden pipe, redstone engine to load the module into the top of the sensor forcibly. connect the wooden pipe to the chest and to the top of the sensor. place the redstone engine next to the wooden pipe and give it a redstone signal. place the module that you want to go into the sensor in the chest and watch it insert it. than you can remove everything but the sensor. but you'll have to repeat this process whenever you move the sensor.

#433 fatsacktony

  • New Members
  • 3 posts

Posted 01 December 2012 - 06:50 AM

View PostFalesh, on 02 September 2012 - 10:18 AM, said:

Bug Report

This program when set as a startup program for the computer linked to the Sensor Controller works correctly until I save and exit the world a few times, after which the sensor stops finding targets. The only way I have found to fix this is to destroy the Sensor Controller and Sensor, replace the Sensor Controller and make a new channel with a Blank Transmitter Card and then replace the Sensor using this new Transmitter Card. Old channels seem permanently bugged once this happens.

p.s. thanks for the mod, it's awesome!


I was having the same bug where it would get stuck on a previous sensor reading and wouldnt update the sensors at all. How I fixed it was to rename the sensor than went and changed the call name for that sensor in my code

#434 Tiin57

    Java Lunatic

  • Members
  • 1,412 posts
  • LocationIndiana, United States

Posted 01 December 2012 - 08:28 AM

This peripheral is not being developed anymore. :P

#435 gigagames

  • Members
  • 55 posts

Posted 23 December 2012 - 02:58 AM

Where can i found this addon for the new CC version ?

#436 CoolisTheName007

  • Members
  • 304 posts

Posted 23 December 2012 - 03:00 AM

View Postgigagames, on 23 December 2012 - 02:58 AM, said:

snip
Here: http://www.computerc...__fromsearch__1

#437 Aloke

  • New Members
  • 4 posts

Posted 24 December 2012 - 12:13 AM

Hi all! I'm pretty new to lua. Right now I am using ccsensors to check my mfsu's storage level. So i connected all up and to get stats I'm using this: "monitor right /ccSensors getReading Sensor EUStorage", but the problem is, that it does not constantly update itself, I have to exit and rewrite the command if I want to see if im starting to lose power or have more of it. What would I need to change to get getReading to update the energy value on its own.

#438 Impervium

  • New Members
  • 9 posts

Posted 02 January 2013 - 04:03 AM

Hi
It said on the first page that the ccSensors client MC125 B017pr1 had it's issue with proximity sensors fixed in relating to detecting players.

Quote

fixed: proximity sensor partially fixed for SMP - can only correctly detect players for now.. (working on animals/mobs for next version)

I've gotten my sensor to detect a player and the player coordinates. that's fine.
Except when I use the sensors.getSensorReadingAsDict on the player target, I end up halting the program on the "Player" probe and getting nothing / gibberish on the "LivingEntities" probe.
And by gibberish I mean if I do:
data = sensors.getSensorReadingAsDict(side,mainSensor,PlayerTarget,PlayerProbe)
term.write(data.name)

I get nothing
if I only write

term.write(data)

to figure out if it's actually getting anything at all, I get "table:" and some gibberish numbers and letters.

Am I being very stupid here or is this still not fixed?

#439 immibis

    Lua God

  • Members
  • 1,033 posts
  • LocationWellington, New Zealand

Posted 02 January 2013 - 01:53 PM

View PostImpervium, on 02 January 2013 - 04:03 AM, said:

Hi
It said on the first page that the ccSensors client MC125 B017pr1 had it's issue with proximity sensors fixed in relating to detecting players.

Quote

fixed: proximity sensor partially fixed for SMP - can only correctly detect players for now.. (working on animals/mobs for next version)

I've gotten my sensor to detect a player and the player coordinates. that's fine.
Except when I use the sensors.getSensorReadingAsDict on the player target, I end up halting the program on the "Player" probe and getting nothing / gibberish on the "LivingEntities" probe.
And by gibberish I mean if I do:
data = sensors.getSensorReadingAsDict(side,mainSensor,PlayerTarget,PlayerProbe)
term.write(data.name)

I get nothing
if I only write

term.write(data)

to figure out if it's actually getting anything at all, I get "table:" and some gibberish numbers and letters.

Am I being very stupid here or is this still not fixed?
This addon is pretty much dead.

#440 Leo Verto

  • Members
  • 620 posts
  • LocationOver there

Posted 02 January 2013 - 02:28 PM

View Postimmibis, on 02 January 2013 - 01:53 PM, said:

This addon is pretty much dead.
He's probably still using tekkit, didn't the technic team just put in ccSensors without asking Cloudy?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users