Jump to content




Pneumaticraft Computer contoller

computer

2 replies to this topic

#1 Matachusets2

  • Members
  • 4 posts

Posted 25 October 2017 - 01:23 PM

Hello every one, very long time i dont sing in, first its first, thanks for the answers in my R.I.P "Launchpad Controller", when i post that, afther 2 weeks whit no response i didont get in more, but today , i was having problems and when i sing in, i saw my forgoten post, and the answers, maybe later I correct that code for a new launchpad when i go again to the moon or mars ect...

I "recycle" that code to make a brand new Pneumaticraft Air Compressor controller, and i finish it and works, but i like to ask how i can make the program's menu to refres pressure, here is the code:

Spoiler


As you all can see, my code is very complex, i could make it more easy and simply, but this way i think is better for learning.
these last 2 lines dont work for refresing, i thing i need a "if bucle" or a "while bucle" for the refresing but didont know where i have to put then and how. Thanks a lot.

Edited by Bomb Bloke, 26 October 2017 - 09:37 AM.


#2 Luca_S

  • Members
  • 392 posts
  • LocationGermany

Posted 26 October 2017 - 07:39 AM

A few things:
1. If you post code in the CC Forums please put it in a code tag, it will be much easier to read:
print("Hello World")
2. If you have code that is really long, like yours I would suggest putting it on pastebin instead of putting all of it in your post
3. Indent your code, it will make it way easier to read. (This is much easier to read, right?)
4. Be more consistent in how you name your variables/functions(e.g. you have Exit() with a uppercase first letter and then lowercase, close() with only lowercase and MENU(), HASTA(), etc. with all uppercase)
5. Try to name your variables in english it will make it much easier for someone else to understand what's going on.

Ok with these out of the way the problem in your code is probably that you only set the variable presion once and do not update it before drawing it to the screen, try adding
presion = Aire.getPressure()
everytime before you print out presion to the screen, this should make it update.

#3 Matachusets2

  • Members
  • 4 posts

Posted 04 December 2017 - 01:15 AM

Ok, thanks, and sorry about posting all the code whiout the spoiler buton, i dont post much on forums, i ususally read 99.99% of the time, next time i try to dont forget at least the spoiler buton. As for the program i modified it, a few bugs and some mistakes i notice afther running some time it, for example the auto function, it shut off the compresor, BUT... shut off all, never go on again if presion or "pressure" in english, go down. i post the program agaain once i have it bug free and on a decent working state, then i try to add more complex things. Thanks again.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users