CCraft problem for you LUA experts.

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here
  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

Jharakn

New Member
Jul 29, 2019
25
0
0
Hello all,

I've been dabbling in the world of computercraft and have made myself a gps mining program that's working pretty well so far but I've hit a problem. I think I know what's causing it but I don't know how to resolve it.

Firstly the full source for my miner can be found here: http://pastebin.com/q35ThqnZ apologies for those who actually code for a living its probably horrific. I occasionally get "too long without yielding" on line 386 which is the program writing its updated position to a separate file which it uses if the chunk gets unloaded or it stops to pick up from where it left off.

What I believe is happening since this never happened on my singleplayer is a spot of server lag has timed out my write function and the turtle has stopped. I've some experience with VBA and in that situation what I would use is a "On Error Resume Next" command because its not crippling to the program is it misses one file update, it'll pick it up the next time but I don't know how that would translate into LUA.

Hopefully someone can help.
 

Flip

New Member
Jul 29, 2019
59
0
0
I haven't done anything in CCraft yet, so I don't know exactly how lua is implemented. But you might want to look at the lua_atpanic function.
 

dutchgh0st

New Member
Jul 29, 2019
27
0
0
I think that people can help you out a lot better if you put comments in your code, just explain your code a bit so that we know what you tought at the moment of writing it