# Making bot do town chores

**URL:** https://blizzhackers.discourse.group/t/making-bot-do-town-chores/409
**Category:** Support
**Created:** [October 11, 2019, 12:35am UTC](https://blizzhackers.discourse.group/t/making-bot-do-town-chores/409 "2019-10-11T00:35:47Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mike1234](https://avatars.discourse-cdn.com/v4/letter/m/aca169/32.png) [@mike1234](https://blizzhackers.discourse.group/u/mike1234)
#### Post date: [October 11, 2019, 12:35am UTC](https://blizzhackers.discourse.group/t/making-bot-do-town-chores/409/1 "2019-10-11T00:35:47Z")

</div>

So I have a script where sorc gets xp shrine, how do I make it so after he tp’s shrine he does chores that way I don’t have to wait in the next game for him to buy town portals?

function EsSearch() {  
Pather.useWaypoint(4);  
Precast.doPrecast(true);

```
for (i = 4; i > 1; i -= 1) {
	if (Misc.getShrinesInArea(i, 15, false)) {
		say("");
		return;
	}
}

Town.goToTown();
Pather.useWaypoint(5);
Precast.doPrecast(true);

for (i = 5; i < 8; i += 1) {
	if (Misc.getShrinesInArea(i, 15, false)) {
		say("");
		return;
	}
}	

```

}

---

<div class="post-metadata">

### Author: ![mf22](https://yyz2.discourse-cdn.com/free1/user_avatar/blizzhackers.discourse.group/mf22/32/18_2.png) [@mf22](https://blizzhackers.discourse.group/u/mf22)
#### Post date: [October 11, 2019, 7:14am UTC](https://blizzhackers.discourse.group/t/making-bot-do-town-chores/409/2 "2019-10-11T07:14:26Z")

</div>

you should add **Town.doChores();** inside your function at the end, so it will look like:

```javascript
function EsSearch() {
...
 Town.doChores();
}
```
