Refactor examples into a better form factor

This commit is contained in:
Casper Warden
2020-11-23 15:43:27 +00:00
parent 1f3677905b
commit 8ba2cf231c
14 changed files with 672 additions and 460 deletions

View File

@@ -0,0 +1,21 @@
import { ExampleBot } from '../ExampleBot';
class Parcels extends ExampleBot
{
async onConnected()
{
const parcelInMiddle = await this.bot.clientCommands.region.getParcelAt(128, 128);
console.log('Parcel at 128x128 is ' + parcelInMiddle.Name);
const parcels = await this.bot.clientCommands.region.getParcels();
console.log('Parcels on region:');
console.log('========================');
for (const p of parcels)
{
console.log(p.Name);
}
console.log('========================');
}
}
new Parcels().run().then(() => {}).catch((err) => { console.error(err) });