-
-
Save leovicio/11594965de99f155037c18dfd38b69d8 to your computer and use it in GitHub Desktop.
This file contains 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 น่าจะเสถียรกว่าเยอะมาก | |
const delay = millis => new Promise((resolve, reject) => { | |
setTimeout(_ => resolve(), millis) | |
}); | |
const userAccount = await wax.login(); | |
account = userAccount; | |
unityInstance.SendMessage('Controller', 'Server_Response_LoginData', userAccount); | |
await delay(10000); | |
while(true){ | |
var firstMine = true; | |
var previousMineDone = false; | |
var minedelay = 1; | |
do { | |
minedelay = await getMineDelay(account); | |
await delay(minedelay); | |
} while (minedelay !== 0 && (previousMineDone || firstMine)) | |
console.log('just mine it!'); | |
var balance = await getBalance(account, wax.api.rpc); | |
console.log('balance: (before mine)'+balance); | |
await background_mine(account).then((mine_work)=>{ | |
unityInstance.SendMessage('Controller', 'Server_Response_Mine', JSON.stringify(mine_work)); | |
console.log(`${mine_work.account} Pushing mine results...`); | |
const mine_data = { | |
miner: mine_work.account, | |
nonce: mine_work.rand_str, | |
}; | |
console.log('mine_data', mine_data); | |
const actions = [{ | |
account: mining_account, | |
name: 'mine', | |
authorization: [{ | |
actor: mine_work.account, | |
permission: 'active', | |
}, ], | |
data: mine_data, | |
}, ]; | |
wax.api.transact({ | |
actions, | |
}, { | |
blocksBehind: 3, | |
expireSeconds: 90, | |
}).then((result)=>{ | |
console.log('result is=', result); | |
var amounts = new Map(); | |
if (result && result.processed) { | |
result.processed.action_traces[0].inline_traces.forEach((t)=>{ | |
if (t.act.data.quantity) { | |
const mine_amount = t.act.data.quantity; | |
console.log(`${mine_work.account} Mined ${mine_amount}`); | |
if (amounts.has(t.act.data.to)) { | |
var obStr = amounts.get(t.act.data.to); | |
obStr = obStr.substring(0, obStr.length - 4); | |
var nbStr = t.act.data.quantity; | |
nbStr = nbStr.substring(0, nbStr.length - 4); | |
var balance = (parseFloat(obStr) + parseFloat(nbStr)).toFixed(4); | |
amounts.set(t.act.data.to, balance.toString() + ' TLM'); | |
} else { | |
amounts.set(t.act.data.to, t.act.data.quantity); | |
} | |
} | |
} | |
); | |
unityInstance.SendMessage('Controller', 'Server_Response_Claim', amounts.get(mine_work.account)); | |
firstMine = false; | |
previousMineDone = true; | |
} | |
} | |
).catch((err)=>{ | |
unityInstance.SendMessage('ErrorHandler', 'Server_Response_SetErrorData', err.message); | |
previousMineDone = false; | |
} | |
); | |
} | |
); | |
var balance = await getBalance(account, wax.api.rpc); | |
console.log('balance (after mined): '+balance); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment