Skip to content

Instantly share code, notes, and snippets.

@Loopshape
Last active February 16, 2024 00:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Loopshape/35a6a8aebdc082588351257a70d18d43 to your computer and use it in GitHub Desktop.
Save Loopshape/35a6a8aebdc082588351257a70d18d43 to your computer and use it in GitHub Desktop.
Cheat Sheep // BTC Blockchain Relocation v0.3.3
// ==UserScript==
// @name FLOWXBTC
// @namespace *://flowx*/*
// @namespace *://24lex*/*
// @namespace *://huyx*/*
// @namespace *://lemc*/*
// @namespace *://flyb*/*
// @namespace *://crypto*/*
// @version 0.3.2
// @description BTC blockchain relocation
// @author WONDERBYTE <bitmax.coinwarp@gmail.com>
// @match *://*/*
// @icon *://crypto-upbit.com/images/logo/13.png
// @grant none
// @require https://code.jquery.com/jquery-latest.min.js
// ==/UserScript==
(function($) {
'use strict';
// Define tokens array
const tokens = ["USDT", "BTC", "ETH", "XRP", "DOT", "ADA", "KSM", "LTC", "XTZ", "LINK", "XLM", "EOS", "TRX", "BCH", "BNB", "XMR", "ZEC", "DASH", "1INCH", "INJ", "CRO", "FTT", "FLOW", "ICP", "RSR", "MKR", "BAT", "OMG", "COMP", "UNI", "SNX", "SUSHI", "THETA", "MATIC", "FET", "BAND", "GRT", "DOGE", "ATOM", "RUNE", "NEO", "ONT", "XEM", "WAVES", "RVN", "HBAR", "ZIL", "FIL", "ALGO", "AVAX", "SOL"];
// Define variables
let getUsdt, bestPrice, orderPrice, goodPrice;
// Set initial currency
let currency = 'USDT';
// Function to update UI elements
function updateUI() {
getUsdt = $("table > thead > tr:nth-child(3) > th:nth-child(2)").text();
$("span#name_site_header").text('Balance: ' + getUsdt.replace(/[^0-9\.]/g, '') + ' ' + currency);
bestPrice = getUsdt.replace(/[^0-9\.]/g, '');
const currencyText = $("body > div.wrapper.other-pages > div > mat-card.item.content-1.mat-elevation-z6.mat-card > mat-card-title > app-coinpair-stats > div:nth-child(1) > p:nth-child(2) > span").text();
$("title").html(currencyText + ' = ' + bestPrice + ' USDT');
orderPrice = parseFloat($("#order_price_sell div").text()) * 0.75;
$("#order_price_sell div").html(orderPrice);
$("div#placeholder div").html(bestPrice * 1.25);
$("span#open_margin_count").empty();
goodPrice = $("#mat-tab-content-1-0 > div > app-open-orders-table > table > thead > tr:nth-child(2) > th:nth-child(5)").text();
$("#mat-tab-content-1-0 > div > app-open-orders-table > table > thead > tr:nth-child(2) > th.th_orders_main.max_width_th > input div").text(goodPrice);
$("#margin_modal").attr('data', currency);
}
// Function to handle keypress event
function handleKeypress(e) {
// ASCII codes for "<" and ">" keys
const backwardKey = 60;
const forwardKey = 62;
// Additional keys for future functionality
const backwardAltKey = 33; // "!"
const forwardAltKey = 63; // "?"
// Bet Crypto risk
const betRiskHigh = 17; // "left-Strg"
const betRiskLow = 18; // "left-Alt"
// Determine which key was pressed
let keyPressed = e.which;
// Determine the direction of token cycling
let direction = 1; // Forward by default
if (keyPressed === backwardKey || keyPressed === backwardAltKey) {
if(keyPressed === backwardAltKey) {
$("div.btn_title_order").attr('parent', currency);
$("div.btn_title_order.bottom_line").attr('parent', currency);
$("#margin_modal > div > div > div.modal-body > p:nth-child(1) > label").html(currency);
}
direction = -1; // Backward
} else if (keyPressed !== forwardKey && keyPressed !== forwardAltKey) {
if(keyPressed === forwardAltKey) {
$("div.btn_title_order").attr('parent', 'USDT');
$("div.btn_title_order.bottom_line").attr('parent', 'USDT');
$("#margin_modal > div > div > div.modal-body > p:nth-child(1) > label").html('USDT');
}
// If neither forward nor backward key is pressed, exit the function
return;
}
e.preventDefault();
// Find the current index of the currency in tokens array
let currentIndex = tokens.indexOf(currency);
// Calculate the new index based on the direction
let newIndex = (currentIndex + direction + tokens.length) % tokens.length;
// Update the currency to the new token
currency = tokens[newIndex];
// Log the user activity to the console
if (direction === 1) {
console.log('Cycling forward to next token:', currency);
} else {
console.log('Cycling backward to previous token:', currency);
}
// Update the UI
updateUI();
}
// Function to initialize the script
function initializeScript() {
console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
console.log('CHEAT SHEEP :: Created by WONDERBYTE in 2023');
console.log('For email inquiries: bitmax.coinwarp@gmail.com');
console.log('Check latest GIST on Github.com for updates!');
console.log('https://gist.github.com/Loopshape/43da736b73a1b3ba2e1f1e8470cb7d74');
console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
// Apply styles
$("html").css({'font-family': 'non-serif', 'font-size': '0.5em!important'});
$("div#preloader").remove();
$("body").addClass('transcend');
$("body > *").attr('data-form', 'step');
$("button").attr('data-form', 'submit-btn');
$("html *").css({'overflow': 'hidden!important', 'font-size': '0.78em!important', 'font-weight': '800!important'});
$(".mat-tab-label").css('font-size', '0.66em!important');
$("div.tv-lightweight-charts").css('overflow', 'visible!important');
// Bind keypress event
$(document).on('keypress', handleKeypress);
// Update UI periodically
setInterval(updateUI, 1000);
console.log('...done!');
}
// Execute script on page load
initializeScript();
})(jQuery);
@Loopshape
Copy link
Author

Summary Explanation of

Cheat Sheep // BTC Blockchain Relocation v0.3.3

The "Cheat Sheep" function in the script allows for dynamic navigation through a predefined list of cryptocurrency tokens. Here's how it works:

Navigation through Tokens: The function listens for keypress events and responds to specific keys ("<", ">", "!", "?") to cycle through the list of tokens in either forward or backward direction.

Token Cycling: When the user presses the "<" key, the script cycles backward to the previous token in the list. Conversely, when the user presses the ">" key, the script cycles forward to the next token in the list.

Additional Functionality: The script also handles two additional keys, "!" and "?", which could be utilized for future functionalities. Currently, pressing the "!" key elevates the current token into the margin spread.

Error Handling: The function includes error handling to ensure that only valid keys trigger token cycling. If any other key is pressed, the function exits without performing any action.

Console Logging: Each time the user cycles through tokens, the script logs the activity to the console, providing feedback on the current token being selected.

Overall, the "Cheat Sheep" function enhances user interaction by providing a convenient way to navigate through cryptocurrency tokens on the page. It offers flexibility and ease of use, making it easier for users to access the desired token information.

@Loopshape
Copy link
Author

works on domains like

http://crypto-upbit.com ...
and similar
228630395-e4332be5-91dd-4e76-98e3-f93d0dd6b4e5
``

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment