Bots Home
|
Create an App
Tip Alerts
Author:
ms_lucy
Description
Source Code
Launch Bot
Current Users
Created by:
Ms_Lucy
/*** Chaturbate Tip Alerts Bot created by @Ms_Lucy -> https://chaturbate.com/ms_lucy/ This Bot automatically Downloads and Updates Tip Alerts in an HTML file named 'tipalerts.html' in your computer Downloads folder, and show Animated Tip Alerts in your OBS Live Stream using OBS Browser plugin: -> URL: file://browser-path-to your-downloads-folder/tipalerts.html You need to manually download the images folder '/tipalerts-images/' (download and and uncompress tipalerts-images.zip) to your computer Downloads folder where the Tip Alerts file 'tipalerts.html' will get automatically downloaded and updated. There are 7 regular Tip levels with 7 different animated images stored in the /tipalerts-images/ folder, named 'tipalerts1.gif', 'tipalerts2.gif' ... and so on up to 'tipalerts7.gif' There are 4 Special Tip levels with their own animated images also stored in /tipalerts-images/ named 'wave.gif', 'pulse.gif', 'earthquake.gif' and 'fireworks.gif' Easy integration and customization of HTML file Template through Bot Options. Default Animation Images can be replaced by saving them with the same name on your /tipalerts-images/ folder ***/ // vars var last_tip_username = null; var last_tip_amount = 0; var last_tip_time = 1; var last_tip_image = 'tipalerts1.gif'; //Download tipalerts file function download(filename, text) { router.get('/', (req, res) => { res.attachment(filename) res.type('html') res.send(text) }); } // handlers cb.onTip(function(tip) { last_tip_amount = tip['amount'] last_tip_username = tip['from_user'] switch (true) { case (last_tip_amount >= 1 && last_tip_amount <= 14): last_tip_time = 3; last_tip_image = 'tipalerts1.gif'; break; case (last_tip_amount >= 15 && last_tip_amount <= 24): last_tip_time = 6; last_tip_image = 'tipalerts2.gif'; break; case (last_tip_amount >= 25 && last_tip_amount <= 49): last_tip_time = 9; last_tip_image = 'tipalerts3.gif'; break; case (last_tip_amount >= 50 && last_tip_amount <= 99): last_tip_time = 12; last_tip_image = 'tipalerts4.gif'; break; case (last_tip_amount >= 100 && last_tip_amount <= 499): last_tip_time = 15; last_tip_image = 'tipalerts5.gif'; break; case (last_tip_amount >= 500 && last_tip_amount <= 999): last_tip_time = 25; last_tip_image = 'tipalerts6.gif'; break; case (last_tip_amount >= 1000): last_tip_time = 45; last_tip_image = 'tipalerts7.gif'; break; default: last_tip_time = 3; last_tip_image = 'tipalerts1.gif'; } var filename = 'tipalerts.html'; //Download tipalerts file on every tip with interval duration last_tip_time var text = '<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Tip Alerts Page Template</title><meta http-equiv="refresh" content="' + last_tip_time + '" /><style type="text/css">body { background-color: transparent; margin:0; padding 0; } p { font-family: "Lucida Console", Monaco, monospace; color: Black; font-size: 11em; letter-spacing: .1em; } .Alert { color: DarkSlateGray; font-size: 130%;} .Tipper { margin-left: 1em; font-variant: small-caps; color: DarkRed; font-size: 200%; font-weight: bold; letter-spacing: .2em; text-shadow: 0 -1px 0 #fff, 0 1px 0 #2e2e2e, 0 2px 0 #2c2c2c, 0 3px 0 #2a2a2a, 0 4px 0 #282828, 0 5px 0 #262626, 0 6px 0 #242424, 0 7px 0 #222, 0 8px 0 #202020, 0 9px 0 #1e1e1e, 0 10px 0 #1c1c1c, 0 11px 0 #1a1a1a, 0 12px 0 #181818, 0 13px 0 #161616, 0 14px 0 #141414, 0 15px 0 #121212, 0 22px 30px rgba(0, 0, 0, 0.9); } .Tip { font-variant: small-caps; color: DarkGreen; font-size: 170%; font-weight: bold; letter-spacing: .2em; text-shadow: 0 -1px 0 #fff, 0 1px 0 #2e2e2e, 0 2px 0 #2c2c2c, 0 3px 0 #2a2a2a, 0 4px 0 #282828, 0 5px 0 #262626, 0 6px 0 #242424, 0 7px 0 #222, 0 8px 0 #202020, 0 9px 0 #1e1e1e, 0 10px 0 #1c1c1c, 0 11px 0 #1a1a1a, 0 12px 0 #181818, 0 13px 0 #161616, 0 14px 0 #141414, 0 15px 0 #121212, 0 22px 30px rgba(0, 0, 0, 0.9); }</style></head><body><p class="Alert"><span class="Tipper">' + last_tip_username + '</span> tipped <span class="Tip">' + last_tip_amount + '</span> tokens <br /><img src="tipalerts-images/' + last_tip_image + '" alt="" /></p></body></html>'; download(filename, text); //Clear tipalerts file after last_tip_time duration is over text = '<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Tip Alerts Page Template</title><meta http-equiv="refresh" content="1" /></head><body></body></html>' cb.setTimeout(function() { download(filename, text); }, last_tip_time*1000); });
© Copyright Chaturbate 2011- 2024. All Rights Reserved.