A few things to note:
As the bot is interacting with a live game, you cannot rely on API calls to execute successfully. For example, if you have the line 'entity.interact(....', and then hit some lag, the call might not affect game state and so your script will continue without actually having interacted. You have to build in resilience to this with your script. Ideally, your script should be entirely deterministic and only execute one game interaction per onLoop call.
The onLoop function loops, so you will end up unnecessarily trying to walk to the area you have specified every iteration, which i'm guessing is not what you had in mind.
Avoid static sleeps (e.g sleep(random(300,400));...). These don't really anything other than hinder the efficiency of your script.
The interaction API handles camera movement etc, so no need to do that manually
Best of luck
Apa