Giter VIP home page Giter VIP logo

chesscup-hack's People

Contributors

alexlwn123 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

chesscup-hack's Issues

1

nvm

the readme has a big flaw

so you see, i just happened to become #1 on survival about an hour ago and in the readme it says the bot holds the number 1 spot in all three gamemodes which happens to now be an unvalid statement(sorry for taking your spot and wasting your time with this "issue").

hello

everything is working exept the pawn promotion like it cant promote the pawn and its just stuck can u fix it u should make a function that open the menu to what to promote and then clike but this is only my opinion

unknown_2023.06.29-18.02.mp4

eror

when i lunce the file in the cmd the chrom opening with the website but then it just stuck on the start manu and when i prees start nothing happen this is the eror:

C:\Users\Ori\scripts\Chesscup-hack-main\Chesscup-hack-main>node script.js
Applicable driver not found; attempting to install with Selenium Manager (Beta)
The version of chrome cannot be detected. Trying with latest driver version

DevTools listening on ws://127.0.0.1:63913/devtools/browser/7342b37a-878c-478c-be00-d9aa3c09ffb5
[2772:21212:0628/195129.494:ERROR:cert_issuer_source_aia.cc(34)] Error parsing cert retrieved from AIA (as DER):
ERROR: Couldn't read tbsCertificate as SEQUENCE
ERROR: Failed parsing Certificate

C:\Users\Ori\node_modules\selenium-webdriver\lib\error.js:524
let err = new ctor(data.message)
^

ElementNotInteractableError: element not interactable
(Session info: chrome=114.0.5735.198)
at Object.throwDecodedError (C:\Users\Ori\node_modules\selenium-webdriver\lib\error.js:524:15)
at parseHttpResponse (C:\Users\Ori\node_modules\selenium-webdriver\lib\http.js:601:13)
at Executor.execute (C:\Users\Ori\node_modules\selenium-webdriver\lib\http.js:529:28)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Driver.execute (C:\Users\Ori\node_modules\selenium-webdriver\lib\webdriver.js:745:17)
at async init (C:\Users\Ori\scripts\Chesscup-hack-main\Chesscup-hack-main\script.js:110:3)
at async main (C:\Users\Ori\scripts\Chesscup-hack-main\Chesscup-hack-main\script.js:224:3) {
remoteStacktrace: 'Backtrace:\n' +
'\tGetHandleVerifier [0x011DA813+48355]\n' +
'\t(No symbol) [0x0116C4B1]\n' +
'\t(No symbol) [0x01075220]\n' +
'\t(No symbol) [0x010A1846]\n' +
'\t(No symbol) [0x01099F5C]\n' +
'\t(No symbol) [0x010BA73C]\n' +
'\t(No symbol) [0x01099A36]\n' +
'\t(No symbol) [0x010BAA94]\n' +
'\t(No symbol) [0x010CC922]\n' +
'\t(No symbol) [0x010BA536]\n' +
'\t(No symbol) [0x010982DC]\n' +
'\t(No symbol) [0x010993DD]\n' +
'\tGetHandleVerifier [0x0143AABD+2539405]\n' +
'\tGetHandleVerifier [0x0147A78F+2800735]\n' +
'\tGetHandleVerifier [0x0147456C+2775612]\n' +
'\tGetHandleVerifier [0x012651E0+616112]\n' +
'\t(No symbol) [0x01175F8C]\n' +
'\t(No symbol) [0x01172328]\n' +
'\t(No symbol) [0x0117240B]\n' +
'\t(No symbol) [0x01164FF7]\n' +
'\tBaseThreadInitThunk [0x769700C9+25]\n' +
'\tRtlGetAppContainerNamedObjectPath [0x77497B4E+286]\n' +
'\tRtlGetAppContainerNamedObjectPath [0x77497B1E+238]\n'
}

Node.js v20.3.1

error(alr did .env thing)

DevTools listening on ws://127.0.0.1:59357/devtools/browser/e5264760-a92f-4daf-bc64-38f33d107b80
[4984:26712:0628/215833.675:ERROR:device_event_log_impl.cc(222)] [21:58:33.675] USB: usb_service_win.cc:415 Could not read device interface GUIDs: The system cannot find the file specified. (0x2)
C:\Users*****\node_modules\selenium-webdriver\lib\webdriver.js:929
new error.TimeoutError(
^

TimeoutError: Waiting for element to be located By(xpath, //[@id="testpng"]/div[1]/div/div[1]/div[2]/div[3])
Wait timed out after 15132ms
at C:\Users****\node_modules\selenium-webdriver\lib\webdriver.js:929:17
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
remoteStacktrace: ''
}

do i need to have brave browser?

i tried running script.js using node.js(i have dotnev and selenium-webdriver) and it says this:
WebDriverError: unknown error: no chrome binary at /Applications/Brave Browser.app/Contents/MacOS/Brave Browser
at Object.throwDecodedError (C:\Users*\node_modules\selenium-webdriver\lib\error.js:524:15)
at parseHttpResponse (C:\Users*
\node_modules\selenium-webdriver\lib\http.js:601:13)
at Executor.execute (C:\Users*****\node_modules\selenium-webdriver\lib\http.js:529:28)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
remoteStacktrace: 'Backtrace:\n' +
'\tGetHandleVerifier [0x0094A813+48355]\n' +
'\t(No symbol) [0x008DC4B1]\n' +
'\t(No symbol) [0x007E5358]\n' +
'\t(No symbol) [0x00801A33]\n' +
'\t(No symbol) [0x00800579]\n' +
'\t(No symbol) [0x00830C55]\n' +
'\t(No symbol) [0x0083093C]\n' +
'\t(No symbol) [0x0082A536]\n' +
'\t(No symbol) [0x008082DC]\n' +
'\t(No symbol) [0x008093DD]\n' +
'\tGetHandleVerifier [0x00BAAABD+2539405]\n' +
'\tGetHandleVerifier [0x00BEA78F+2800735]\n' +
'\tGetHandleVerifier [0x00BE456C+2775612]\n' +
'\tGetHandleVerifier [0x009D51E0+616112]\n' +
'\t(No symbol) [0x008E5F8C]\n' +
'\t(No symbol) [0x008E2328]\n' +
'\t(No symbol) [0x008E240B]\n' +
'\t(No symbol) [0x008D4FF7]\n' +
'\tBaseThreadInitThunk [0x752A00C9+25]\n' +
'\tRtlGetAppContainerNamedObjectPath [0x76EC7B4E+286]\n' +
'\tRtlGetAppContainerNamedObjectPath [0x76EC7B1E+238]\n'
}
so my question is, do i have to install brave browser for the file to work?

pls send this code as the comment but put the word here in the place that i need to put the email and the password and the username if needed

this is my code its open my chrome and everything good but it dosent log in:

var webdriver = require("selenium-webdriver");
var chrome = require("selenium-webdriver/chrome");
require("dotenv").config();

var binaryPath = "C:\Program Files\Google\Chrome\Application\chrome.exe";

let setup = () => {
cheaty = function () {
chessDiv = document.querySelector("#tsk > div");
const properties = Object.keys(chessDiv);
propsKey = properties[0];
const chessMoves = chessDiv[propsKey].return.memoizedState.moves[0];
if (chessMoves.length === 0) return;
const chessHistory = chessDiv[propsKey].return.memoizedState.historyy;
// console.log("move #", chessHistory.length);
moves = [];
for (let i = chessHistory.length; i < chessMoves.length; i++) {
if (i % 2 == 0) {
moves.push(chessMoves[i]);
}
}
console.log(moves.join(","));
return moves;
};
};
let makeMove = async (move, driver) => {
const start = move.substring(0, 2);
const end = move.substring(2);

const pieces = await driver.findElements(
webdriver.By.css("#dirty > div > piece")
);

let startPiece;
for (const x of pieces) {
const sq = await x.getAttribute("cgKey");
if (sq === start) {
startPiece = x;
break;
}
}
console.log("TODO", start, end);

await driver
.actions()
.move({ origin: startPiece })
.press()
.release()
// .pause(200)
.perform();

console.log("clicked 1:", start);

const squares = await driver.findElements(
webdriver.By.css("#dirty > div > square")
);
let endPiece;
for (const x of squares) {
const sq = await x.getAttribute("cgKey");
if (sq === end) {
endPiece = x;
break;
}
}

await driver
.actions()
.move({ origin: endPiece })
.press()
.release()
// .pause(300)
.perform();

console.log("clicked 2:", end);
};
let solvePuzzle = async (moves, driver) => {
for (const move of moves) {
await makeMove(move, driver);
}
};
const init = async () => {
const options = new chrome.Options().setBinaryPath(binaryPath);
// options.add_argument('--headless')
// .addExtensions(getRequestlyExtension("chrome"));

driver = await new webdriver.Builder()
.forBrowser("chrome")
.setChromeOptions(options)
.build();
// await driver.manage().setTimeouts({ implicit: 10 });

// await importRequestlySharedList(driver, URL);

await driver.get("https://chesscup.org/");

//__reactInternalInstance$qvgh4exfuap.return.memoizedState.moves
//__reactInternalInstance$q1w5d6zgodd.return.memoizedState.moves[0]
//#tsk > div
///html/body/div/div[2]/div[2]/div/div
//document.querySelector("#tsk > div")
//__reactInternalInstance$2vt6opizec
// //[@id="dirty"]/div
//
[@id="dirty"]/div
// board --> /html/body/div/div[2]/div[2]/div/div/div[1]/div[1]/div/div/div[1]/div
// card --> /html/body/div/div[2]/div[2]/div/div/div[1]/div[1]/div/div[1]
// skip --> //*[@id="tsk"]/div/div[1]/div[2]/div/div[3]/div/span
// pieces --> #dirty > div > piece

//dark mode //[@id="darkModeToggler"]
await driver.findElement(webdriver.By.xpath('//
[@id="darkModeToggler"]')).click();

//LOGIN //[@id="navbarSupportedContent"]/ul[2]/li[4]/a
const user = process.env.USERNAME;
const password = process.env.PASSWORD;
await driver
.findElement(
webdriver.By.xpath('//
[@id="navbarSupportedContent"]/ul[2]/li[4]/a')
)
.click();

await driver.wait(
webdriver.until.elementLocated(webdriver.By.xpath('//[@id="inputEmail"]')),
15000
);
// userbox //
[@id="inputEmail"]
await driver
.findElement(webdriver.By.xpath('//[@id="inputEmail"]'))
.sendKeys(user);
// passbox //
[@id="inputPassword"]
await driver
.findElement(webdriver.By.xpath('//[@id="inputPassword"]'))
.sendKeys(password);
// enter //
[@id="wrp"]/div[2]/div[2]/form/button
await driver
.findElement(webdriver.By.xpath('//*[@id="wrp"]/div[2]/div[2]/form/button'))
.click();

await driver.executeScript(setup);

await driver.wait(
webdriver.until.elementLocated(
webdriver.By.xpath('//*[@id="testpng"]/div[1]/div/div[1]/div[2]/div[3]')
),
15000
);

const mode = process.env.MODE;
if (mode === "0") {
// 3 mins
await driver
.findElement(
webdriver.By.xpath('//[@id="testpng"]/div[1]/div/div[1]/div[2]/div[1]')
).click();
} else if (mode === "1") {
// 5 mins
await driver
.findElement(
webdriver.By.xpath('//
[@id="testpng"]/div[1]/div/div[1]/div[2]/div[2]')
)
.click();
} else if (mode === "2") {
// survival
await driver
.findElement(
webdriver.By.xpath('//*[@id="testpng"]/div[1]/div/div[1]/div[2]/div[3]')
)
.click();
}

// Start
await driver
.findElement(
webdriver.By.xpath('//*[@id="testpng"]/div[1]/div/div[2]/div/button')
)
.click();

// Wait for board to load
await driver.wait(
webdriver.until.elementLocated(
webdriver.By.xpath('//*[@id="tsk"]/div/div[1]/div[2]/div/div[3]/div/span')
),
15000
);
};

const solveAway = async () => {
// const board = await driver.findElement(webdriver.By.xpath('#dirty > div'))
myMoves = [];

const cdpConnection = await driver.createCDPConnection("page");
await driver.onLogEvent(cdpConnection, (event) => {
const res = event["args"][0]["value"];
console.log("received", res);
myMoves = res.split(",");
});

for (let i = 0; true; i++) {
console.log("PUZZLE:", i + 1);

try {
  await driver.executeScript("return cheaty()");
  console.log("cheaty done...");

  await driver.wait(() => {
    return myMoves.length > 0;
  }, 1000);
  await makeMove(myMoves[0], driver);
  console.log("moves received...");

  // await solvePuzzle(myMoves, driver);
  console.log("puzzle solved");
} catch (e) {
  console.error("Error:", e);
  await driver.executeScript(setup);
}
myMoves = [];
await driver.actions().clear();
console.log("actions cleared");

}

// await driver.quit();
}
const main = async () => {
await init();
await solveAway();
};

module.exports = main();

i have everything needed but after running the file with node it has an error

after i run the file it opens chrome in chesscup.org but it doesnt do anything and in cmd shows this error:
[11784:8416:0628/135017.009:ERROR:device_event_log_impl.cc(222)] [13:50:17.008] USB: usb_service_win.cc:415 Could not read device interface GUIDs: The system cannot find the file specified. (0x2)
help please

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.