Posted 01 October 2012 - 07:34 AM
hello im Rhinehart_ im new to Lua and programming in general and like any newbie i started a project and then halfway realized i may have bit off more than i should fit in my mouth, i started a multiple turtle quarry project and ive nearly finished the program but i havent done the automatic refueling,
how i would like the refueling process to work is that when i first run the program the turtle calculates how much fuel it will need to complete the task, (i already have the turtle ask how far forward and how deep to go so the calculations would be simple i.e (length *depth)) so i define a line 20 long and 30 deep and it calculates
20 * 30 = 600
so it knows that it will need a minimum of 600 fuel, and then divide that number by 96, 144, 192 depending on which fuel i decide to use (probably charcoal so 96) and then it will prompt "i need X amount of Fuel" the problem is that i can take the 600 and divide by 96 or whatever fuel value but i dont know how to remove the remainder of it for example:
600/96 = 6 Remainder 24
im not certain if this is possible in lua but it doesnt really make sense for their not to be a command to do so,
im open to other ideas of how to calculate the amount of fuel needed, but i would prefer not to have to have it check its fuel level and then come back and get more when it needs fuel like in the excavate program, its just plain wasteful,
thank you for taking the time to read this post :)/>/>
how i would like the refueling process to work is that when i first run the program the turtle calculates how much fuel it will need to complete the task, (i already have the turtle ask how far forward and how deep to go so the calculations would be simple i.e (length *depth)) so i define a line 20 long and 30 deep and it calculates
20 * 30 = 600
so it knows that it will need a minimum of 600 fuel, and then divide that number by 96, 144, 192 depending on which fuel i decide to use (probably charcoal so 96) and then it will prompt "i need X amount of Fuel" the problem is that i can take the 600 and divide by 96 or whatever fuel value but i dont know how to remove the remainder of it for example:
600/96 = 6 Remainder 24
im not certain if this is possible in lua but it doesnt really make sense for their not to be a command to do so,
im open to other ideas of how to calculate the amount of fuel needed, but i would prefer not to have to have it check its fuel level and then come back and get more when it needs fuel like in the excavate program, its just plain wasteful,
thank you for taking the time to read this post :)/>/>