Posted 01 April 2014 - 03:48 AM
First of all, this code is meant to scan essentia in Warded Jars in the mod called Thaumcraft 4. Some knowledge might help understand the code itself a little bit.
I have downloaded a copy of "button" and "aspects" from DireWolf20. I don't know too much LUA, however, but I do know enough to know what the program itself does.
Link for aspects - pastebin(dot)com/2Vx1jthe
Link for button - pastebin(dot)com/z0FBM6wd
Button creates the buttons on a touch screen monitor using hard-coded x and y coordinates to determine where each variable in the table essentia (located in aspects) goes. It is also used later, in fillTable2 (in aspects) for example, to define where certain buttons go and what kind of parameters can be accepted depending on the button pushed.
scanEssentia uses PeripheralProxy's and wired modems to scan the amount of essentia in a jar as well as what type of essentia. It then puts the name of the essentia by using the variable asp. There are 50+ types of essentia, so looking at all of these on a screen without being alphabetically ordered is quite a hasel. The way the code is defined is that it runs off an infinite loop, and each time the code is terminated, and restarted the list itself might be in a different order. For example, three aspects are called aer, terra, and momentum. The first time the code is ran it could print terra, aer, and then momentum on the monitor. Then, once terminated and reran, the monitor may display it by saying aer, terra and then momentum. I simply just wish to alphabeticalize these varibles, but i cannot seem to get table.sort to work. I simply am not sure whether or not asp is what I want to use, or essentia.
The code from the pastebin links are largely unedited by myself other than a function to go back to fillTable when I am in fillTable2.
Thanks!
I have downloaded a copy of "button" and "aspects" from DireWolf20. I don't know too much LUA, however, but I do know enough to know what the program itself does.
Link for aspects - pastebin(dot)com/2Vx1jthe
Link for button - pastebin(dot)com/z0FBM6wd
Button creates the buttons on a touch screen monitor using hard-coded x and y coordinates to determine where each variable in the table essentia (located in aspects) goes. It is also used later, in fillTable2 (in aspects) for example, to define where certain buttons go and what kind of parameters can be accepted depending on the button pushed.
scanEssentia uses PeripheralProxy's and wired modems to scan the amount of essentia in a jar as well as what type of essentia. It then puts the name of the essentia by using the variable asp. There are 50+ types of essentia, so looking at all of these on a screen without being alphabetically ordered is quite a hasel. The way the code is defined is that it runs off an infinite loop, and each time the code is terminated, and restarted the list itself might be in a different order. For example, three aspects are called aer, terra, and momentum. The first time the code is ran it could print terra, aer, and then momentum on the monitor. Then, once terminated and reran, the monitor may display it by saying aer, terra and then momentum. I simply just wish to alphabeticalize these varibles, but i cannot seem to get table.sort to work. I simply am not sure whether or not asp is what I want to use, or essentia.
The code from the pastebin links are largely unedited by myself other than a function to go back to fillTable when I am in fillTable2.
Thanks!