From 9212ca865634e9595a5bf94a0154b462e2a39172 Mon Sep 17 00:00:00 2001 From: marnixah Date: Fri, 21 Jan 2022 12:52:36 +0100 Subject: [PATCH] feat: rickroll --- src/classes/tv.ts | 214 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 201 insertions(+), 13 deletions(-) diff --git a/src/classes/tv.ts b/src/classes/tv.ts index 1182e3d..4c19ebb 100644 --- a/src/classes/tv.ts +++ b/src/classes/tv.ts @@ -32,39 +32,43 @@ export default class TV { } right(times?: number): Promise { - return this.sendIRCC('Right'); + return this.sendIRCC('Right', times); } up(times?: number): Promise { - return this.sendIRCC('Up'); + return this.sendIRCC('Up', times); } down(times?: number): Promise { - return this.sendIRCC('Down'); + return this.sendIRCC('Down', times); } ok(times?: number): Promise { - return this.sendIRCC('Confirm'); + return this.sendIRCC('Confirm', times); } off(times?: number): Promise { - return this.sendIRCC('PowerOff'); + return this.sendIRCC('PowerOff', times); } on(times?: number): Promise { - return this.sendIRCC('WakeUp'); + return this.sendIRCC('WakeUp', times); } sleep(times?: number): Promise { - return this.sendIRCC('Sleep'); + return this.sendIRCC('Sleep', times); } volumeUp(times?: number): Promise { - return this.sendIRCC('VolumeUp'); + return this.sendIRCC('VolumeUp', times); } volumeDown(times?: number): Promise { - return this.sendIRCC('VolumeDown'); + return this.sendIRCC('VolumeDown', times); + } + + exit(): Promise { + return this.sendIRCC('Exit'); } mute(): Promise { @@ -91,16 +95,200 @@ export default class TV { // Send applicationLauncher to open the app selection screen, then go right 5 times then 1 down. Then enter. await this.applicationLauncher(); await this.resetApplicationLauncher(); + await this.right(5); + await this.down(); + await this.ok(); + } + + async rickRoll(): Promise { + await this.browser(); + await this.exit(); + await this.down(); + await this.up(100); + await this.ok(); + + // Delete everything in text field + await this.left(); + await this.down(2); + await this.ok(100); + + // y + await this.left(4); + await this.up(2); + await this.ok(); + + // o + await this.right(3); + await this.ok(); + + // u + await this.left(2); + await this.ok(); + + // t + await this.left(2); + await this.ok(); + + // u + await this.right(2); + await this.ok(); + + // b + await this.down(2); + await this.left(); + await this.ok(); + + // e + await this.up(2); + await this.left(3); + await this.ok(); + + // . + await this.left(4); + await this.down(2); + await this.ok(); + + // c + await this.right(5); + await this.ok(); + + // o + await this.right(5); + await this.up(2); + await this.ok(); + + // m + await this.down(2); + await this.left(1); + await this.ok(); + + // / + await this.right(3); + await this.down(); + await this.ok(); + await this.up(2); + await this.left(); + await this.ok(); await this.right(); + await this.down(2); + await this.ok(); + + // w + await this.up(3); await this.right(); + await this.ok(); + + // a + await this.left(); + await this.down(); + await this.ok(); + + // t + await this.right(4); + await this.up(); + await this.ok(); + + // c + await this.down(2); + await this.left(); + await this.ok(); + + // h + await this.right(2); + await this.up(); + await this.ok(); + + // ? + await this.left(5); + await this.down(2); + await this.ok(); + await this.up(); + await this.left(3); + await this.ok(); + await this.right(3); + await this.down(); + await this.ok(); + + // v + await this.up(); + await this.right(4); + await this.ok(); + + // = + await this.left(4); + await this.down(); + await this.ok(); + await this.up(); + await this.ok(); + await this.left(4); + await this.up(); + await this.ok(); + await this.right(4); + await this.down(2); + await this.ok(); + + // d + await this.up(2); + await this.right(2); + await this.ok(); + + // Q + await this.left(2); + await this.down(); + await this.ok(); + await this.up(2); + await this.ok(); + + // w await this.right(); + await this.ok(); + + // 4 + await this.sendIRCC('Num4'); + + // w + await this.ok(); + + // 9 + await this.sendIRCC('Num9'); + + // W + await this.left(); + await this.down(2); + await this.ok(); await this.right(); - await this.right(); + await this.up(2); + await this.ok(); + + // g + await this.right(3); + await this.down(1); + await this.ok(); + + // X + await this.left(4); await this.down(); await this.ok(); - } + await this.right(2); + await this.ok(); + + // c + await this.right(); + await this.ok(); + + // Q + await this.left(3); + await this.ok(); + await this.up(2); + await this.ok(); + + // Enter + await this.left(); + await this.down(3); + await this.ok(); - topOfScreen(): Promise { - return this.up(30); + // Increase Volume + await this.volumeDown(100); + await this.volumeUp(20); } }