Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wiki gear images #6181

Closed
wants to merge 5,691 commits into from
Closed

Wiki gear images #6181

wants to merge 5,691 commits into from

Conversation

gc
Copy link
Collaborator

@gc gc commented Nov 8, 2024

Description:

Changes:

Other checks:

  • I have tested all my changes thoroughly.

Copy link

Deploying oldschoolbot with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1fc83b6
Status: ✅  Deploy successful!
Preview URL: https://040e3546.oldschoolbot.pages.dev
Branch Preview URL: https://wiki-gear-images.oldschoolbot.pages.dev

View logs

@@ -1,9 +1,10 @@
import { readFileSync, writeFileSync } from 'node:fs';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using fs.promises.readFile and fs.promises.writeFile for non-blocking I/O operations.

Suggested change
import { readFileSync, writeFileSync } from 'node:fs';
import { promises as fs } from 'node:fs';

await writeFile(`./docs/public/images/gear/${imageKey}.png`, image as any);
console.log(`Generated ${imageKey} gear image`);
}
console.log("x");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unnecessary console logs to clean up the code.

Suggested change
console.log("x");

console.log("z");
wtf.dump();
process.exit(0);
wtf.dump();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the redundant wtf.dump() call after process.exit(0) as it will never be executed.

Suggested change
wtf.dump();

const gear = new Gear();
for (const id of itemIDs) gear.equip(getOSItem(id));
const image = await generateGearImage(
{ user: { bankBackground: 1 }, farmingContract: () => null } as any,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using any type casting. Use a more specific type or interface for better type safety.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.