Answer the question
In order to leave comments, you need to log in
How to teach to read values from a block by id?
I have minimal knowledge of JS, I'm trying to write an auto-withdrawal function, if there is a def. balance on the site.
The balance sheet looks like this:
<li class="balanceli"><span id="balance">0.00525239</span> BTC</li>
if (AUTO_WITHDRAW == "ON") //Авто-вывод средств
{
if (!window.content.document.getElementById("balance"))
{
log('Выводим биткоин...');
limDisplay("Выводим биткоин...")
iret = limPlay("CODE:"+"SET !ERRORIGNORE YES"+n+"SET !TIMEOUT_PAGE 60"+n+"SET !TIMEOUT_STEP 10"+n+"TAB CLOSEALLOTHERS"+n+"TAB T=1"+n+"URL GOTO=https://freebitco.in"+n+"WAIT SECONDS=10"+n)
var accountBTC = Number(window.content.document.getElementById("balance")[0].innerHTML.replace(',',''));
if (accountBTC < 0.00002)
{
//NO OPERATION
}
else if ((accountBTC >= 0.00002))
{
iret = limPlay("CODE:"+"SET !ERRORIGNORE YES"+n+"SET !TIMEOUT_STEP 10"+n+"TAG POS=1 TYPE=BUTTON ATTR=TXT:WITHDRAW+n+WAIT SECONDS=3"+n+"TAG POS=2"+n);
}
}
}
Answer the question
In order to leave comments, you need to log in
For mathematical operations on currencies, either special libraries or integers are used, not floating point numbers.
> 31.01+1
< 32.010000000000005
> 31.02+1
< 32.019999999999996
> 9007199254740993
< 9007199254740992
Oh oh oh. This is not the front should do, but the back. Otherwise you can get XSS.
And about the correctness - check what your limPlay is doing and run it through console.log - what do you have in the variables there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question