#development

1 messages · Page 133 of 1

lyric mountain
#

just a thing, I'd name that function start instead of buttons, as you're starting a new game

#

and this will likely error, so make sure to remove it

#

you're already inside Game

#

and inside buttons

north cairn
wheat mesa
#

The classic StackOverflowException

lyric mountain
#

nononono, make different functions if u must

wheat mesa
#

(Or whatever it’s called in node)

lyric mountain
#

but not different classes

north cairn
lyric mountain
#

classes can have as many functions as u want

wheat mesa
#

Usually classes have more than one method

north cairn
#

u mean that one class througout the game with methods as steps

#

right?

lyric mountain
#

u can yeah

north cairn
#

what u guys prefer

lyric mountain
#

the code inside them will not be ran until you call the method

north cairn
#

one class diff methods or diff class

wheat mesa
#

One class different methods

hushed robin
#

btw guys

wheat mesa
#

More than one class is starting to defeat the purpose of using classes in this situation

lyric mountain
#

a class should be a representation of an entity

#

like, you have a game, so it's an entity

north cairn
#

and do i make seperate files for methods

hushed robin
#

can i separate my functions from my class but still run it on it

lyric mountain
#

the game can have many stages, but it's still the same game

north cairn
lyric mountain
hushed robin
wheat mesa
north cairn
wheat mesa
#

But that starts to defeat the purpose of OOP classes

hushed robin
#

but what if i have complex ones

#

one file will look cluttered

wheat mesa
#

I need more context here

lyric mountain
#

it's best to have a cluttered file than a cluttered project

wheat mesa
#

Some files will be large if your class is large and has a lot of functionality

north cairn
wheat mesa
#

It should only be responsible for one “thing” usually, that’s one of the pillars of OOP

hushed robin
lyric mountain
#

if they're methods for your game, put in your game

north cairn
wheat mesa
lyric mountain
#

imagine Game is a bookcase

#

and every method is a book

hushed robin
#

if they were long

lyric mountain
#

if the book belongs to Game, put in game

wheat mesa
#

You cannot separate class definitions to multiple files

lyric mountain
hushed robin
wheat mesa
#

You can extend a class, but that’s different

lyric mountain
#

and this is not the full file

hushed robin
#

😐

#

how many lines is that

wheat mesa
#

That’s just how it is

north cairn
hushed robin
#

fr

#

🤣

lyric mountain
wheat mesa
#

It’s not a bad thing either, you just have to get used to it

lyric mountain
#

but I couldn't put that code outside of that file even if I wanted to

#

because they're meaningless outside of it

hushed robin
lyric mountain
#

and will only be used on that specific file

wheat mesa
#

That’s why methods exist, so that you can keep classes organized

#

Even in long ones

lyric mountain
#

every method is an action, which gets called based on user input

hushed robin
#

that for a card game???

#

🫠

lyric mountain
#

so it's naturally long

north cairn
#

ok so
create diff files for diff methods by exporting and importing class
and then create a file for full game run all methods

wheat mesa
#

The logic for card games is pretty complex sometimes

north cairn
#

or create a big file having all methods and call it there only

north cairn
lyric mountain
north cairn
#

kekw

lyric mountain
#

that code doesn't include the renderer

lyric mountain
#

renderer is somewhat smaller

north cairn
wheat mesa
#

There is a main class somewhere within minecraft though, every program needs an entry point

lyric mountain
# north cairn ?

again, if those methods belong to that class, put in that class

wheat mesa
#

It still has a main class internally somewhere

north cairn
lyric mountain
#

if those methods only have a meaning for that game, you can just put inside game class

wheat mesa
#

The JVM needs a method signature of public static void main(String[]) somewhere in the bytecode

hushed robin
#

is this a discord bot?

north cairn
#

or sperate

lyric mountain
wheat mesa
#

Which means there is a class of some sort within MC that has that signature

hushed robin
#

woah

#

thats cool

north cairn
#

wtf how is that a dc bot

#

i hought its app

lyric mountain
wheat mesa
#

Just wait until you see his Helper.java file

north cairn
wheat mesa
#

🧌

north cairn
lyric mountain
north cairn
#

u darkless

#

u ruthless

#

💀

#

ok bye

lyric mountain
#

players use commands to manipulate the board during their turn

hushed robin
#

whats the short form of spanish

lyric mountain
#

like place a card, equip, use a spell, etc

hushed robin
#

like two characters

lyric mountain
#

u mean the locale id?

#

it's es

hushed robin
#

oh yeah thx

lyric mountain
#

for reference, there's a list for that

#

ISO 639 is a standardized nomenclature used to classify languages. Each language is assigned a two-letter (639-1) and three-letter (639-2 and 639-3) lowercase abbreviation, amended in later versions of the nomenclature.
This table lists all of:

ISO 639-1: two-letter codes, one per language for ISO 639 macrolanguageAnd some of:

ISO 639-2/T: thr...

slender wagon
#

so i have tried almost all file extensions that might support transparency but nothing has been successful

lyric mountain
#

for animation?

slender wagon
#

the closest i got was with gif which guess what had no transparency

#

yes i am using canvas

#

i tried apng webp

lyric mountain
#

where do u want to put the image?

#

like, where will it be shown?

slender wagon
#

the image has to be set the first then over it a transparent animation

#

i don't care about the extention

lyric mountain
#

I mean the final image

#

is it for a website?

slender wagon
#

nope

#

the final can be any extension as long as it has transparency

#

the user will get it via telegram where they can download it

#

it's a watermark bot

lyric mountain
#

why didn't apng work?

#

u didn't find a lib for it?

slender wagon
#

didn't find any package

#

yes

#

sorry english broki

#

the only one i found supported browser only

#

apng-js

#

or smthn

lyric mountain
slender wagon
#

oh shit

lyric mountain
slender wagon
#

are these not npm's

lyric mountain
#

worth to search on npm to see if any pops

slender wagon
#
#

do you think it's possible to get it to work with canvas

lyric mountain
#

you'll be editing the frames individually

slender wagon
#

so i guess that's alot of processing power

lyric mountain
#

use canvas for making the frames and then pack it up with upng

lyric mountain
#

even if there was a lib that "did" that, it'd internally separate the frames

slender wagon
#

alright

#

so basically i will need to seperate all the frames of a apng

#

the elephant one has like 20 or 30

lyric mountain
#

separate, add overlay, put somewhere for later use

slender wagon
#

oh so i can cache ittt

lyric mountain
#

after u finish all frames, pack it up

slender wagon
#

since i will be using the same one

lyric mountain
#

yep

slender wagon
#

would a json work

lyric mountain
#

how would u store an image in a json?

#

b64?

slender wagon
lyric mountain
#

just put it in a const and do your stuff

#

after u finish it'll be cleared automatically as u left the scope

slender wagon
#

the thing is i don't wanna fetch the frames all the time when a user inserts a new image

#

anyway that's for later i will try to get it working first

#

Talking about that since telegram api's has a close timeout

lyric mountain
#

use a self-expiring map to store the image bytes (buffer)

slender wagon
#

alrightys

solemn latch
#

it should 👀

#

Its a seperate event

#

😔 I just wrote so much code and I dont like it angeryBOYE

#

Just going to delete it and restart. Wasted 6 hours today ^-^

#

Thanks

#

If there was a job to waste time I would be the best at it.

#

Especially if it was to look like I'm doing something useful

hushed robin
#

idk

#

JavaScript is a good language

slender wagon
#

regarding the apng project i kind of got it to work but all the frames it encodes seem very transparent

#

aka there is nothing on them

#

💀

#

the data looks fine

#

if it is the libs issue

#

i am gonna go fucking crazy

#

before the decoding

lyric mountain
#

also, windows doesn't assign a default app for apng

#

that's why it shows the default thumbnail

#

it's just lua that's weird

slender wagon
lyric mountain
#

weird, try seeing if u didn't miss anything

#

also, to test it try dragging to the browser

wheat mesa
#

Because lua is an awful language

#

Can’t change my mind

hushed robin
lyric mountain
#

using something doesnt means it's good

#

also there are quite a few languages that work well as embedded languages and don't give too much access to the scripter

#

which is likely why they chose lua

hushed robin
#

Roblox has millions of concurrent players

#

so if Lua can do allat I think it’s good

lyric mountain
#

it has millions of conc players, but lua's not running millions of times

#

you forget the each lua script is ran in its own context

#

the game is not made in lua, only the scripts

spark flint
#

The largest discord bot uses Python, doesn’t mean it’s good

lyric mountain
#

in the same way that my bot is in java, but my cards are executed in groovy

#

doesn't mean I made my bot in groovy

hushed robin
#

So are you saying Python and Lua are both bad languages?

lyric mountain
#

they're good for their own niches

#

lua is good if you need an embedded lang an restrict access to the scripter

#

because you can setup your own sandbox and choose what the scripter can use

hushed robin
#

guys

#

how do I make an npm package

slender wagon
lyric mountain
#

what did this output?

frosty gale
lyric mountain
#

I mean, it wasn't created to be a main language anyway

hushed robin
#

nah

#

idk

lyric mountain
#

yes it is hard to make one

hushed robin
#

idk

#

listen to KuuHaKu

#

he’s smarter than me

#

can someone help with my issue tho

lyric mountain
#

the issue with obfuscators is that simply renaming identifiers and removing every space and newline isn't enough

#

because reverting it will be really easy

#

a proper obfuscator will break functions in half, transform strings into codepoints, do shmucks with formulas and code flow, etc

quartz kindle
lyric mountain
#

in a way that it barely resembles the original code even if reverted

lyric mountain
#

it is

hushed robin
#

ok

quartz kindle
#

what do you need an obfuscator for?

lyric mountain
#

making your own obfuscator is almost as hard as making your own compiler

#

wdym exploiters?

#

ik what roblox is

hushed robin
#

kuuhaku is a roblox og

#

he knows a lot about it

lyric mountain
#

but wdym exploiters? like, can they even read the scripts?

#

replicated?

#

if running foreign scripts is your concern then obfuscators will do nothing

#

that sounds like a roblox flaw tbh

#

but well, so what would obfuscators help in this case?

wheat mesa
#

Roblox has the world’s shittiest anticheat

#

If a 12 year old can make a script to cheat in a game, then the anticheat is either nonexistent or completely useless

lyric mountain
#

so when does a replication happen?

proven lantern
#

can my bot require people to have a discord role before being able to reveal spoiler text?

rustic nova
#

Nope

proven lantern
#

dang

rustic nova
#

You could theoretically do a message with components with the Text "unspoiler" and depending on the role, respond with a ephemeral message

lyric mountain
#

unspoiler lmao

frosty gale
#

thanks for the inspiration

rustic nova
#

Could probably check if the message || contains spoilers like these || and have emojis replace these according to their length

#

Pressing that unspoiler button then does that

slender wagon
#

Which seem fine

lyric mountain
frosty gale
#

i feel big header text on discord is so cursed

#

they need to keep the old way which is lower text with ability to make text bold or wiggly

#

were not making a html blog here

solemn latch
frosty gale
#

is it a blogging server?

#

uwu

#

uwu

#

uwu

#

sorry i was tinkering

slender wagon
lyric mountain
#

not sure, but from what I understood ur trying to run a client script on the server

lyric mountain
slender wagon
#

yes i see the encoding type

lyric mountain
#

just use a token

neon leaf
#

^

lyric mountain
#

no u dont

#

ah, ic

#

hm, u have no data about the sender?

#

see if u can get machine info through lua

#

like MAC address

#

or some other physical info that's not hardcoded

#

if all fails, create a site that returns your own IP

#

then make your script send a request to that site and hash the ip

#

then check (in your server) if the sender hash is in the expected list

frosty gale
#

i wonder if its possible to read the TPM on windows like the actual keys on it
no real reason just would be nice to know

lyric mountain
#

even if someone reads your code, they wont know ur ip

#

so they cant fake it

#

to be extra safe, use ipv6 instead of ipv4

#

since it's physically impossible to bruteforce it

slender wagon
#

i think i found the issue

slender wagon
#

so i saved all the canvas,

  const out = fs.createWriteStream(`canvas${i}.png`);
    const stream = canvas.createPNGStream();
    stream.pipe(out);
    out.on('finish', () => console.log(`Saved canvas ${i}.png`));
proven lantern
slender wagon
#

not sure which function is causing this

slender wagon
#

i can fix it later

proven lantern
slender wagon
#

oh lol

lyric mountain
slender wagon
#

🤓

#

shit

lyric mountain
#

lmao

proven lantern
frosty gale
#

i tried getting chatgpt to tell me but it thought i was trying to hack someones private keys on their tpm so it didnt tell me

#

when i said it was my pc it gave me some powershell script which did not work

#

the aggressive looking chinese text is making me worry

quartz kindle
#

lmao

slender wagon
#

so i just set a cleaner for the canvas just to find out the apng is static now

frosty gale
#

thanks windows

#

i think its because i have core isolation turned on

frosty gale
#

so it doesnt load any driver deemed as remotely dangerous

quartz kindle
#

rip

frosty gale
#

its also not happy i have a custom CA installed

#

i swear all of this is designed for average computer users

#

i have windows pro ffs

#

ima pro

#

wait its not even using my fucking tpm

#

i think its because i have secure boot turned off

#

which renders the tpm useless because anyone can install custom os and read the tpm

quartz kindle
#

xD

frosty gale
quartz kindle
#

huh

#

i always install windows with secure boot disabled, otherwise i cant even boot into the installer

frosty gale
#

i think it means you have to install windows with secure boot otherwise you wont be able to enable it

quartz kindle
#

and then turn it back on after installed

frosty gale
#

huh

#

maybe you can

#

i dont wanna break anything tho

hushed robin
#

why would you want your boot to be insecure

#

🤨

frosty gale
#

my bios wants me to mess with some "authorisation keys" or whatever

frosty gale
#

linux too!

hushed robin
#

btw

#

can bots stream?

solemn latch
#

no

frosty gale
hushed robin
frosty gale
#

wtf is a platform key

hushed robin
#

I wanted to make a discord soap2day

frosty gale
#

and how do i enrol one

hushed robin
#

btw does anyone know a api to download movies

hushed robin
frosty gale
#

youre going away for a long time buddy

hushed robin
#

is that a prison room

frosty gale
#

it in fact is

wheat mesa
#

Lmao an api to download movies

hushed robin
wheat mesa
#

That’s just piracy

hushed robin
#

no

frosty gale
#

lmao

hushed robin
#

I wanna download them

#

not watch

frosty gale
#

i love this server bro

wheat mesa
#

If you want to pirate something for watching it yourself that’s a slightly different conversation since it’s a legal grey area, but downloading movies for anything other than that is just straight up illegal

wheat mesa
#

For what purpose

hushed robin
#

uh

wheat mesa
#

That’s what I thought

hushed robin
#

so I can see the movies length

deft wolf
#

I heard that with movies and games, you can keep a pirated copy for a few days on your hard drive

wheat mesa
#

Ok so you don’t need to download an entire fucking movie to get the length of it

quartz kindle
# frosty gale i get this error when i try to turn it on

indian youtuber to the rescue
https://www.youtube.com/watch?v=KF2vdUnzLlg

You may see an error "System in Setup Mode, Secure Boot can be enabled when system in User mode. Repeat operation after enrolling Platform Key (PK)" while enabling the secure boot from UEFI BIOS. This happens when you change the boot mode from CSM to UEFI BIOS or the system already has some platform keys enrolled.

Step to fix System in setup mo...

▶ Play video
wheat mesa
#

That’s just a bullshit reason

frosty gale
#

the big text with the red circle

#

i just hope it wont corrupt my os install again

frosty gale
#

it happened to me once it was not fun

hushed robin
#

how else will I know the length?

wheat mesa
#

By using an API for movie info???

hushed robin
#

no

#

I need accurate info

#

from first talking scene to final talking scene

#

no credits n such

wheat mesa
#

Plus if this was a supposed solution to your issue then you’re taking possibly the most incredibly inefficient route possible

frosty gale
#

fuck it ill try it anyways

wheat mesa
#

So I don’t believe you

hushed robin
#

bruh

wheat mesa
#

I know that you’re not the sharpest tool in the shed sometimes but this is still below you

#

Come on man

hushed robin
#

😐

#

is disturbing movies illegal

wheat mesa
#

Yes

#

Extremely

#

That’ll get you a nice little visit from the FBI at some point

#

(Assuming you meant distributing)

hushed robin
frosty gale
#

thank you indian man

hushed robin
#

I was never planning on doing that I just want the accurate length

quartz kindle
#

xD

wheat mesa
#

No sane individual could think that is the proper solution for that

hushed robin
#

ok

#

☹️

slender wagon
#

I gave up i am going to bed

lyric mountain
#

Technically, the movie's true length includes credits

#

Even more for marvel movies

slender wagon
hushed robin
#

for my next project i am going to make a discord api wrapper like discord.js

slender wagon
#

There are hundreds already

lyric mountain
slender wagon
#

I deleted and redrawn in the loop

hushed robin
#

i think i am good enough to remake discord.js now

slender wagon
#

Ah

wheat mesa
frosty gale
#

that does deserve a super reaction

wheat mesa
#

I want him to work on this

#

Maybe it’ll be the project that humbles him

lyric mountain
frosty gale
lyric mountain
#

Also, if u miscode something u can end up getting the infamous 1-day ban from cloudflare

wheat mesa
slender wagon
#

Spam

frosty gale
#

no i didnt mean you mispelt it

#

humble him is just funny lmao

wheat mesa
#

Ah

hushed robin
#

pretty easy

wheat mesa
#

Bruh

lyric mountain
wheat mesa
#

That’s literally not how it works 💀

hushed robin
#

wym

wheat mesa
#

Where do you get Client from

#

It’s from discord.js

lyric mountain
#

If u mistime the limits too many times in a short frame u get a cloudflare ban

hushed robin
#

class

wheat mesa
#

Who do you think had to build that class from scratch? Discord.js did

hushed robin
#

class Client

lyric mountain
#

Also happens if u get too many 4xx errors

wheat mesa
#

Yeah well believe it or not just making a class and doing .on() isn’t a thing

hushed robin
#

I’m a professional with ratelimits

frosty gale
#

me if cloudflare bans me:

wheat mesa
#

It’s literally not

lyric mountain
wheat mesa
#

You have to define the code that emits those events

hushed robin
#

client.on("interactionCreate", interaction => {
});

wheat mesa
#

You also have to extend EventEmitter and know how that works

wheat mesa
hushed robin
#

yeah ik

wheat mesa
#

It’s hilarious how blissfully unaware you are

hushed robin
#

I just have to make a function inside of the client class called on

#

It’s not too difficult

wheat mesa
#

I don’t even think you’d figure out how to make the proper code to connect to gateway via websockets 💀

hushed robin
#

I can figure out the logicists

wheat mesa
lyric mountain
#

You won't have Client or interaction

#

Or any objects or classes whatsoever

wheat mesa
#

on is not a function that you are going to write in your class

hushed robin
#

I’ll make it

#

it’s easy

wheat mesa
#

That comes from EventEmitter

lyric mountain
#

Only thing you'll have is a json

#

Plain and raw json

hushed robin
#

I can do that

wheat mesa
#

Please do

lyric mountain
#

Do it then

slender wagon
#

At the end of the day its battleless he can do anything

wheat mesa
#

I’d love to see this crash and burn

hushed robin
#

ok

#

I will start on this project soon

wheat mesa
#

It brings me joy to see overconfidence get shattered

hushed robin
#

when I’m done my skittles

lyric mountain
#

Just remember, you only get a few shots at making your request bucket work

#

Once u hit the limit you can't continue for a day

hushed robin
#

I cban

slender wagon
hushed robin
#

can

lyric mountain
#

You can't

hushed robin
#

yea

lyric mountain
#

Cloudflare will prevent u

hushed robin
#

so

#

I will switch my ip

frosty gale
#

dont listen to them be optimistic and try your best if you fail just try again and learn from the experience

hushed robin
#

ez

frosty gale
#

prove them wrong!

lyric mountain
#

Sure, if u pay for the extra ips

wheat mesa
hushed robin
#

me and chloe are best friends

#

wym

slender wagon
#

She prolly does lol

hushed robin
#

(this is not true)

lyric mountain
#

As much as I have coded in java I still take my hat off for MinnDev

#

Couldn't imagine myself making JDA

wheat mesa
#

There's a reason we talk like this to him, he's been a dick on multiple occasions to so many trying to help him

slender wagon
#

Boy i have been working on my watermarkbot for days and i keep getting fucking stuck on stupid issues

hushed robin
#

@wheat mesa
@lyric mountain

can you make discordjs yourself?

lyric mountain
#

No

wheat mesa
#

Probably not

hushed robin
#

why not?

slender wagon
#

Cuz it requires a community to work on it

lyric mountain
#

Both time and willpower

hushed robin
#

I think u guys can

wheat mesa
#

Because it's a massive project and I have no need to make it

slender wagon
#

Or a small team

frosty gale
#

i could not be asked to remake d.js

wheat mesa
#

Plus I don't have a ton of experience with the dapi

lyric mountain
#

A lib the size of djs would take a single dev AT LEAST a year

wheat mesa
#

I've made code that connects to the gateway before, but even that was an absolute mess and hassle

hushed robin
#

bruh

wheat mesa
#

And that's the "easy" part

hushed robin
#

ok

#

what other project should I do then

#

idk what to do

slender wagon
#

Roblox

hushed robin
#

Roblox?

slender wagon
#

Go join a roblox community

hushed robin
#

I can’t remake roblox

slender wagon
#

Yes

wheat mesa
#

You should make your own discord library, since you're so confident that you can make it

#

Please

lyric mountain
#

Make a topdown space shooter

slender wagon
#

Lol

hushed robin
#

idk anything about that

lyric mountain
#

What's the difference

slender wagon
#

Make it with vanilla js if u skilled

wheat mesa
#

Make a game engine 🧌

#

trust me it's a fun project

lyric mountain
#

We made one from ground up in java

#

No game libs or anything

hushed robin
#

did u guys forget I’m a beginner

lyric mountain
#

Actually no libs at all

hushed robin
#

🤨

wheat mesa
#

java my beloved

hushed robin
slender wagon
maiden gazelle
#

Hi guys, how can i make my bot notice if someone has my bump system enabled so it would send the ad to the channel in every server that has it enabled

lyric mountain
#

Easier than space shooter

wheat mesa
lyric mountain
#

Can be done with bare array and recursion knowledge

slender wagon
quartz kindle
#

constantly says he knows everything
"guys im a beginner"

lyric mountain
#

It doesn't yeah

#

Topgg is one of the few with no bumps

slender wagon
slender wagon
#

Yes

hushed robin
#

I don’t know everything

#

I only know some

slender wagon
#

You certainly do

hushed robin
#

I don’t know how to make a snake game

#

that is outside of skill

slender wagon
#

Skill issue?

hushed robin
#

yea

slender wagon
#

Can u fix my watermark bot

#

The code is somewhere up in a text file

maiden gazelle
slender wagon
#

Oh so you are talking for your own feature

hushed robin
#

your better at coding then me I think

slender wagon
#

Afterwards make a interval to start sending the ad or whatever

slender wagon
hushed robin
outer ledge
#

Very

frosty gale
#

i still dont fully understand git

#

sometimes its just a black box

#

last time it for some reason decided to replace all my changes with an old commit on github that ive worked months on

spark flint
#

i still don't use git for all my projects lol

#

i just edit locally then unlink <file> and nano <file>

#

for some bigger projects i use git

earnest phoenix
#

I don't see anything wrong here, elaborate further, maybe

lyric mountain
#

and I don't mean anything fancy, just a text snake moving in the console eating text apples

hushed robin
#

idk how to do that

lyric mountain
#

that's the intent of making a project isn't it?

#

to learn to do something

hushed robin
#

this is beyond my skill leve

lyric mountain
#

start by learning how to write stuff on the console

hushed robin
lyric mountain
#

now learn how to clear the console

solemn latch
#

tbh, I wouldnt be 100% certain how to do it either in console.

in react though no problem 👀

#

I could figure out either though

lyric mountain
#

you just need to know how to write, clear and take input

#

clear on each frame, then "draw" the game as a grid of text

#

then just hook events on up, down, left an right key presses

#

or WASD whatsoever

hushed robin
#

Too complex

earnest phoenix
#

Did you do some kind of rebase? What commands did you run?

lyric mountain
#

it's not, can be done in less than 50 lines

hushed robin
lyric mountain
#

write, clear and input are all one-liners

#

drawing a text grid is 5 lines (2 loops + write)

#

the remaining is for the snake logic

hushed robin
#

ok

#

I’m level c skill level

#

that is level S skill level

frosty gale
#

which level is higher

hushed robin
frosty gale
#

that doesnt help

earnest phoenix
#

That's the issue

hushed robin
earnest phoenix
#

When the local repository is not synced up with upstream, it cannot cleanly push to it, so when merging changes it assumes the previous commits aren't pushed either and so that happens

#

Though this can easily be fixed with just a rebase

queen needle
# hushed robin it does

Looking at your GitHub you've done a few things which logically are harder than making a console version of snake

earnest phoenix
#

Use an interactive rebase with git rebase -i <commit hash>^ (replace <commit hash> with the commit SHA of the commit where that happened), change pick to edit on the commit where it happened, remove those changes, and keep your current changes and continue with the rebase, and finally do a force push

lyric mountain
queen needle
#

If you fear the console find something you don't fear, website, discord, anything, console is the easiest of those but

mystic pine
#

You are A Dev From Any Library @earnest phoenix

toxic yew
#

You are A Dev From Any Library @earnest phoenix

mystic pine
pale vessel
#

shut up

#

(kindly)

hushed robin
#

also read his about me 🧌

hushed robin
#

ok guys i'm starting my discord api library now

#

nvm i quit

wheat mesa
hushed robin
#

it looks easier than you expect

wheat mesa
#

Almost as if all of us told you that

hushed robin
#

true

#

but idk what else to make

#

it looked like a good thing to make

#

ok guys

#

how do i get out of a if statement

#

?

#

i'm asking for help here

#

if you don't wanna help don't help

#

🧌

#

not simple

#

i googled no good answers

wheat mesa
#

Why would you get out of an if statement? In what world would that be necessary?

#

You’re essentially asking for goto-esque functionality

#

That’s a terrible thing to do

#

What

#

@hushed robin post the code you’re trying to create here

hushed robin
#

yeah give me a sec

wheat mesa
#

While true is a loop

#

That has nothing to do with this

hushed robin
#

i want those to exit my if to run code at bottom

wheat mesa
#

Then just use blocks like a normal human instead of returning?

hushed robin
#

wym

wheat mesa
#

if(thing) {
if(!somethingElse) {
// Code here
} else {
// Code here
}
}

hushed robin
#

but

#

then i will have a lot of code and paste code

#

inefficient

wheat mesa
#

No?

hushed robin
#

yah

wheat mesa
#

No?

hushed robin
#

i will have to do that for every return

wheat mesa
#

You’ll probably have to nest some if statements, sometimes that’s how it is

hushed robin
#

let me show u

wheat mesa
#

Java is basically javascript but with less flexibility

hushed robin
#

you see now?

wheat mesa
#

Jesus Christ

hushed robin
#

yes

wheat mesa
#

🤦‍♂️

hushed robin
#

thats what i was saying

#

look how fucked it is

wheat mesa
#

That’s not what I was saying

#

Keep in mind you could also just put all of that logic in a function instead of writing it out if you wanted to do it that way

#

Even though that’s still not the right way

hushed robin
#

no

#

they were seperate functions

#

but i'm now combining

wheat mesa
#

why…

hushed robin
#

bc

#

neater

wheat mesa
#

Why would you intentionally increase the length of a function unnecessarily

#

I’m not gonna even try

hushed robin
#

in my fetch

#

i want to see if it's in cache first

#

and if is return

#

thats point of this

#

but i also wanna add force paramter

#

so u can force it to fetch everytime

#

and no check cache

hushed robin
#

nvm i solved it myself like a smart person

radiant kraken
#

java is easy

#

C tho sdTroll

wheat mesa
#

C++ templates and concepts 🧌

radiant kraken
#

c++ is easy because the std library got your back

wheat mesa
#

Taken from cppreference.com: ```cpp
#include <string>
#include <cstddef>
#include <concepts>

// Declaration of the concept "Hashable", which is satisfied by any type 'T'
// such that for values 'a' of type 'T', the expression std::hash<T>{}(a)
// compiles and its result is convertible to std::size_t
template<typename T>
concept Hashable = requires(T a)
{
{ std::hash<T>{}(a) } -> std::convertible_tostd::size_t;
};

struct meow {};

// Constrained C++20 function template:
template<Hashable T>
void f(T) {}
//
// Alternative ways to apply the same constraint:
// template<typename T>
// requires Hashable<T>
// void f(T) {}
//
// template<typename T>
// void f(T) requires Hashable<T> {}
//
// void f(Hashable auto /parameterName/) {}

int main()
{
using std::operator""s;

f("abc"s);    // OK, std::string satisfies Hashable
// f(meow{}); // Error: meow does not satisfy Hashable

}

#

I'd say this is confusing

radiant kraken
wheat mesa
#

honestly C goat language for working with low level data like raw bytes

radiant kraken
#

frfr

#

but it's ecosystem is very barebones

wheat mesa
#

main thing c/c++ needs is a centralized package manager

#

getting libs to work is such a hassle

radiant kraken
#

vcpkg, conan, choco, etc

#

cmake, make, gmake

wheat mesa
#

I know but none of them are really "standardized" across ecosystems, cmake is probably the most universal build system

#

I want something like cargo but for C++, easy to use and isn't obscure

radiant kraken
#

frfr

#

@wheat mesa why is ur username waffle.cs

#

u don't do C# afaik

wheat mesa
#

comp sci

#

since it's my major

#

😎

#

I wanted wafflecs but it was taken

radiant kraken
#

speaking of which

wheat mesa
#

damn counter strike players

radiant kraken
#

i think im gonna change my username to null.rs now

radiant kraken
wheat mesa
#

nah

pale vessel
#

interactions always have the user property

north cairn
tiny dome
#

the submission requires a command, but my bot needs none?

sharp geyser
#

EYES what

deft wolf
#

Most bots operate on commands, either text or slash

quartz kindle
#

nah mine works with mind control

#

:^)

sharp geyser
#

mine works by the blood, sweat, tears and glue holding it together

quartz kindle
#

sexy

sharp geyser
#

ikr

tiny dome
#

i guess i just make one for /info

#

commands are so old fashion 😄

#

I see some bots able to link their website dashboard url as 'social' tab, tho i seem to only be able to link main social media urls. Is it something changed recently?

sharp geyser
slender wagon
#

hi guys i am back to working with my watermark bot

earnest phoenix
slender wagon
tiny dome
#

top gg requires, and overall is a good practice, for the bot to not require admin perms.
My bot needs to be able to create threads in any channel. Is there a perm beside admin that allows that?

slender wagon
#
  const mainImageData = ctxCanvas.getImageData(0, 0, canvas.width, canvas.height);
    console.log(mainImageData)
    const mainRgbaFrame = new Uint8Array(mainImageData.data.buffer);

after logging the mainImageData it seems that the data for all the frames is the same

#

even tho when i individually saved the frames everything seemed to be fine

#

this is inside the loop function btw

sharp geyser
#

No idea

#

I don't do canvas

pale vessel
slender wagon
#

where is Kuhaaku when i need him the most

tiny dome
pale vessel
#

there's not really any way around it other than admin so

civic scroll
#

hang on

frosty gale
civic scroll
#

can't blame em

#

and often pessimistic views lowers your expectations and allows more dopamine if you get it through

frosty gale
#

im his optimistic doppelganger

civic scroll
slender wagon
civic scroll
slender wagon
#

alright so that's not the issue

civic scroll
#

what's your issue

#

brief me up

slender wagon
#

but for some reasone ImageData contains the same data for all them frames

#

the one inside the loop

#

idk what i am doing wrong

civic scroll
#

the raw code is blinding me eyes

tiny dome
#

Iv just submitted my bot but it sent be back to step 2 and i cant push 'next'.
Is there a way to check if it has been submitted?

tiny dome
frosty gale
#

to your bot?

tiny dome
#

where did u see that

frosty gale
#

idk just an assumption

tiny dome
#

just submitted 30 seconds ago

#

im not asking if it has been accepted, but it has been submitted correctly. Got no notification on that

frosty gale
#

@quartz kindle actually now that i enabled secure boot i just made it harder to enable your tpm mod or whatever it is

tiny dome
#

k thx

frosty gale
#

tpm essentially becomes a self destruct armed device when secure boot is on and tpm is initialised

#

any attempt to disable secure boot or read tpm without correct password or try to access it physically causes it to erase itself and/or lock itself

#

pretty cool how its engineered to resist tampering and unauthorised access

#

inspiring in fact

quartz kindle
#

what does tpm even protect against? like in practice

frosty gale
#

so basically you have your drive decryption keys / passwords for whatever

#

problem becomes storing them without an unauthorised source accessing them

#

so you arm the tpm and enable secure boot so the computer can only run windows or whatever trusted thing you installed so only that code can access the tpm

#

its designed to protect again physical attacks like reading the chips pins and extracting the keys as well as a malicious party installing a custom os to read the tpm

quartz kindle
#

what if i dont encrypt my drives

#

lol

frosty gale
#

its even emp shielded so you cant try to read the signals the tpm gives off or try to manipulate it with one

frosty gale
#

i dont think it stores your windows login creds or browser passwords because that would be annoying

#

but it might

quartz kindle
#

such an over complicated feature that is completely useless for 99% of the users out there, wow

#

:^)

frosty gale
#

yeah really its more like a cool thing to have rather than an essential feature for secure computing

#

my company doesnt even use the TPM for our work laptops

#

we have to manually enter in a bitlocker unlock key

quartz kindle
#

lmao

frosty gale
#

its safer anyways

quartz kindle
#

as someone who worked with data recovery in the past, i absolutely hate drive encryption

frosty gale
#

plus actually using tpm is less secure because you can just let windows boot normally and automatically unlock itself and then read the contents of the RAM to determine the decryption key that way essentially bypassing the tpm

frosty gale
#

that is if your decryption key is strong

#

tpm is a good source of random generated numbers tho

frosty gale
#

let a tpm protected and bitlocker encrypted drive unlock itself automatically then attach probes to ram to read the contents and extract the decryption key

#

the company lets you do projects like this and even funds them

quartz kindle
#

what kind of data you even need to hide from the wrong people? and who are the wrong people lmao, most of the time its just "company secrets" which is nothing more than intellectual property thats not really worth anything in the hands of others

frosty gale
#

for my company its mostly intellectual property yeah but also some vulnerabilities and info that could be used by the wrong people

#

the amount of big companies you see making stupid and simple security mistakes is unbelievable in their code

#

no wonder they pay a fortune to security companies

quartz kindle
#

regardless, the biggest attack vector by far is human error

#

which renders all of that crap useless once again :^)

frosty gale
#

yeah thats the biggest threat

#

negligence or someone being tricked

quartz kindle
#

whats your company btw? if i may ask

frosty gale
#

can tell in dms :o

quartz kindle
#

sure

slender wagon
#

wait no

civic scroll
slender wagon
#

it's probably the way i am passing the frames in the canvas

quartz kindle
civic scroll
#

i don't wanna force you

#

just feel free to

#

i get fun from working with people

#

but i need to improve as well

quartz kindle
#

:)

civic scroll
civic scroll
#

but that has memory cost

slender wagon
#

hhhhm

frosty gale
#

are you struggling to get a job or just dont want to?

quartz kindle
#

get me a nice job too

civic scroll
quartz kindle
#

preferably one that you dont actually work and just get paid

#

:^)

civic scroll
#

i'm still in school

#

but like

frosty gale
#

my company kinda has that theyre extremely flexible

#

they dont care how many hours or days you work as long as you get the work done

civic scroll
#

since i get started late, i just sorta press myself to "get good faster"

frosty gale
#

going to office is also optional but i get distracted too easily so ill probably be going there often

frosty gale
#

youre on a salary but theyre not really concerned in the hours you put in

civic scroll
#

but yeah i don't think i have any strong offers to companies atm

#

my skills are not good yet

slender wagon
#

man i just take massive projects from some shady guys they pay well

#

💀

quartz kindle
#

xD

frosty gale
#

lmao

#

you kinda have to be a master in everything for cyber sec

#

nodejs would help but you would also need to basically be happy to learn anything

slender wagon
frosty gale
#

i like learning about new technologies and expanding my knowledge so i dont mind

quartz kindle
#

i like learning too, just not react

#

or vue

#

or any frontend framework for that matter

slender wagon
#

i learned react

quartz kindle
#

lmao

civic scroll
slender wagon
#

then jumped right into nextjs

frosty gale
quartz kindle
#

except svelte, that the only one im interested in trying out

frosty gale
#

knowledge of front end would probably help but some of the work is not even related to code

#

knowledge of front end vulnerabilities would definitely help tho

frosty gale
#

havent used it much though

civic scroll
frosty gale
#

i like how it compiles everything to a single javascript bundle instead of having a stupid framework powering everything behind the scenes

#

(react)

#

though react makes code a nightmare to reverse engineer

civic scroll
#

so like real dom manipulation

frosty gale
#

yeah

civic scroll
#

ah i see

#

i wish there are equivalent of framer-motion for other frameworks too

#

angular has its own animation library but it's a bit confusing to use

slender wagon
frosty gale
#

isnt canvas hardware accelerated?

slender wagon
#

idk is it

frosty gale
#

destroying context would prob destroy any benefit of hardware acceleration lol

#

point is having data already in the gpu memory ready to be used

frosty gale
#

dont know about 2d though

#

depends on browser ig

#

mine is apparently

#

chrome://gpu

slender wagon
#

yeah seems like it

#

now it wont display shit

frosty gale
#

probably not related though i mean in terms of performance

slender wagon
#
for (let i = 0; i < apng.frames.length; i++) {
    // Get the RGBA pixel data for the current frame
    const rgbaFrameData = UPNG.toRGBA8(apng)[i];
    console.log(`Processed frame ${i + 1}/${apng.frames.length}`);
    // console.log(`RGBA FRAME DATA:`, new Uint8Array(rgbaFrameData));

    // Create a new canvas for the current frame
    const frameCanvas = createCanvas(apng.width, apng.height);
    console.log(frameCanvas);
    const frameCtx = frameCanvas.getContext("2d");

    // Put the RGBA pixel data onto the frame canvas
    const imageData = frameCtx.createImageData(apng.width, apng.height);
    imageData.data.set(new Uint8ClampedArray(rgbaFrameData));
    frameCtx.putImageData(imageData, 0, 0);
    const isSame = imageData.data.every(
      (value, index) => value === imageData.data[index]
    );
    console.log(isSame);

    // Clear the canvas
    ctxCanvas.clearRect(0, 0, canvas.width, canvas.height);

    // Redraw the user's image onto the canvas
    ctxCanvas.drawImage(userImage, 0, 0);

    // Draws the frame onto the main canvas
    ctxCanvas.drawImage(frameCanvas, watermarkX, watermarkY);
    // Save the canvas as an image
    const out = fs.createWriteStream(`canvas${i}.png`);
    const stream = canvas.createPNGStream();
    stream.pipe(out);
    out.on("finish", () => console.log(`Saved canvas ${i}.png`));
    const mainImageData = ctxCanvas.getImageData(
      0,
      0,
      canvas.width,
      canvas.height
    );
    // console.log(mainImageData);
    const mainRgbaFrame = new Uint8Array(mainImageData.data.buffer);
    frames.push(mainRgbaFrame);
    // Saving the current frame as a seperate png file
    // const out = fs.createWriteStream(`frame${i}.png`);
    // const stream = frameCanvas.createPNGStream();
    // stream.pipe(out);
    // out.on('finish', () => console.log(`Saved frame ${i}.png`));
    console.log(`Processed frame ${i + 1}/${apng.frames.length}`);
  }
frosty gale
#

me when canvas no work

slender wagon
#

as u can see the frame is fine the canvas is not

#

i'll go crazy no cap

slender wagon
quartz kindle
#

and canvas

slender wagon
#
// Creates a canvas with the same dimensions as the user's image
  const canvas = createCanvas(userImage.width, userImage.height);
  const ctxCanvas = canvas.getContext("2d");

  // Draws the user's image onto the canvas
  ctxCanvas.drawImage(userImage, 0, 0);

  // Calculates the position at which to draw the watermark image
  const watermarkX = (userImage.width - apng.width) / 2;
  const watermarkY = (userImage.height - apng.height) / 2;

  // Creates an array to hold the frames
  const frames = [];

  // Set the delay for each frame (in milliseconds)
  const frameDelay = apng.frames[0].delay;

  for (let i = 0; i < apng.frames.length; i++) {
quartz kindle
#

so you're drawing each frame on the same canvas?

#

and you want to save each frame as an image?

slender wagon
#

the frame saving is fine, the canvas saving is the one that has the issue. I am saving them just to debug

#

the end result will be send to the user

quartz kindle
#

what should the end result be?

slender wagon
#

the image of the user with the apng over it. sent as a .apng

#

aka an animated watermark

quartz kindle
#

and how is the .apng built?

slender wagon
#
 // Encode the APNG image
  console.log(
    "HELLOOO",
    frames,
    +" " + "WIDTH" + " " + canvas.width,
    canvas.height,
    apng.frames.length
  );
  const apngBuffer = UPNG.encode(
    frames,
    canvas.width,
    canvas.height,
    0,
    new Array(apng.frames.length).fill(frameDelay)
  );

  console.log(`Encoded APNG image: ${apngBuffer.byteLength} bytes`);
  try {
    await ctx.replyWithDocument({
      source: Buffer.from(apngBuffer),
      filename: "watermarked.apng",
    });
    console.log("Sent APNG document");
    //Saving it locally for testing purposes
    // console.log("apngBuffer before:", apngBuffer);
    fs.writeFileSync("watermarked.apng", Buffer.from(apngBuffer));
    console.log("Saved watermarked.apng");
    // console.log("apngBuffer after:", apngBuffer);
  } catch (err) {
    console.error(`Error sending APNG document: ${err.message}`);
  }
});

this is after the loop function

#

don't mind my debuging

quartz kindle
#

what type of object is mainImageData.data.buffer?

slender wagon
#

it's an arraybuffer

#

ArrayBuffer {
[Uint8Contents]: <22 26 25 ff 24 28 27 ff 27 2d 2d ff 23 2c 2b ff 1b 25 24 ff 17 26 21 ff 17 28 20 ff 11 25 19 ff 0c 23 13 ff 19 30 1c ff 1a 31 1d ff 18 30 1a ff 1a 2f 1e ff 21 36 25 ff 37 4b 3f ff 48 5d 4a ff 6a 7e 62 ff 73 8f 66 ff 67 8d 5a ff 53 7c 44 ff 4c 6a 34 ff 3e 54 26 ff 2f 35 19 ff 23 2a 1a ff 1f 2c 23 ff ... 1030524 more bytes>,
byteLength: 1030624
}

quartz kindle
#

a typedArray initialized with an ArrayBuffer is not a copy, it shares the same buffer

slender wagon
#

and the thing is they all have the same data

quartz kindle
#
  const mainImageData = ctxCanvas.getImageData(
      0,
      0,
      canvas.width,
      canvas.height
    );
    // console.log(mainImageData);
    const mainRgbaFrame = new Uint8Array(mainImageData.data.buffer);
    frames.push(mainRgbaFrame);
``` this part here
#

im not sure what getImageData returns

#

but if it returns a reference to the canvas arraybuffer, then creating an Uint8array out of that will keep that reference

#

so the next time the canvas is updated, all bytes in those references will be affected

#

try this

#

new Uint8Array(mainImageData.data.buffer.slice())

#

that will force copy the arraybuffer

slender wagon
#

was just trying that lol

#

which got me:
Expected 1-2 arguments, but got 0.ts(2554)
lib.es5.d.ts(1683, 11): An argument for 'begin' was not provided.
(method) slice(begin: number, end?: number): ArrayBuffer
Returns a section of an ArrayBuffer.

#

so i got rid of the .buffer.

#
    const mainRgbaFrame = new Uint8Array(mainImageData.data.slice())
#

still having the issues tho

quartz kindle
#

what is the type of data?

slender wagon
#

mainImageData?

quartz kindle
#

.data

midnight brook
#

is anyone having issues with the npm registry?

quartz kindle
#

what kind of issues?

midnight brook
#

keep getting this, even tho it curls perfectly fine

#

nd it works in my browser

quartz kindle
#

¯_(ツ)_/¯

midnight brook
#

hmm

#

time to reinstall

quartz kindle
slender wagon
# quartz kindle .data

can't capture it cuz it spams it lol but i guess an array:
5,8,60,180,255,8,60,180,255,8,60,180,255,8,60,180,255,7,59,179,255,7,59,179,255,7,59,179,255,8,60,180,255,8,60,180,255,8,60,180,255,7,59,179,255,7,59,179,255,8,60,180,255,8,60,182,255,8,60,182,255,8,60,182,255,7,59,181,255,6,58,180,255,6,58,180,255,7,58,183,255,7,58,183,255,6,57,182,255,6,57,182,255,7,59,181,255,7,59,181,255,7,59,181,255,7,59,181,255,6,58,180,255,6,58,180,255,6,58,18

quartz kindle
#

weird

#

if its a normal array and not a typed array, then uint8array should copy it

slender wagon
#

it's a Uint8ClampedArray

#

logged it with console.log(mainImageData.data.constructor);

quartz kindle
#

then new Uint8Array(mainImageData.data) should work

slender wagon
#

yeah still tho

quartz kindle
#

if you are testing based on the canvas frames that are saved by the pngstream then thats not accurate, because the streams are async

slender wagon
#

oh

#

so all the canvas frames being the same is ok?

quartz kindle
#

yes

slender wagon
#

the end result is fully transparent tho

quartz kindle
#

if you wanna test the frames correctly, you need to use canvas.toBuffer

#

and save with fs.writeFile

slender wagon
#

doing that rn

quartz kindle
#

also, i dont get this part

#
   const imageData = frameCtx.createImageData(apng.width, apng.height);
    imageData.data.set(
      new Uint8ClampedArray(new Uint8Array(rgbaFrameData).slice().buffer)
    );
    frameCtx.putImageData(imageData, 0, 0);
#

createImageData, set the data on it, then write the data on it back onto itself?

#

unless that doesnt do what i think it does

slender wagon
#

yeah the frames are totally fine

quartz kindle
#

but the apng still isnt?

slender wagon
#

nope

#

it's transparent

#

here i'll give u one

quartz kindle
#

try using canvas.toBuffer() for the apng frames, instead of getImageData

slender wagon