Jump to content




Marikc0's Programs: Base Power/tank/machine Monitor

peripheral lua

64 replies to this topic

#21 EnnekPL

  • Members
  • 8 posts

Posted 27 January 2014 - 05:46 PM

View PostReggie, on 27 January 2014 - 12:57 PM, said:

EnnekPL
This look really interesting, could you maybe put up a post on how you did this or could you send me the bit of code for the status bar at the side. The next big thing would be to implement more mods and if you rewrote the bits from the original code, you could put this program up as your own post
i think when i finish I create new thread.

Edited by EnnekPL, 27 January 2014 - 06:13 PM.


#22 FireBall1725

  • New Members
  • 1 posts

Posted 02 February 2014 - 12:51 PM

View PostEnnekPL, on 27 January 2014 - 05:46 PM, said:

View PostReggie, on 27 January 2014 - 12:57 PM, said:

EnnekPL
This look really interesting, could you maybe put up a post on how you did this or could you send me the bit of code for the status bar at the side. The next big thing would be to implement more mods and if you rewrote the bits from the original code, you could put this program up as your own post
i think when i finish I create new thread.

I also am interested in seeing your code when you get it completed.

#23 thesilenton3

  • New Members
  • 2 posts

Posted 02 February 2014 - 03:54 PM

Anyone able to explain to me how to get the tanks to show data.. wired modem is attached to valve and wired into pc and nothing seems to show? Id greatly appreciate some support on the matter

#24 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 02 February 2014 - 04:44 PM

Update OpenPeripheral.

#25 thesilenton3

  • New Members
  • 2 posts

Posted 03 February 2014 - 03:30 AM

View PostLyqyd, on 02 February 2014 - 04:44 PM, said:

Update OpenPeripheral.

So this is gonna make me look like an idiot most likly but im on a ftb 1.5.2 server running unleashed, thats not owned by me.. so i cant technically update open peripheral can i? if this were my server id be running openccsensors on it lol

Anyway.. Using this program.. i was able to get the mfsu power to show.. and using another program with a computer directly on the valve of the tank with a monitor on top showed tank data.. so why wouldnt this.. i dont see the update as nesscesary just to get this program to show the tanks info since another program was able to do so.. right? btw thx for the approval and the response.. very new to the Computercraft thing and basically just trying to learn from stuff to delve into my own cc adventures at some point

EDIT - So with a lil bit of luck and a small piece of code that i found on this page here on post #22 http://www.computerc...ng/page__st__20

valve = peripheral.wrap("back")
for k,v in pairs(valve) do print(k) end

i had to take lyqyds advice and stopped the program from auto updating by removing lines 66-68 in the main program(not the api)
(Changed From)
-- Load API ---
if fs.exists("marik") then shell.run("rm marik") end
print("Updating API...")
shell.run("pastebin get Th8tne6p marik")
os.loadAPI("marik")
---------------
(Changed To)
-- Load API ---
os.loadAPI("marik")
---------------

I noticed that the code written in the program here used getTanksInfo on line 60 of the api labeled marik which (the reason im unsure of.. maybe marik used a newer/older version?)
to try and pull the into from the tank..

running the code snippet i shared in the lua live thing with the periperhal(tank) behind the advanced computer showed me i guess whats called methods right? correct me if im wrong plz, learning here.. which didnt return getTanksInfo but listed getTanks so i changed the program over to getTanks while also changing line 160 of the program as follows

(Noticing that when i placed the wired modem onto the valve and turning on the modem that is said sumthing dif i Changed From)
if string.find(machines[i], "rcirontankvalvetile")
(Changed To)
if string.find(machines[i], "iron_tank_valve")

And low and behold 4 days later ive got it working :D that lil snippet of code will come is handy as i had no idea how to display each periphs methods(or w/e) which i can use on other periphs the same way to read the info
this has been driving me nuts trying to figure this out and it was super simple lol

Edit 2 - Now i need to figure out how to define ic2 machines.. when i place a wired modem on a compressor or macerator or other ic2 machines the modem says machine_block.. the only one i can manage to get to show on the monitor is the electric furnace because its labeled electric_furnace.. idk why the others wont show yet -.-

Edited by thesilenton3, 04 February 2014 - 06:16 PM.


#26 blackarchan

  • Members
  • 5 posts

Posted 08 February 2014 - 07:19 AM

View PostFireBall1725, on 02 February 2014 - 12:51 PM, said:

View PostEnnekPL, on 27 January 2014 - 05:46 PM, said:

View PostReggie, on 27 January 2014 - 12:57 PM, said:

EnnekPL
This look really interesting, could you maybe put up a post on how you did this or could you send me the bit of code for the status bar at the side. The next big thing would be to implement more mods and if you rewrote the bits from the original code, you could put this program up as your own post
i think when i finish I create new thread.

I also am interested in seeing your code when you get it completed.

Can i also have a pm with the code pls??

#27 MaGe

  • New Members
  • 1 posts

Posted 11 February 2014 - 11:10 AM

Yea, EnnekPL, this looks really interesting and exactly what i'm looking for, for monitoring my base.

Any update on the coding maybe?

#28 apoc123

  • Members
  • 34 posts

Posted 12 February 2014 - 06:39 PM

hes an awesome coder im have the code but its for openperipherals build#112 i have newest version so there are issues because of changes to methods ive tried to fix it but sadly im a noob at lua.

#29 MrEmielH

  • Members
  • 70 posts

Posted 17 February 2014 - 05:10 PM

i cluld use that piece of code to, can you please send it? maybe i can fix the problems due to the update

#30 apoc123

  • Members
  • 34 posts

Posted 18 February 2014 - 12:36 AM

Im waiting for ennekPl to answer he has stated he was going to start a new post so.. But if he dosnt come back i will publicly post the code and of course credit marik and ennekPL

I wont wait to long lol but he did do the work and its an awesome program it worked perfectly for build 112 openp but the new update changed a few methods l

Edited by apoc123, 18 February 2014 - 12:39 AM.


#31 MrEmielH

  • Members
  • 70 posts

Posted 18 February 2014 - 12:00 PM

View Postapoc123, on 18 February 2014 - 12:36 AM, said:

Im waiting for ennekPl to answer he has stated he was going to start a new post so.. But if he dosnt come back i will publicly post the code and of course credit marik and ennekPL

I wont wait to long lol but he did do the work and its an awesome program it worked perfectly for build 112 openp but the new update changed a few methods l
ok, thanks, how long do you think its gonna take?

#32 MrEmielH

  • Members
  • 70 posts

Posted 18 February 2014 - 03:08 PM

I have found the code and i was able to fix it (not the version with terminal glasses, i realy dont know how the work and they mess everything up)

#33 apoc123

  • Members
  • 34 posts

Posted 20 February 2014 - 05:03 PM

mrEmieIH i sent you a pm

#34 JoeNoIce

  • Members
  • 17 posts

Posted 21 February 2014 - 09:17 PM

i keep getting an error at line 52 with the program

#35 apoc123

  • Members
  • 34 posts

Posted 21 February 2014 - 10:26 PM

have to be more detailed 10xephos01 what ftb version what openperipheral if using what type of error specifically

#36 JoeNoIce

  • Members
  • 17 posts

Posted 22 February 2014 - 12:47 PM

i am using Wired's Server client with OpenPeripherals 0.2.1

#37 apoc123

  • Members
  • 34 posts

Posted 23 February 2014 - 10:18 AM

DEtAIL man like going to the doctor ah my midsection hurts whats wrong!! are you using the original code in the OP what is the error saying exactly. line 52 did you read and follow directions for set up more information pls

#38 dabz80

  • New Members
  • 2 posts

Posted 23 February 2014 - 05:33 PM

have some problem with original program

when i launch it, he found each peripheral exept energy storage but he stay blocked on " checking peripheral connections" and do nothing.

someone know how to fix this ?

#39 MrEmielH

  • Members
  • 70 posts

Posted 27 February 2014 - 09:12 PM

i fixed a lot of the bugs,
have a try: http://pastebin.com/kqPBeucx

#40 Tomcat94

  • New Members
  • 2 posts

Posted 28 February 2014 - 11:56 PM

View PostMrEmielH, on 27 February 2014 - 09:12 PM, said:

i fixed a lot of the bugs,
have a try: http://pastebin.com/kqPBeucx

I tried running this but I get an error at line 79 calling nil, can we get an example of a setup?





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users