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

Help with scrolling text thing

Started by KingofGamesYami, 19 March 2014 - 03:12 AM
KingofGamesYami #1
Posted 19 March 2014 - 04:12 AM
Topic for my program: http://www.computerc...rs-made-simple/
Lines having trouble with:
I've done some major fixing and stuff…
http://pastebin.com/ii02ZH2g - heres the full code, it probably needs some debugging
Ok, fixed that part… Now I just need to figure out how to make the text reset to the end of the screen when it has a number LESS than 5…
Edited on 19 March 2014 - 04:26 PM
Bomb Bloke #2
Posted 19 March 2014 - 05:09 AM
A fix for what? You haven't actually explained what you want this code to do, and how what it does differs from that.

Looking at the line you've highlighted:

if tlenth == 0-tlenth then

… I can tell you that the only circumstance where this will be true is when tlenth == 0. If it were any other value, then you'd be checking to see if a positive version of the variable is equal to a negative one; this will never be the case.

I'm somewhat perplexed by your use of the three different variables "tlength", "tlenth", and "tlenght". I'm of the impression that at least one of these is a typo.
KingofGamesYami #3
Posted 19 March 2014 - 02:35 PM
Yeah, I fixed the variable names now.. I was half-asleep when I wrote this code. Anyway, what I want that part to do is basically this: if text is off screen to the left, text is off screen to the right.
If your confused by some of the stuff I have, its probably because I used several shortcuts in my code: t = term t.sCP = t.setCursorPos m = peripheral.wrap(side) t.w = term.write
The variable starts positive, but it is in a loop that subtracts 1 each time
Edited on 19 March 2014 - 01:40 PM