If you haven't already, feel free to check out my scripting tutorial which outlines the very basics.
http://osbot.org/forum/topic/58775-a-beginners-guide-to-writing-osbot-scripts-where-to-get-started-by-apaec/
Firstly, to stop your bot leaving an area, we first have to define the area in question:
at the top of your script where you define all your variables,
Area HUNTING_AREA = new Area(0,0,0,0);
// instead of 0,0,0,0, write the top right and bottom left coords in the format
// (Top right X, Top right Y, Bottom left X, Bottom left y);
Then, after defining your area, you need to check if the players in it. In this scenario, we want to make sure the player is not out of the area. We can do this by dropping a check at the top of the onLoop:
if (!HUNTING_AREA.contains(myPlayer())) { //if you're not standing in the hunting area
log("Returning to Hunting Area");
localWalker.walk(HUNTING_AREA.getRandomPosition(0)); //Walks into hunting area
}
In light to your other question about the bird traps, you first need to find out what changes when you catch a bird. I.e, does the name change? do the actions change? does a single action change? Does the id change (this is a last resort) ?
Once you figure out what changes, let me know and we can figure things out from there.
As for a fallen over trap, at the top of your onloop, just put:
GroundItem fallenSnare = groundItems.closest("Snare"); //whatever the name is, and may have called this wrong
if (fallenSnare != null && fallenSnare.exists()) {
fallenSnare.interact("Take");
sleep(500);
}
Any other problems, just let me know. Oh yea and i wrote the code all in the reply box so forgive me if I made any typos / mistakes
Apaec