07 June 2018 Tagged: eulorac++

I had an issue a while ago mining small claims with the bot that got the slap-on-a-bandaid treatment. The problem was that small claims took 5 minutes for me to build, while tiny claims took less than 5 seconds. And I couldn’t figure out the right parameters to pass for the result I wanted.

If I passed a timeout value less than 5 minutes, then the bot got impatient and walked away in the middle of the build. But when passing a value long enough for the build, whenever the bot got hung up on any other situation, it would idle for the whole 5 minutes until the eventual timeout.

I tried a couple code changes that didn’t work. So I just auto-locked the small claims and moved on to more pressing issues. But all of a sudden since yesterday, I can build small claims super fast. Time to revist.

I don’t have the crafting table sorted out completely for exploring yet, so I can’t have the bot table walk with small claim output. So I made the following quick change so that the bot will build the small claim and then lock it after, instead of looting it. It seems like the empty locked claim gets swept quickly but with something in it, swept much later.

src/client/foxybot/botactivity.cpp(648)
void ExploreActivity::DoTakeResult()
{
	worldHandler::TargetEID(markerID);
	worldHandler::TakeAllFromTarget();
	spentClaims.Put(markerID, markerID);
}

That’s the code to loot the claim after building it. I added a conditional to instead lock the claim if it’s a small, otherwise loot as normal.

src/client/foxybot/botactivity.cpp(648)
void ExploreActivity::DoTakeResult()
{
	worldHandler::TargetEID(markerID);
	if (claimType.CompareNoCase("Small"))
		worldHandler::PicklockEID(markerID);
	else
		worldHandler::TakeAllFromTarget();
	spentClaims.Put(markerID, markerID);
}

So that’s that. It’s not a big deal and it didn’t take much time, But I thought I’d give you this quickie. How was it for you?


Add a Comment