Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Anon Auto Buy Script
- // @namespace http://tampermonkey.net/
- // @version 2024-04-01
- // @description try to take over the world!
- // @author You
- // @match https://boards.4chan.org/yse.html
- // @icon https://www.google.com/s2/favicons?sz=64&domain=4chan.org
- // @grant none
- // ==/UserScript==
- const protip = document.getElementById('js-protip')
- window.alert = a => protip.innerText = a
- let order_count = 0
- const order_counter = document.createElement('span')
- protip.insertAdjacentElement('afterend', order_counter)
- const auto_btn = document.createElement('button')
- let order_btn = () => document.getElementById('js-order-btn')
- order_btn().parentElement.appendChild(auto_btn)
- auto_btn.innerText = 'Auto'
- const refresh_btn = () => document.getElementById('js-refresh')
- const buy_btn = () => document.getElementById('js-buy-cb')
- const sell_btn = () => document.getElementById('js-sell-cb')
- const amount_btn = () => document.getElementById('js-amount')
- const price_btn = () => document.getElementById('js-cur-price')
- let interval
- function run() {
- function stop_fn() {
- clearInterval(interval)
- auto_btn.onclick = run
- auto_btn.innerText = 'Auto'
- }
- auto_btn.onclick = stop_fn
- auto_btn.innerText = 'Stop'
- const buy = buy_btn().checked
- const sell = sell_btn().checked
- const amount = amount_btn().value
- const known_price = price_btn().innerText
- function dump_it() {
- refresh_btn().click()
- if (known_price === price_btn().innerText) {
- amount_btn().value = amount
- if (buy) buy_btn().click()
- if (sell) sell_btn().click()
- order_btn().click()
- setTimeout(() => {
- if (buy) buy_btn().click()
- if (sell) sell_btn().click()
- amount_btn().value = amount
- }, 1000)
- if (protip.innerText === 'Your account balance is too low') stop_fn()
- else {
- order_count++
- order_counter.innerText = order_count + ' orders filled'
- }
- } else {
- alert('Stopped due to price change')
- stop_fn()
- }
- }
- dump_it()
- interval = setInterval(dump_it, 10010)
- }
- auto_btn.onclick = run
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement