This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Night_Fire's profile picture

I've got many errors on OpenPeripheral program

Started by Night_Fire, 07 August 2015 - 03:10 PM
Night_Fire #1
Posted 07 August 2015 - 05:10 PM
Hello ! I've just get a new program to use with an XP farm. I'm using the following mods :
- ComputerCraft
- OpenPeripheral
- OpenCCSensors
- Soul Shards Reborn

There is an "attempt to call nil" error at line 25
I know there is other errors so if you can find them, you will help me a lot.

Soory, I'm french, I don't speak a perfect english.

Here is the program : http://pastebin.com/r8BkhSJJ
RootSlayers #2
Posted 07 August 2015 - 08:38 PM
Salut, tu utilise quelle version de OpenPeripheral ?

"getStringWidth" n'existe plus avec OpenP 0.3.1, tu peux utiliser


text = "50 niveaux"
w = text:len()

à la place.

__________________________________

Hello, what version of OpenPeriphral did you use ?

"getStringWidth" doesn't exist anymore in OpenPeripheral 0.3.1, so you can use :


text = "50 niveaux"
w = text:len()
Edited on 07 August 2015 - 08:30 PM
Lyqyd #3
Posted 07 August 2015 - 09:19 PM
Please provide an English translation of anything posted in another language.
flaghacker #4
Posted 07 August 2015 - 09:26 PM

text = "50 niveaux"
w = text:len()

That won't work at all, getStringWidth used to return the width of the string in pixels, not the character count. You'll have to calculate the width yourself instead. Example code can be found here.
RootSlayers #5
Posted 07 August 2015 - 10:30 PM
Yeah, I forgot this point again :s

Please provide an English translation of anything posted in another language.

Done, sorry :x.
Night_Fire #6
Posted 08 August 2015 - 10:46 AM
Hello. Thank every one. If i get other errors, i will tell you again.
flaghacker #7
Posted 08 August 2015 - 12:33 PM
Yeah, I forgot this point again :s

Please provide an English translation of anything posted in another language.

Done, sorry :x.

If you rewrite your answer anyway, maybe you could mention that what you're suggesting is wrong?