-
-
Save dvgamerr/5a8c0703abeff561c5838e2a47a8523d to your computer and use it in GitHub Desktop.
บอทปั้มเงิน TLM เกม Alien Worlds (เงินจะเอาไปแลกเงินจริงใน Binance ได้) ไว้ทดสอบเฉย ๆ อย่าเอาไปใช้จริง คนเขียนไม่รับผิดชอบต่อบั๊กใด ๆ ทั้งสิ้น
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// บอทปั้มเงิน TLM เกม Alien Worlds (เงินจะเอาไปแลกเงินจริงใน Binance ได้) | |
// ไว้ทดสอบเฉย ๆ อย่าเอาไปใช้จริง คนเขียนไม่รับผิดชอบต่อบั๊กใด ๆ ทั้งสิ้น | |
// | |
// วิธีใช้: | |
// 1. สมัคร + เข้า https://play.alienworlds.io/ | |
// 2. ต้องเคย mine แบบ manual ก่อน 1 ครั้ง | |
// 3. ก๊อปสคริปท์นี้ไปแปะใน Console (F12) | |
// น่าจะมีบั๊กพวก rate limit อะไรทั้งหลาย กับ if/loop บางอันเอาออกได้ | |
// ลองรันเล่น ๆ 5 ชม จาก user เปล่า ๆ ได้มา 8 TLM (ขึ้นกับดวงและอื่นๆด้วยมั่ง) | |
// ใครว่าง ๆ แก้เป็นยิงเข้า API โดยตรงไม่ผ่าน JS น่าจะเสถียรกว่าเยอะมาก | |
// อย่ากดอะไร ระหว่าง ที่กำลังขุด | |
// Version 1.0 | |
var cancel = false; | |
var account = null; | |
delay = ms => new Promise(resolve => setTimeout(_ => resolve(), ms)) | |
MineLogin = async () => { | |
console.log('## login...', ) | |
account = await wax.login(); | |
console.log(`## unity login ${account} server...`); | |
unityInstance.SendMessage('Controller', 'Server_Response_LoginData', account); | |
} | |
MineCancel = () => { | |
cancel = true | |
console.log('## mine canceling...'); | |
} | |
// CHECK Delay MINE | |
NextMine = async () => { | |
let minedelay = 1; | |
do { | |
minedelay = await getMineDelay(account); | |
if (minedelay > 0) console.log('## mine delay', (minedelay / 1000 / 60).toFixed(2), 'm.') | |
await delay(minedelay + 5000); | |
} while (minedelay !== 0) | |
console.log('## mine ready...'); | |
} | |
Mining = async () => { | |
console.log(`## rebalance: ${await getBalance(account, wax.api.rpc)}`); | |
let mine_work = await background_mine(account) | |
console.log(`## unity pushing ${mine_work.account} mine results...`); | |
unityInstance.SendMessage('Controller', 'Server_Response_Mine', JSON.stringify(mine_work)); | |
const mine_data = { miner: mine_work.account, nonce: mine_work.rand_str }; | |
const actions = [{ | |
account: mining_account, name: 'mine', | |
authorization: [{actor: mine_work.account, permission: 'active'}], | |
data: mine_data | |
}]; | |
// console.group('wax mining') | |
console.log('## wax transact', actions); | |
try { | |
console.log('## wax mining...'); | |
const result = await wax.api.transact({ actions }, { blocksBehind: 3, expireSeconds: 90, }) | |
console.log('## wax result', result); | |
if (!result || !result.processed) return | |
let amounts = new Map(); | |
for (const at of result.processed.action_traces) { | |
for (const it of at.inline_traces) { | |
const mine_amount = it.act.data.quantity; | |
if (!mine_amount) continue | |
console.log(`## wax ${mine_work.account} Mined ${mine_amount}`); | |
if (amounts.has(it.act.data.to)) { | |
let obStr = amounts.get(it.act.data.to); | |
obStr = obStr.substring(0, obStr.length - 4); | |
let nbStr = it.act.data.quantity; | |
nbStr = nbStr.substring(0, nbStr.length - 4); | |
let balance = (parseFloat(obStr) + parseFloat(nbStr)).toFixed(4); | |
amounts.set(it.act.data.to, balance.toString() + ' TLM'); | |
} else { | |
amounts.set(it.act.data.to, it.act.data.quantity); | |
} | |
} | |
} | |
console.log(`## unity response ${mine_work.account} claim...`); | |
unityInstance.SendMessage('Controller', 'Server_Response_Claim', amounts.get(mine_work.account)); | |
} catch (err) { | |
console.log(`## unity response ${mine_work.account} mine error...`); | |
console.error(err); | |
unityInstance.SendMessage('ErrorHandler', 'Server_Response_SetErrorData', err.message); | |
console.log('## mine sleeping 20s.') | |
await delay(20000) | |
} finally { | |
// console.groupEnd('wax mining') | |
console.log(`## finally balance: ${await getBalance(account, wax.api.rpc)}`); | |
} | |
} | |
await MineLogin() | |
await delay(15000) | |
while (true) { | |
await NextMine() | |
if (cancel) { | |
console.log('## mine close.') | |
break | |
} | |
await delay(5000) | |
await Mining() | |
if (cancel) { | |
console.log('## mine close.') | |
break | |
} | |
await delay(10000) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
มันจะยิงไป api ประมาณไหนอะครับ มองภาพยังไม่ออก