CAPTCHAFORUM
Administrator
What is Runescape Account Creator?
Runescape Account Creator is an implementation in JavaScript for Node.js that provides the ability to create accounts for the video game RuneScape®.
Installation
Install via npm:
Usage
The request is Promise based therfore we call .then() in order to access the response once it has been recieved.
First we will build a new AccountCreator instance with our 2Captcha API key
Async/Await
Since we are using Promises, we can make use of async/await if your JavaScript runtime allows for it, or you are using a transpiler that supports code generation for async/await.
See examples.js for more examples.
Documentation https://www.npmjs.com/package/runescape-account-creator
Runescape Account Creator is an implementation in JavaScript for Node.js that provides the ability to create accounts for the video game RuneScape®.
Installation
Install via npm:
npm install runescape-account-creator
Usage
The request is Promise based therfore we call .then() in order to access the response once it has been recieved.
First we will build a new AccountCreator instance with our 2Captcha API key
Code:
// Import the factory function for the AccountCreator
const { buildAccountCreator } = require('runescape-account-creator')
// Update the API key used to match your 2captcha.com API key
const twoCaptchaApiKey = 'YOUR_TWO_CAPTCHA_API_KEY'
const accountCreator = buildAccountCreator(twoCaptchaApiKey)
// Now we can start registering accounts!
accountCreator.register().then(response => {
// destructure the response
const { credentials, birthday } = response
console.log('We made a new account with these credentials:', credentials)
console.log('The birthday of the account is', birthday)
console.log('The User-Agent header we sent was:', response.meta.userAgent)
}).catch(error => {
console.error(error)
})
Async/Await
Since we are using Promises, we can make use of async/await if your JavaScript runtime allows for it, or you are using a transpiler that supports code generation for async/await.
Code:
// Fat-arrow function
const registerAccount = async creator => await creator.register()
// traditional async function
async function singleRegistration (accountCreator) {
return await accountCreator.register()
}
async function serialBatchRegistration (accountCreator) {
const accounts = []
for (let i = 1; i <= 10; i++) {
console.log('Registering account', i)
// this is where the syntax magic happens
const { credentials, birthday } = await accountCreator.register()
console.log(`Account was registered! ${credentials.email}:${credentials.password} with birthday ${birthday}`)
accounts.push(account)
}
return accounts
}
See examples.js for more examples.
Documentation https://www.npmjs.com/package/runescape-account-creator