Jump to content


L5132's Content

There have been 9 items by L5132 (Search limited from 29-March 23)


By content type

See this member's

Sort by                Order  

#16224 [CC 1.33] [Beta 1.8.1] CCInput 0.27 (Big update!) - Play games on your gi...

Posted by L5132 on 19 June 2012 - 08:04 PM in Peripherals and Turtle Upgrades

Maybe only the person who placed the iblock receiver can use the keyboard with it? I would think that would help with the SMP issues. I know that IC2 has a personal safe that they have and once you place and right click it only you can use it. Don't know how that works exactly but I would assume that you could do it somewhat like a computer is saved, then have a text file with user names allowed to use it. Like I say though, I don't know exactly how they code it, but it seems like this is at least an idea.



#16213 printer peripheral [CC 1.48/1.481][MC 1.4.6/1.4.7] ccPrinter is back (need bu...

Posted by L5132 on 19 June 2012 - 06:30 PM in Peripherals and Turtle Upgrades

Hey, so I installed this on my server, and now whenever I go to shut off a computer, reboot it, or terminate a program, it causes the computer to lock with whatever screen was active and have to be destroyed to restart it, which is somewhat inconvenient, lol, does anyone know what might cause this? I re-installed as well.



#12790 Learning lua (Thread formerly: Help resolving lua VM error)

Posted by L5132 on 17 May 2012 - 05:10 PM in Ask a Pro

View PostCloudy, on 17 May 2012 - 11:28 AM, said:

Hey, as far as I've concerned, if your code works you've succeeded. However, I think you under use tables. For instance, checkDoor could have been made into one function with a table defined containing the door colour. When you'd pass an argument to checkDoor it would check the correct door.

Also, checki checks each value in a table, where you could use the pairs or ipairs iterator to do it in a loop, instead of checking each value in the table manually.

Food for thought for future learning :P/>
Thanks for the advice. I am actually writing this program in anticipation of needing it soon, although I currently do not. Seeing as I essentially wrote this to learn how to use tables in the first place I am going to take your advice and try to use tables and otherwise condense the program. I am not sure if I mentioned this but lua is the first programming language I have tried to learn and so far I find it rather nice and fairly easy to understand now that I realize what some of the errors mean. If it's alright I think I will keep this thread open to updates if I need help with anything. Also, I changed the thread title since I figured that was probably making my issues seem more serious than they are. I really do appreciate the help you guys are giving me, and if there's anything in particular you think I should check out feel free to mention it.



#12742 Learning lua (Thread formerly: Help resolving lua VM error)

Posted by L5132 on 17 May 2012 - 04:00 AM in Ask a Pro

Ok, thanks for the help! I got the program working exactly as intended, the final code ended up being
Spoiler
As you may have noticed, being new to programming I called a ton of functions that I am sure I could have avoided with a little thought, I am wondering if I did alright at programming this. To test if it was functioning correctly, I was using bundled cable on the back splitting to each of the 16 colors of insulated wire with the corresponding colored lamp attached to give a visual for how it was working.
*cringes at self for double posting*



#12705 Learning lua (Thread formerly: Help resolving lua VM error)

Posted by L5132 on 17 May 2012 - 12:21 AM in Ask a Pro

View PostMysticT, on 17 May 2012 - 12:12 AM, said:

I think you forgot the quotes for the strings and the parentheses for the read() call in these lines:
Spoiler
Yep, that's what I had done, and I also went back to using some of the functions at the top of the program instead of independently setting the table down below now.
And as to the rest of your fixes, those are probably what caused almost all of the errors. I guess that's what comes from writing the majority of this on a netbook during the school day and not being able to test until I had reached the code in the first post, lol :P/>



#12684 Learning lua (Thread formerly: Help resolving lua VM error)

Posted by L5132 on 16 May 2012 - 10:42 PM in Ask a Pro

Ah, I see where I messed up. I was going to include sleep functions, would that prevent this as well?



#12690 Learning lua (Thread formerly: Help resolving lua VM error)

Posted by L5132 on 16 May 2012 - 11:04 PM in Ask a Pro

Spoiler
So I revised the code, and it has also solved my original question. However, I am now encountering an error the previous error had convinced me I had solved :P/>
This is that on line 176, in the changeDoor() function, specifically in table.insert() I am using two variables to edit the table with the updated values, hopefully causing it to pull the new states for the redwire. However this appears to be something that is not allowed, and I would like to ask for help with that as well, thanks!



#12702 Learning lua (Thread formerly: Help resolving lua VM error)

Posted by L5132 on 17 May 2012 - 12:05 AM in Ask a Pro

View PostCloudy, on 16 May 2012 - 11:38 PM, said:

What is the exact error you are getting?

Also, I'd like to point out that this line of code
elseif i == 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9 or 10 or 11 or 12 or 13 or 14 or 15 or 16 then
won't do what you think it will - it will check if i = 1, and if those numbers exist - which they of course do - so it will always return true. You will be much better doing this:
elseif i >= 1 and i <= 16 then
Ah, sorry about that. I am getting the error " doorlock:176: bad argument: number expected, got function "
And as to you pointing out the numbers, I had been doing what you suggested, but it threw an error, I will try it again, however. I take it that that would essentially cripple the program since it would always default to that option? Thanks for helping so quickly!

EDIT: I just edited the file and ran it, the exact error I am getting on line 175 where I changed the list of numbers to "i >= 1 and i <=16" and it is throwing the error
"doorlock:175: attempt to compare function with number"
EDIT2: I also realized what that error meant and corrected it, now I think I may be on my way to fixing this thing.



#12681 Learning lua (Thread formerly: Help resolving lua VM error)

Posted by L5132 on 16 May 2012 - 10:26 PM in Ask a Pro

Spoiler
This code I wrote is throwing the error " doorlock2:176: vm error:
java.lang.ArrayIndexOutOfBoundsException: 256"
I would like help from people who have been working with this longer than I have to resolve it. I am running CC on minecraft 1.1 as of now since I have been running a Tekkit server since it's easier for my friends (Read: noobs) to join. Otherwise, I would not be using it, as I don't want or need a lot of what they threw in.

Anyways, the program is intended to use bundled cable on the back of the computer to control all 16 colors of insulated wire to some redpower AND gates which would open iron doors only if the computer is sending a signal and the button by the door is pressed. I would also probably switch to a password protected computer for the second signal at some point.
I've written a few other programs but this is the first time I've used tables to store variables, so if you could also help with the coding I would appreciate it.
I've been using Notepad++ to code it, its definitely much easier than the in game editor :P/>
Also, I have been looking into it with various searches and didn't come up with much, however I am fairly sure it is simply an error with how I coded something. Thanks, L5132