September 18, 2023

Skript for okx

(function() {
const wallets = ["0x208F4E00D76d88443FE33bb8D7CE2F9E973AadaE","0x33F8ae44306a4Ed4Dc67629E94e30bBe375E363C","0xD380e6ce603E95e2Ef123f70A012d3eD0D685bF6","0x35A41978418B50a6320b1F2419C3F2B1e926b440","0x6B98207bB782f6fd617b6F250261D016Ba38Ded5","0x3Ff704defA2a2bF8Af31a83Fe13A2891B8402197","0x50cb1E376E36200bC576aceb9E0DBDbfa136FbB4","0xA0d945478fdF46eDa6697EB9169594B9e692CCc1","0x5D14Fa04a63DeEf159C2b1C0993c3B145E747DfF","1FE7113A3B3","0x8617838f50C1736D961f607D41a2CcECBcE378DB","0x8E813Cd11a5093186ebE759cb081a512F6db68aB"];

const names = ["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20"];

const walletSelectors = [];
const nameSelectors = [];

for (let i = 3; i <= 98; i += 5) {
walletSelectors.push(
`#scroll-box > div > div > form > div:nth-child(5) > div > div > div > div > div:nth-child(${i}) > div.okui-form-item-control > div > div > div > div > input`
);
}

for (let i = 5; i <= 100; i += 5) {
nameSelectors.push(
`#scroll-box > div > form > div:nth-child(3) > div > div > div > div > div:nth-child(${i}) > div.okui-form-item-control > div > div > div > div > input`
);
}

const addButtonSelector =
"#scroll-box > div > div > form > div:nth-child(5) > div > div > div > div > div.add-address-form-btn";

function fillInput(input, value) {
input.setAttribute('value', value);
input.dispatchEvent(new Event('input', { bubbles: true }));
}

async function addWallets() {
for (let i = 0; i < wallets.length; i++) {
console.log(`Добавление кошелька ${i + 1} из ${wallets.length}`);

const addressInput = document.querySelector(walletSelectors[i]);
const nameInput = document.querySelector(nameSelectors[i]);

fillInput(addressInput, wallets[i]);
await new Promise((resolve) => setTimeout(resolve, 300));

if (names.length > 0) {
fillInput(nameInput, names[i]);
await new Promise((resolve) => setTimeout(resolve, 400));
}

if (i < wallets.length - 1) {
const button = document.querySelector(addButtonSelector);
button.click();
await new Promise((resolve) => setTimeout(resolve, 1000));
}
}

console.log('Завершено');
}