Try to find a search path if no useable one exists

Now looks for main.lua file and derives path from that