xabbo-scripts/Scripts/Minter.csx
Administrator 7a548130a3 Move all scripts into Scripts/ subfolder
Keeps the repo root clean - only README.md visible on landing page.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 09:49:37 +01:00

81 lines
2.5 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Diagnostics;
using System.Threading.Tasks;
const string PRIVATE_KEY = "PRIVATE_KEY_HERE";
const int MINT_AMOUNT = 50;
const int QUANTITY = 3;
async Task MintEmeralds() {
try {
var nodeScript = $@"
const {{ ethers }} = require('ethers');
const axios = require('axios');
const {{ keccak256 }} = require('eth-lib/lib/hash');
const PRIVATE_KEY = '{PRIVATE_KEY}';
const MINT_AMOUNT = {MINT_AMOUNT};
const QUANTITY = {QUANTITY};
async function mintEmeralds() {{
try {{
const wallet = new ethers.Wallet(PRIVATE_KEY);
console.log('Wallet address:', wallet.address);
const now = new Date().toISOString();
const hashInput = [wallet.address, ""secret"", MINT_AMOUNT, QUANTITY, now].join(""-"");
const hash = keccak256(hashInput);
const fullMessage = ""Sign this message if youre minting NFT credit furni from nft.habbo.com"" + "" - Signature: "" + hash;
const signature = await wallet.signMessage(fullMessage);
console.log('Hash:', hash);
console.log('Signature:', signature);
const response = await axios.post('https://collectibles.habbo.com/api/tokens/mint/', null, {{
params: {{
account: wallet.address,
credits: MINT_AMOUNT,
amount: QUANTITY,
timestamp: now,
signature: signature
}}
}});
console.log('Success! Response:', JSON.stringify(response.data));
if (response.data.successTokens > 0) {{
console.log('SUCCESS:' + response.data.successTokens);
}}
}} catch (error) {{
console.error('Error:', error.message);
}}
}}
mintEmeralds();
";
System.IO.File.WriteAllText(@"C:\Users\QDave\Desktop\MintEmeralds\temp_mint.js", nodeScript);
var process = new Process {
StartInfo = new ProcessStartInfo {
FileName = "node",
Arguments = @"C:\Users\QDave\Desktop\MintEmeralds\temp_mint.js",
UseShellExecute = false,
RedirectStandardOutput = true,
CreateNoWindow = true
}
};
process.Start();
Send(Out["NftStorePurchase"], "nft_h23_vintaque_stool_r","0x0f15b8c36c04ee31303299764c9ba63c38b0a6a6");
var output = await process.StandardOutput.ReadToEndAsync();
process.WaitForExit();
Log(output);
if (output.Contains("SUCCESS:")) {
Shout("✅ Successfully minted emerald NFT(s)!");
}
} catch (Exception error) {
Log($"Error: {error.Message}");
}
}
await MintEmeralds();
Wait();