#development

1 messages · Page 46 of 1

daring apex
#

Yes

#

I know

cyan bane
#

ow

#

kk

solemn latch
#

🤔
So I'm having an issue with tampermonkey.
I have a require which ideally would load every time the script is loaded, but it seems to only update when I change the script version.

Any ideas on how to get around that while still using tampermonkey @require? https://www.tampermonkey.net/documentation.php#_require

civic scroll
#

it's require

#

you headass

boreal iron
pale vessel
#

and it's content, not context

boreal iron
#

Mobile

drifting cairn
#

i dunno i dont use sql databases bearWalkfast

boreal iron
#

Man include details… we don’t even know what your OS is

#

After installing it, it should be installed as service and should be running already

#

Might need to be configured

#

Your config files should be in /etc/postgresql/…

#

Guess pg default configuration should already be good enough for you

#

So you can actually begin to create an user, your database and query it

rocky hearth
#

In ts I have a type like
type A = {a: number} | {b: string}
I want to merge those and make,
type B = {a: number, b: string}
Can someone make me a utility type for that

sudden geyser
#

If you can, you could make them separate types and use & like so:

type A = {
  a: string
};
type B = {
  b: string
};
type C = A & B;

const c: C = {
  a: "",
  b: ""
};
rocky hearth
#

Oh that I knew, but that union is dynamic.
I want to convert that on the fly

lyric mountain
#

u dont use the browser to install stuff on linux

#

apt install postgresql

#

sudo -i -u postgres
psql

#

wdym "tied on"?

lyric mountain
#

is ur port open?

#

or are u doing it locally?

lyric mountain
#

...? mongodb or postgres?

#

skill issue

#

you either pass it as a parameter or make it global

#

like u do with client

#

u require index to get client?

#

that's horrible

#

nothing should ever need to import index

#

if anything use a third file to hold global variables

#

else you'll soon or later run into cyclic import errors

#

use a third file to hold global variables or pass it as a parameter

#

or do js stuff like client.db = db

#

author cant have roles

#

author is an user

#

...so you get the member

wheat mesa
#

Then observer isn’t defined

#

…basic javascript

#

Names don’t just magically exist without any definition

lyric mountain
#

I love when you say "X isn't defined" and someone answers with "and how do I define it"

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

lament rock
#

both the file that defines it and the file that needs it can require another file which exports an Object. You can assign properties to the Object in the main file and they'll appear in the other files that require that file.

#

you should be saving as uuid instead of names since names can change

#

looks good to me, but im not familiar with mc api or mongoose

#

but yeah. Always use keys that don't change

#

why you use user ids instead of tags

#

my tag is PapiOphidian#0110 and my user id starts with 32006…
I can change my name whenever, but my user id never changes

#

that logic should follow everywhere

ember ore
lyric mountain
#

?

#

that was random af

ember ore
#

Yeah lol

#

Observer is defined now BongoCat

narrow magnet
lyric mountain
#

bot edit page -> webhook -> scroll down

narrow magnet
#

Thanks :)

boreal iron
#

You already gave up postgres before actually getting into it?

quartz kindle
#

idk why people insist on using mongo, its confusing af

boreal iron
#

or why they’re afraid of learning sql, you can actually get into it real quick

#

the basics are really not difficult

lyric mountain
#

sql learning curve is surprisingly good

#

the floor is really low and the ceiling is very high

#

plus postgres is turing-complete, so u can do some funny scripts on plpgsql

wooden ember
#

anyone know why the error cannot read properties of undfined (reading 'catch') comes from

dmusr.send(`[USER REQUESTED] ${toSend}`).catch((e) => msg.author.send(`unable to send message to that person`).catch(e => console.log(` could not send message:  ${e}`)));
```  it does the same with `try catch` too
lyric mountain
#

send returned nothing

wooden ember
#

?

#

but its not suposed to

#

unless it failed

#

which is why the catch is there

#

or am i misunderstanding

lyric mountain
#

catch will do nothing if it doesnt exist

#

wtf is dmusr?

drifting cairn
#

lol

wooden ember
#

its a shitty variable name

drifting cairn
#

dm user abbreviated probably

wooden ember
#

^

drifting cairn
#

are u sure the user exists

wooden ember
#

im dming myself and it logs the mesage and the username in the console befor sending

#

so i know its valid

drifting cairn
#

can u show me what dmusr is defined as

wooden ember
#

const dmusr = msg.mentions.users.first();

lyric mountain
#

the user might exist, but are u sure send is a thing?

wooden ember
#

isnt that how you dm some one

drifting cairn
#

yea

#

also i'd recommend using msg.mentions.members.first() instead of users

wooden ember
#

dont you have to fetch the user after that though?

drifting cairn
#

after what?

#

you dont have to fetch a mentioned user, no

wooden ember
#

ok

#

now dmusr is undefined

#

but also same error too

#

bruh im actually dumb the error was coming from the line above where I accidentally .cached a console log

quartz kindle
#

console.log().catch()

#

next big thing

#

:^)

sharp patio
#

Big ding missed aye

boreal iron
#

Sending always returns the message object

lyric mountain
#

If it is sent it'll enter the then() block

boreal iron
#

Excluding interaction replies

lyric mountain
#

Else it'll enter the catch() block

green kestrel
#

mmmmm new server so beautiful 🥹

boreal iron
#

Hmm very less ram in reference to the core count

green kestrel
#

64gb lol

#

i can build dpp in under a minute now

boreal iron
#

Ah I see… very cpu intense lol

radiant kraken
#

wtf am i looking at

quasi depot
#

anyone know typescript?

wheat mesa
#

Just ask your question

quasi depot
#

Don't know how typescript works, But yet I am here trying to host a bot on ts.

C:\Users\rudei\bot-2>yarn
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed in 0s 583ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ typescript@patch:typescript@npm%3A4.8.2#~builtin<compat/typescript>::version=4.8.2&hash=f456af can't be found in the cache and will be fetched from the disk
➤ YN0066: │ typescript@patch:typescript@npm%3A4.8.2#~builtin<compat/typescript>::version=4.8.2&hash=f456af: Cannot apply hunk #16
➤ YN0000: └ Completed in 33s 257ms
➤ YN0000: ┌ Link step
➤ YN0007: │ bufferutil@npm:4.0.6 must be built because it never has been before or the last one failed
➤ YN0007: │ erlpack@npm:0.1.4 must be built because it never has been before or the last one failed
➤ YN0007: │ utf-8-validate@npm:5.0.9 must be built because it never has been before or the last one failed
➤ YN0007: │ zlib-sync@npm:0.1.7 must be built because it never has been before or the last one failed
➤ YN0009: │ erlpack@npm:0.1.4 couldn't be built successfully (exit code 1, logs can be found here: C:\Users\rudei\AppData\Local\Temp\xfs-14fdf553\build.log)
➤ YN0009: │ zlib-sync@npm:0.1.7 couldn't be built successfully (exit code 1, logs can be found here: C:\Users\rudei\AppData\Local\Temp\xfs-cfa2bf85\build.log)
➤ YN0000: └ Completed in 51s 463ms
➤ YN0000: Failed with errors in 1m 26
wheat mesa
#

looks like a problem with yarn and not typescript at all

quasi depot
#

well then yarn,.

earnest phoenix
#

@pliant gorge

rotund river
#

hello, i have a problem with mysql2

#

anyone can help me?

#

it doesn't have the time to get the id

#
            const insertContent = `INSERT INTO \`shark_ticket\` (\`ID\`, \`ID_Utente\`, \`ID_Claim\`, \`Timestamp\`) VALUES (NULL, '${interaction.user.id}', NULL, CURRENT_TIMESTAMP)`
            var INSERT = insertContent
            pool.query(INSERT, function (err, result) {
                if (err) throw err;
            });

            const selectIDtContent = `SELECT \`ID\` FROM \`shark_ticket\` WHERE ID_Utente='${interaction.user.id}'`
            var INSERT = selectIDtContent
            pool.query(INSERT, function (err, result) {
                if (err) throw err;
                var ticketID = result[result.length - 1];
                client.ticketID = ticketID.ID
            });
quartz kindle
#

pool.query is an asynchronous function, everything that happens inside the function(err, result) {} will happen "later" not "now"

rotund river
quartz kindle
#

yes

rotund river
quartz kindle
#

you cant

#

thats how async functions work

rotund river
quartz kindle
#

what you can do is make a Promise and await it, but its still gonna be async

rotund river
#

it after create a channel

quartz kindle
rotund river
#

whit this?

quartz kindle
#

for example yes

rotund river
eternal osprey
#

Is it possible to edit an ephemeral message?

quiet latch
#

I need help

#

It seem it's nothing giving the message voted

rustic nova
#

reach out to the owner of that api, probably they can help

#

or whoever owns it

#

also, have you perhaps tried visiting the site directly, no clue where you've gotten that, its not even an existing site

eternal osprey
#

Only deleting won’t be possible?

surreal sage
#

% chance, how to.

#

I forgor

#

My brain is broken

#

Javascript ofc

rustic nova
#

per docs yes

#

per djs, check the docs

#

oh an ephemeral message

#

cant be edited no

#

only non-ephemeral messages can be edited

surreal sage
#

My brain is broken atm, but help me out

#

I'm making a !rob command

#

A 85% chance for success

#

How do I do the chance

rustic nova
#

get a random number between 1 and 100 if number below 85, do success

rotund river
# quartz kindle for example yes
            async function select () {
                const mysql = require('mysql2/promise');
                var connection = mysql.createConnection({
                    host: client.config.host,
                    user: client.config.user,
                    password: client.config.password,
                    database: client.config.database,
                    supportBigNumbers: true,
                    bigNumberStrings: true
                });
                const selectIDtContent = `SELECT \`ID\` FROM \`shark_ticket\` WHERE \`ID_Utente\` = ?`
                var INSERT = selectIDtContent
                const [err, result] = await connection.execute(INSERT, [interaction.user.id]);
                if (err) throw err;
                var ticketID = result[result.length - 1];
                console.log(ticketID.ID)
                await connection.end();
              }
              select;
#

it doesn't log

quartz kindle
#

also, await the createConnection line

surreal sage
#
const obj = {
    uuid: 1234,
    use: function() {
        console.log(this.uuid)
    }
}; obj.use()```
Is this possible?
earnest phoenix
surreal sage
#

Good 2 know

earnest phoenix
#

Since the scopes of the methods are bound to the object, you can access the properties and methods through a method

#

You can also use a getter if you'd like

#

For example:

const foo = {
  bar: 1,
  get baz() {
    return this.bar;
  }
};

console.log(foo.baz); // 1
eternal osprey
#

hey does anyone know why my interaction isn't working in dms?

#
Uncaught TypeError TypeError: Cannot read properties of null (reading 'id')```: ```js
console.log(interaction.member.id)
lament rock
#

members dont exist in DMs

#

you'd use interaction.user

eternal osprey
#

i love you

fierce kindle
#

Does anyone understand the lavalink of erela.js

sharp geyser
rotund river
#

Hello, i have a problem

#

Uncaught Exception: DiscordAPIError[40060]: Interaction has already been acknowledged.

fierce kindle
# sharp geyser what is your question

the problem is I made a music system for the bot, when playing music, youtube says there is an age limit or something, it doesn't play it says you need to set an email and password, but I don't know how to set it

rotund river
#
[FATAL] Possibly Unhandled Rejection at: Promise  Promise {
  <rejected> DiscordAPIError[40060]: Interaction has already been acknowledged.
      at SequentialHandler.runRequest (/home/bot/Shark/node_modules/@discordjs/rest/dist/lib/handlers/SequentialHandler.cjs:287:15)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async SequentialHandler.queueRequest (/home/bot/Shark/node_modules/@discordjs/rest/dist/lib/handlers/SequentialHandler.cjs:99:14)
      at async REST.request (/home/bot/Shark/node_modules/@discordjs/rest/dist/lib/REST.cjs:52:22)
      at async SelectMenuInteraction.deferUpdate (/home/bot/Shark/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:192:5) {
    rawError: {
      message: 'Interaction has already been acknowledged.',
      code: 40060
    },
    code: 40060,
    status: 400,
    method: 'POST',
    url: 'https://discord.com/api/v10/interactions/1020749447115854025/aW50ZXJhY3Rpb246MTAyMDc0OTQ0NzExNTg1NDAyNToweWQ3QjhFNVA4UVpLNVJLbVRSQ3U1cmdwZ2k2MkVNOEJMSTBIdTNhdW5NR2FjMmM5eVF0RG55MG5mUjJUNWFHZDlmNE1BY09KektjVGp3RWpjZ0NTOTJZdWk1TUd2SmQwNkVKSHBtd2JsOEM5enA3aXQwWE82dkd2U3JmbU9pag/callback',
    requestBody: { files: undefined, json: [Object] }
  }
}  reason:  Interaction has already been acknowledged. ```
sharp geyser
#

@boreal iron this is your area of expertise my g

#

I have hardly touched interactions

#

Though I have a feeling it has something to do with the interaction has already been received and refuses to receive it again

#

or discord is using poor choice of words, or I am just misunderstanding their choice of words

fierce kindle
#

@sharp geyser did you look at my problem

sharp geyser
#

I did, and I can't really help

rotund river
fierce kindle
sharp geyser
#

Ever since youtube put measures to stop music bots from streaming their music on discord

#

I haven't touched it

rotund river
sharp geyser
#

Also

#

Why do you have so many event listeners for interactionCreate

#

that just sounds like a bad idea

#

Okay your code is just fucked up in so many levels

rotund river
rustic nova
sharp geyser
#

I have a feeling you are getting this Interaction has already been acknowledged because of how many times you are essentially listening to that event and then trying to deferUpdate it

rustic nova
#

if another one responds to it already, the ones after it will cause that error

sharp geyser
#

^

#

You are also listening to the event like 20 times

#

so

rustic nova
#

and probably responding to it 20 times

#

make an interaction handler

sharp geyser
#

well yea

#

each listener does something with the interaction

sharp geyser
#

so he just nested 20 interactionCreate listeners in a interactionCreate listener

#

The more you look at the code, the more cursed it gets

#

@rustic nova he makes a new db connection each event call

#

💀

rustic nova
#

cc @rotund river probably good to not do that, apply caching there

sharp geyser
#

and doesn't close it

#

😔

rustic nova
#

underwear

#

lmao

sharp geyser
#

fat fingered the emote

rustic nova
sharp geyser
#

ok well at least he does close it nvm

#

but he made an inf loop

#

so fun

#

and yea each interaction create listener he made responds to the interaction

#

and he is only making multiple cause he is trying to do different things with each value from the select menu

#

which you can quite literally just use one interaction create and loop through each value and do some validation

rustic nova
sharp geyser
#

not to mention every single one deferUpdates

#

so

#

Ima play witcher 3 before work so cya guys

thorn spruce
#

Hey, did anyone know how type that in typescript

    {
        "random string":{
            encounter?:number,
            category?:string
        }
    }
quasi depot
digital swan
rotund river
#

@sharp geyser and @rustic nova thanks, after use one client on the bot has sped up, what are the other problems?

graceful cobalt
#

How did u speed up your bot

rotund river
rustic nova
#

please optimize your database usage too

#

because you're calling your database on every interaction iirc, doesnt matter what interaction does it

boreal iron
quasi depot
lament rock
#

I call my database 50 times per message

lament rock
#

jk i dont

sharp geyser
#

someone else does

lament rock
quasi depot
#

Can’t locate the file.

boreal iron
lament rock
quasi depot
#

How?

lament rock
#

tsc -p .

#

uh if you're not running that as an npm script, you need to have typescript installed globally

#

something something path variables

quasi depot
#

Let me try that.

eternal osprey
#

Is anyone familiar with ORNF and ORGR?

#

So object role grammar rule and object role normal format?

quasi depot
#

I am mean I am trying the bot using npm run start

lament rock
#

npm install -g typescript

#

then you can use tsc

quasi depot
#

now I can just run tsc -p right

#
tsc -p
error TS6044: Compiler option 'project' expects an argument.
lyric mountain
#

-p is to pass a project

#

it's not a flag

quasi depot
#

so how would I be able to work my project?

lyric mountain
#

tsc -p "path/to/project"

quasi depot
#

tsc -p dist/index.ts?

lyric mountain
#

it'd be str/index.ts no?

#

I dont see any dist there

winter pasture
#

Nah, you dont need -p at all if you got .tsconfig in root

#

Just run tsc

#
--project
Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'.
quasi depot
#

I just ran tsc and got so many errors

winter pasture
#

Progress! lol

quasi depot
#

I might be able to run the bot with npm run start

#

with npm run start

#

with tsc

quaint rampart
#

hey guys so im currently implementing crypto to my bot so basically lets say u buy 10 cherry money (my bots currency) with bitcoin how should i calculate how much it goes up or down? i already found an api to receive data about the currency and here it is linked below:

https://haste.cherrybot.xyz/uwilehepuv.m

this data changes on my bot every 1 hour

lyric mountain
#

nobody will buy bot currency with crypto

quaint rampart
#

your not actually spending money

#

its just money inside the bot

#

but that money changes based on btc irl rates

#

does that make sense? i dont really know how i can explain it well

#

so like

#

10 in bot money (based on usd rates) to btc

#

but i want that money in the bot to also change

#

based on btc changes

lyric mountain
#

well, you'd need to track btc prices on the database

quaint rampart
#

already got that done

lyric mountain
#

to have a before and after value

quaint rampart
#

yes

lyric mountain
#

then just do now - before

quaint rampart
#

so for example

20500 - 20499

#

and then that means it went down by 1 usd

lyric mountain
#

yes

quaint rampart
#

but then how would this be caluclated into what the user has

#

in the bot

quaint rampart
lyric mountain
#

now / before to get the multiplier

quaint rampart
#

1.00004878287

lyric mountain
#

tho ur doing it in the opposite way

#

the bitcoin price is always 1 btc

#

if ur currency is based on btc, it'll always be 1 coin = 1 btc

quaint rampart
#

and 1 btc for example is worth 2000

lyric mountain
#

u need some currency to have an anchor

quaint rampart
#

usd

#

which i have the data for in the db

quasi depot
knotty quartz
#
const together = [letters,numbers,symbols*10]

Does this work for a password gen?

lyric mountain
#

then do money * (before / now) when converting from money -> btc

#

do not change the current value from the user's wallet

#

else you'll have a leaking currency

#

to revert, do money / (before / now) (btc -> money)

lyric mountain
#

and no, best way to generate a password is using hash + base64

knotty quartz
lyric mountain
#

do note, it'll not have symbols, so you'll need to replace random characters urself

quaint rampart
#

10 is usd first num is crypto before 2nd is crypto after

lyric mountain
quasi depot
#

can i get some help tooo

lyric mountain
#

higher crypto value = less converted value

#

cheaper crypto = more converted value

quasi depot
#

tried using the same commnd in git bash

#
bash: venv/bin/activate: No such file or directory```
lyric mountain
#

what is source supposed to do?

quasi depot
#

activate the virtual env

lyric mountain
#

doing (now / before) will get u the percentage of increase/decrease

quasi depot
#
source venv/bin/activate  # Activate virtual environment
pip install -Ur requirements.txt  # Install dependencies```
quaint rampart
#

it should be

#

(newVal- oldVal) * userCurrentlyHas

lyric mountain
#

just do userCurrentlyHas / currentVal

#

the currency was already converted by the api

ancient nova
#

ok so not only I lost all my data on my PC I also lost my bots source code because my vps had a purge I didn't know about 😄👍😄👍😄👍😄👍😄👍😄👍😄

lyric mountain
#

"vps had a purge"?

#

sounds like u were using a sketchy service then

#

also tf u were not using git

ancient nova
knotty quartz
#

Another question: How to set status to Streaming?

lyric mountain
#

what service was it?

sharp geyser
ancient nova
knotty quartz
ancient nova
lyric mountain
#

which was...?

ancient nova
#

I used digital ocean for a week but it was worse than Daki

sharp geyser
#

Yes we remember everything

earnest phoenix
#

Yet again telling Bae to use a remote repository...

ancient nova
#

I will once I get my new PC

sharp geyser
#

Lmao

earnest phoenix
#

You mean your SSD? Or did you get an entirely new PC?

sharp geyser
#

Sounds dumb if he got a new pc for a drive problem

ancient nova
ancient nova
#

maybe I will copy over any gamesaves I can find

#

and reinstall

sharp geyser
#

Do you not use steam?

ancient nova
#

but all my MC worlds are too big... 😔

sharp geyser
#

Rip

ancient nova
#

I thought it was stored in the appdata

#

for most steam games it is

sharp geyser
#

Typically the game itself stores a save

#

Or at least any good game

#

I’ve been able to install a game on a different device and have my saves

#

🤷‍♀️

ancient nova
#

well you're probably talking about games like csgo

#

my singleplayer playthrough of gta v won't be saved

#

😔

eternal osprey
#

hey

#

does anyone know a good npm package that i can use to convert my date to a different timezone?

thorn spruce
pale vessel
#

You'd need to create another interface, or use Record (Record<string, t>)

#

That's basically ts interface Bla { [key: string]: t }

earnest phoenix
pale vessel
#

Wait aaa

#

Nm I'm dumb

#

Oml

#

Yes, the interface they gave does what you want I believe. There's no need to do t[] as it's not an array

lyric mountain
pale vessel
#

I'm too tired notlikethis

boreal iron
#

Breaking markdown…

#

Report is out!

eternal osprey
eternal osprey
#

huh apparently i cannot?

lyric mountain
eternal osprey
pale vessel
#

if you want it to parse user input, a package could be convenient

eternal osprey
#

Only thing i basially need to do is convert the current time to GMT +8

lyric mountain
#

I'm surprised js doesn't have timezone built in

eternal osprey
#

Or PST

#

EST etc

lyric mountain
#

in java u just do ZoneId.of("GMT+8")

eternal osprey
#

i tried finding packages for it, but couldn't find a good converter

eternal osprey
#

does anyone know a good package where i can convert the current timezone to a different timezone like EST, PST, GMT +8, GMT -7 etc etc

lament rock
#

make your own I guess

eternal osprey
#

how should i make my own lmao

#

i tried fucking around with the date property in js but it isn't really working

lament rock
#

Skill issue

boreal iron
#

I mean if you know the offset just add it to the timestamp or remove it

eternal osprey
#

this is the only data i've got

boreal iron
#

+5h or -3h shouldn’t be difficult to do

eternal osprey
boreal iron
#

You don’t need the local zone names if you already got the offset

eternal osprey
#

Owh wait so those + and - are the offsets?

#

So i could basically get the current time and add that number up to it?

boreal iron
#

Well an offset of +8 means GMT + 8 hours

eternal osprey
#

So i should get the current time in GMT and add + 8 hours to it

#

got it

#

thanks for your time and help bro

boreal iron
#

So make ur script using utc then calculate your offsets to the gmt

lament rock
#

Date.now() already returns UTC/GMT

boreal iron
#

Doesn’t it return the local system time?

lament rock
#

"local" time isn't really a concept since its how many ms has passed since jan 1st of 19 something GMT

#

Plus, your devices connect to a time server

boreal iron
#

That wasn’t what I mean

#

lmao

lament rock
#

What did I misunderstand? Your system time isn't local. It's all through time servers

boreal iron
#

Nvm wasn’t reading carefully

#

Though we were talking about a local date format

#

Not timestamp

quartz kindle
#

luxon is more modern and up to date, but does not include its own tzdata files, it relies on the existing files on your system

#

moment-timezone is sort of deprecated but they still regularly update its built in tzdata file, so it doesnt need the system one

#

meaning moment-timezone will always be faster to update as new tzdata files are released

haughty bloom
#

Could someone help? This is not to do with development but rather just discord bots.

In the Discovery status page of my application, it says Your application must use slash commands, or have been approved for the Message Content privileged intent with an ❌ next to it. So I created a slash command and it STILL has the ❌, anyone got any idea why?

lyric mountain
#

did u create the slash commands as global or local?

quasi depot
earnest phoenix
#

Hello

quasi depot
#

?

earnest phoenix
#

Hi everyone

#

How are you

#

I’m good

quasi depot
#

...

earnest phoenix
#

I hope everyone is having or has had a nice day

#

:))

quasi depot
#

ty.........................

rustic nova
#

this is for help with development, if you want to talk in general, use #general instead

#

thank you

sharp saddle
earnest phoenix
#

I got autism and adhd I never saw

quasi depot
rustic nova
quasi depot
#

Well, I know that, is there a alternate way to download that.

wheat mesa
#

Also you should probably ask more specific questions, I've noticed you have a tendency to just post an error message with nothing else attached

#

See, like that

quasi depot
#

My bad.

#

I will try to explain with the post.

wheat mesa
#

Try doing yarn global add serve

#

Then do the serve command

quasi depot
#

Already did that.

rustic nova
#

may need a terminal restart fyi

#

if that's windows as I'm seeing

wheat mesa
#

^

#

VSC's terminal doesn't update sometimes

rustic nova
#

since adding a new PATH command requires restarting of the terminal

quasi depot
#

I reopened.

wheat mesa
#

But did you FULLY restart the terminal

rustic nova
#

Like, close and open

quasi depot
#

No

wheat mesa
#

Aka click the little trashcan button in the top right of the terminal in VSC

rustic nova
#

fully

quasi depot
#

Would I need to re install the serve?

wheat mesa
#

no

quasi depot
wheat mesa
#

Are you sure you're in the right directory

#

Actually that shouldn't matter I don't think

quasi depot
#

yes.

rustic nova
#

do %PATH%

#

or well, sec

#

yeah am not too sure how node or yarn handles packages, so can't help myself

quasi depot
#

Nevermind, Downloaded it with npm install -g server and it works, Thanks.

wheat mesa
#

ah yes, the classic combining yarn and npm for some reason

quasi depot
#

I don't know how I would be able to ask this but like, The website is up and running but something doesnt work nor gives me a error.

lament rock
#

then the logic is probably flawed or the error handling doesnt get to stderr

lyric mountain
timid bronze
#

😔 Waiting for my bot to be approved...

earnest phoenix
earnest phoenix
#

Hello everyone, how to fix error discordapierror : missing permission but don’t crash bot?

neon leaf
#

how can I check if a User is the Owner of the Guild?

atomic sun
lofty cedar
#

In discord.py there Is a on commands error event but i think if you know the error you should handle It by itself to provide a detailed description of what's wrong

rigid maple
#

I want the lines outside the gray background to be deleted but the function I am using is not working

#

If you pay attention to the upper left part, the lines are overflowing from the background.

#

I want to round the picture and crop those parts

#

the lines in the middle should be visible and the dots in the corner should not

haughty bloom
pale vessel
#

yeah

boreal iron
#

Everything Flazepe writes looks so aggressive…

#

Idk why freerealestate

fervent moss
#

Not realated to d.js but i need help idk if this is right place but yeah....

How do i connect http://152.70.156.177:25588/ this with my domain without actually getting any CName from host?

Like host is a diffrent thing which isn't mainly for website hosting but i use express for bot....
Tho it has ip adress thing...
I wanna connect it to domain with cloudflare or anything
I used portzilla butt.. portzilla only loads for some ppl from uk and us and is not worldwide it is 48 hrs something.
And I'm noob and not into this stuff

pale vessel
#

this channel is for anything development related, not just bots and discord.js

#

you could create an A record pointing to your IP through CF

fervent moss
#

I did like i have a record in my domain and even in cloudflare

boreal iron
#

If your domain already has this ip as target what’s the issue then?

#

http://yourdomain.com:25588/

fervent moss
#

DNS_PROBE_FINISHED_NXDOMAIN shows this 😕

boreal iron
#

When did you change the A record?

fervent moss
#

2 hours less for 48 hrs

#

Should I wait for more time?

#

I added a name(s) in domain do i need to add it in cc?

#

Cf

boreal iron
#

Doesn’t resolve to anything except in china

#

You either did something wrong or have a damn shitty provider

fervent moss
eternal osprey
#

Is anyone familiar with object role modeling? If yes, could anyone tell me if this is correct: “Salesman (Name) and ID (SaleID) visited Customer (Custname) at Date (DateOfVisit).

fervent moss
fervent moss
fervent moss
pale vessel
#

root and www, if you want the domain to be accessible at www.domain.tld

misty minnow
#

How can I add a image in HTML?

#

Is this correct?

civic scroll
misty minnow
#

img src alt=??

civic scroll
#

yes

misty minnow
#

Okay Thank you!

misty minnow
civic scroll
#

huhhhhhhh

#

<img src="YOUR_IMAGE_URL_HERE" alt="">

misty minnow
#

Ah

rustic nova
#

whatever unicode that is

misty minnow
civic scroll
#

" this

rustic nova
#

that's some other unicode quotation mark, not "

civic scroll
#

pov you are using apple keyboard

misty minnow
#

No its a normal keyboard

#

"

civic scroll
#

wew

rustic nova
#

still not a correct quotation mark you're using on the site

civic scroll
#

okay try it

misty minnow
#

Diddnt work. It disappeared

rustic nova
#

whatever one you're using on the site, it's not the correct one, can't help otherwise

earnest phoenix
#

I think they're using the correct quotation mark, their font just displays them differently

#

If it works then it's the correct one

rustic nova
#

nah, had some user before with that

misty minnow
#

I copy and pasted the quatation marks

#

there is no image on the website..

civic scroll
#

invalid image url it is then

earnest phoenix
#

Does it work with the previous quotation marks you had?

rustic nova
#

not a proper direct image url either

#

right click the image on Imgur, copy image url

civic scroll
#

you should have added a .jpg

rustic nova
#

that's an album

misty minnow
civic scroll
#

oh

misty minnow
#

Yeah, there it is!

#

Thank you! @rustic nova

earnest phoenix
#

guys

#

how can i keep my bot 24/7 online

#

😭 i really need help

digital swan
#

turn it on and dont turn it off?

earnest phoenix
#

but i cant keep my pc on

#

all the days

#

forever

digital swan
#

buy a vps

earnest phoenix
#

😭

#

i dont have money

#

im 14

#

;/

digital swan
#

buy a raspberry pi and run it off that

earnest phoenix
#

.-.

#

but the error that shws me

#

what it means

digital swan
#

"web process failed to bind to $port within 60 seconds of launch"

earnest phoenix
#

so?

digital swan
#

im no heroku expert but you could google that and most likely find a way to fix it

earnest phoenix
#

ok

#

@digital swan

#

where i add it?

digital swan
#

so in your code you have to listen to that port to prevent it getting shut down

earnest phoenix
#

how...

digital swan
#

do you know how to code?

earnest phoenix
#

no alot

digital swan
#

ok well im assuming you could just have an express app listen to that port and it would prevent it being shutdown

earnest phoenix
#

.....

#

i still cant comprend you

vivid fulcrum
#

heroku is terminating their free plan in a month and a half anyway

earnest phoenix
#

a

quartz kindle
#

google has a free vps

#

and its much better than heroku btw

#

but you need a credit card to verify your account, you will need to borrow one from your family if you dont have one

#

explain to them that its free, and you need it to study programming

rustic nova
#

guess you're not the only one

spark flint
#

AWS has a good free VPS too

rustic nova
#

still generally against free stuff, as there's no direct relation to who's the actual product now: The user or the vps

spark flint
#

True

#

I know a good cheap VPS, https://advinservers.com have a good $2 a month VPS with 2gb ram and I’ve used them for roughly a year with little to no problems

#

Or https://time4vps.com have some good container vps servers (not as good as their main line of servers but still pretty good)

surreal sage
#

I've got a !help command,
I have 2 fields (arrays) in the embed with the commands listed
I'm getting a "Must be 1024.... in length", I know what the error means but I need help knowing once it's close or over 1024

#
        let categories = { Other: [] };
        Object.keys(commands).forEach((key) => {
            let cmd = commands[key];
            if (cmd.isAlias) return;
            if (cmd.hidden) return;
            if (cmd.category) {
                if (!categories[cmd.category]) categories[cmd.category] = [];
                categories[cmd.category].push(cmd);
            } else {
                categories.Other.push(cmd);
            }
        });
        const emoji = config.commands.help.divider;
        let field0 = [];
        let field1 = [];
        let selectMenuOptions = [];
        Object.keys(categories).forEach((key) => {
            selectMenuOptions.push({
                label: key,
                description: `${categories[key].length} command${categories[key].length != 1 ? "s" : ""}`,
                value: key,
                emoji: client.emojis.cache.get(emoji.split(":")[1].replace(">", "")),
            });
            if (field0.length <= field1.length) {
                field0.push(`${emoji}**${key}** I ${categories[key].length} command${categories[key].length != 1 ? "s" : ""}`);
            } else {
                field1.push(`${emoji}**${key}** I ${categories[key].length} command${categories[key].length != 1 ? "s" : ""}`);
            }
        });

        let embed = new MessageEmbed({
            color: config.bot.color,
            title: "Command Categories",
            author: {
                name: client.user.username,
                icon_url: client.user.avatarURL(),
            },
        });

        if (field0.length >= 1) {
            embed.addFields([
                {
                    name: "\u200b",
                    value: field0.join("\n"),
                    inline: true,
                },
            ]);
        }
        if (field1.length >= 1) {
            embed.addFields([
                {
                    name: "\u200b",
                    value: field1.join("\n"),
                    inline: true,
                },
            ]);
        }```
#

Or should I say, split an array once the joined value length (array.join("").length) is close or over 1024

surreal sage
#

1024*(field.value.length)/1000000 should do it getting the index in an array

verbal frost
#

Maybe I'm misunderstanding somethinf but that exact code worked for weeks and now it doesn't without changing anything

earnest phoenix
civic scroll
#

a

#

cu dung cai event la duoc

#

i mean

civic scroll
#

replace the client with one that you used to define the bot client

earnest phoenix
#

Đặt cái code đó ở file nào

#

Index.js hay commands

earnest phoenix
civic scroll
#

with the code specified, it won't crash the bot

#

ah

#

i see what you want

#

you can wrap the possibly error code in a try / catch block

civic scroll
#
try {
     doSomethingPossiblyErrorProne(args);
} catch(e) {
    // this block of code only gets executed if the try block got errors
    notifyError(e);
} finally {
    // possibly clean-up code here
    // this block is optional
}
#

also you should probably study language fundamentals before keep doing

eternal osprey
#

Hey does anyone know if i am calculating the times correctly? Because for some reason my bot is saying that the converted time is in fuking februari... while the selected timezone is GMT + 1

#
const date = new Date().getTime()
        let g = test[interaction.options.getString('keyword')].time
        let newtime = (Number(g) * 24 * 60 * 60 * 1000 ) + date
        console.log(newtime)```
#

Because GMT +1 means urrent gmt time + 1 hour right? Or is there a certain calculation for that?

rustic nova
#

now here comes the catch

some timezones have daylight saving

#

so you have to also handle that

civic scroll
#

just use Intl API

rustic nova
#

I really really really suggest you to use a already made library for that

#

A web app that works out how many seconds ago something happened. How hard can coding that be? Tom Scott explains how time twists and turns like a twisty-turny thing. It's not to be trifled with!

A Universe of Triangles: http://www.youtube.com/watch?v=KdyvizaygyY
LZ Compression in Text: http://www.youtube.com/watch?v=goOa3DGezUA
Characters, Sym...

▶ Play video
eternal osprey
rustic nova
#
eternal osprey
#

all of them required actual place names such as 'Australia/Sydney' instead of EST or PST

rustic nova
#

yes, that is normal

radiant kraken
rustic nova
#

you'd need to convert that yourself from the UTC something to the place

#

also it does support it wdym

earnest phoenix
rustic nova
#

anything that doesnt have you make time manually

radiant kraken
earnest phoenix
#

Yes

#

It wraps the built-in date API which already handles all of that

eternal osprey
#

time was sadly removed from npm

#

what the actual fuck

#
        let d = DateTime.now().setZone(database[interaction.options.getString('keyword')].timezone)```
rustic nova
#

oh thats discord timestamps

#

its seconds, not milliseconds

eternal osprey
#

Owhhh

rustic nova
#

so just divide by 1000 technically

eternal osprey
#

I think that there's more wrong to it

rustic nova
#

yeah you'll need to round it

#

or the library gives you the rounded one directly

eternal osprey
#

It's not really working as gmt +8 returns me my own current time

#

while the timezone is GMT +8 so should display 21:07

#

instead of 3:07

rustic nova
#

sounds correct to me, the gmt timezone + 8?

eternal osprey
#

no it displays my own time

#

while it should display 21:07

solemn latch
#

Doesn't discord timestamps always show your timezone?

#

They correct for that on discords end

#

Iirc

eternal osprey
#

Ah really

rustic nova
#

honestly

#

you dont even need to convert stuff

#

like woo said, discord does that, so you'll only need the unix time

#

though you might need to directly send it instead of using discords timestamps

eternal osprey
#

i see

#

I see why it's not working

#

it's basically not accepting GMT +8, PST, EST etc etc as timezone

#

Only actualy city names

#

what should i do?

earnest phoenix
#

Hi guys where do you guys live

eternal osprey
eternal osprey
earnest phoenix
#

ℂ𝕆𝕆𝕃

eternal osprey
#

nah just kidding i am from the Republic of Congo

earnest phoenix
#

Cool

eternal osprey
#
var d = DateTime.now().setZone('China/Beijing')```i am losing my mind
#

how can this not work

earnest phoenix
#

Huh i heard Singapore is 7 hours infront

quasi depot
#

I have rust downloaded but gives me this error.

quartz kindle
#

the error is pretty well explained

eternal osprey
#

no package works

#

like literally none

quartz kindle
#

accronyms like EST, PST, etc are not valid timezone identifiers because there are duplicates, different countries/cities that use the same accronym to mean two different offsets, and also due to daylight savings time, which these accronyms do not account for

#

for your particular use case, its better for you to have the user specify the offset in hours

#

instead of an accronym

#

but that still wont account for daylight savings

#

how long are you going to save that information? is it like a database where each user has a "timezone"?

quasi depot
spark flint
#

yep

quartz kindle
dry imp
#

kinda need a cheap vps just for testing purposes

quasi depot
#

Quit unable to understand the error, You mind explaining it to me?

#

Don’t waste your time.

#

Just fixed it.

quartz kindle
quasi depot
#

Downloading a customized version of rust should fix the problem.

#

Also another error.

#

Tried doing sudo apt-get install libssl-dev.

#

To fix the problem but same error.

wheat mesa
#

Idk how you’ve had so many errors with CLI tools in the past few days

quasi depot
#

This is the source I am using, Trying to run the web, What would be the command for that?

feral aspen
quartz kindle
feral aspen
#

Oh, what now?

quartz kindle
#

why do you need https?

feral aspen
#

I'm not really using https except to use the .get() method.

quartz kindle
#

browsers have fetch and xmlhttprequest

feral aspen
#

And there's also os which I can't use.

#

Oh, wait hold on.

feral aspen
feral aspen
quartz kindle
feral aspen
#
fetch('https://api.dictionaryapi.dev/api/v2/entries/en/meow')
.then((response) => response.json())
.then((data) => console.log(data));
#

fetch failed cause: TypeError: Argument is not a ByteString

quartz kindle
#

umm wat

#

is that your actual code?

#

the error is saying the url is not a string

feral aspen
#

Yup, that's my code. 💀

quartz kindle
#

i mean

#

youre running that in node

#

its supposed to be run in a browser

#

but it should work in node too since v18

feral aspen
#

I'm yet so confused.

quasi depot
#

Is there a need for jwt token?

frigid canyon
#

Better you hide the token

#

Many people could login

spark flint
#

thats not a bot token

#

so

quasi depot
#

soooo

#

jwt_secret = "1234567890" # The secret for tokens

#

tokens as of bot token?

boreal iron
#

What are you actually talking about

quasi depot
lyric mountain
#

Don't show the token like that

#

Sigh

quasi depot
#

not the best.

lyric mountain
#

The token is still there

quasi depot
#

well you know the error.

lyric mountain
#

The error yes, but not the code

boreal iron
#

Why building it yourself?

#

Just go to release and download the latest version

#

Or is that a runtime error?

quasi depot
#

cargo build --release

neon leaf
#

how can I get the amount of users of every guild the bot is in combined? aka its in for example 2 servers, 1 has 10 users and 2 has 56 users, I should get 66 as output (discord.js)

quartz kindle
#

you have to loop over all guilds and add up their member counts

eternal osprey
#

Hey hey, does anyone know how i could find the center in this program?

#

We are not allowed to use ints

#

and we also constantly have variating border sizes.

#

@lyric mountain might be a question for you XD

civic scroll
eternal osprey
#

nope

#

you only get dropped in a situation like this

#

while the border height and width change each scenario

#

and the bot (arrow) must find the center for each one

quartz kindle
#

is it always square?

eternal osprey
#

yeah

sudden geyser
#

is this for collegeboard or something

eternal osprey
#

but mind that we cannot use ints, returns etc

#

yeah its for my uni

quartz kindle
#

then first thing is determine the height and width

#

the bot cannot remember how far it walked?

eternal osprey
#

we have functions step(), in_front_of_wall(), on_ball(), turn_right, turn_left

quartz kindle
#

you cant count the number of steps?

eternal osprey
#

nope as we cannot use ints

lament rock
#

just do it with floats then? XD

quartz kindle
#

lmao

#

i dont see how it can be done without the bot somehow remembering how far it walked

#

for example, walk forward until you hit a wall

feral aspen
#

Unless you have defined the width and height of each square.

eternal osprey
#

A possible strategy to find the center of the earth is to keep placing balls at opposing walls of Charles
world, until they meet. At that position, you have found the middle of one the axes of Charles world.
This is illustrated in the figure below:

quartz kindle
#

ah so you place balls?

eternal osprey
#

yeah

#

put_bal()

#

put_ball()

quartz kindle
#

so basically

lament rock
#

oh so the world size changes?

eternal osprey
lament rock
#

do you know the tile count?

eternal osprey
#

it can have 100 variances where the hight and width changes

eternal osprey
quartz kindle
#

walk forward until wall, place ball, walk backwards until wall, place ball, walk forward until ball, place ball, walk backwards until ball, place ball, etc until you hit the center

#

then repeat on the other axis

eternal osprey
boreal iron
#

if left and right are balls

quartz kindle
#

it will reach a point where it cannot move to a non-ball place anymore

boreal iron
#

or up and down depending on which way you go

eternal osprey
#

YOU ARE A GENIUS

#

i didn't even thing of that

lament rock
#

do you know where your balls are located?

boreal iron
feral aspen
quartz kindle
#

under the belly

feral aspen
#

LMAO.

eternal osprey
lament rock
#

ok

boreal iron
#

imagine width and height has an even number of boxes

lyric mountain
eternal osprey
#

i kn0w

#

i have a problem btw guys

#

so our initial plan might not work

#

as on_ball() only works if you are standing on it instead of in front of it

boreal iron
#

well then turn 180° and step one back

#

only until stepping back makes you also be on a ball

#

you would then need to turn 180° again and go back once

lyric mountain
#

yes that's why I made the undo() function in the other example

boreal iron
#

means you're in the middle

eternal osprey
#

No look let me send you an example

#
 while(!north()){
    
  if(!in_front_of_wall()){
  step();
      put_ball();
     
  }else{
     turn_right();
    turn_right();
  }
  
   
}```I have used this, but there's a problem
#

imagine that i am on a ball, it will error

ancient nova
eternal osprey
#

and how would i make the program stop as soon as only 1 tile is left?

#

Like that's not even possible

#

Bro my teachers are fucking me realtime

ancient nova
#

loop over all tiles and check if they are a ball or not

#

🤨

eternal osprey
#

What

boreal iron
#

do you always start in a corner for this case?

eternal osprey
#

Yes

quartz kindle
#

walk until you find a ball, then walk 1 step backwards

boreal iron
eternal osprey
eternal osprey
quartz kindle
#

yes i knw

eternal osprey
#

but only function available in regards of looking direction is north()

quartz kindle
#

the first ball you place when you hit a wall

boreal iron
# eternal osprey always looking east

easy then, as first put a ball, then walk UNTIL you're in front of a wall, put another ball, then turn 180°, walk UNTIL you're on a ball, turn 180° step one, place ball, and so on

eternal osprey
#

you can only use on_ball() when you are on a ball

boreal iron
#

read carefully

#

I know

quartz kindle
#

walk UNTIL you're on a ball, turn 180° step one, place ball

boreal iron
#

except the first ball the procedure is always the same

#

on ball = 180° turn, step one, place ball

#

when stepping one, check if you're ON a ball

#

if so you have filled the X axis with balls

#

in that moment, you turn 180° a last time and step once

#

and your in the centre

#

now the same procedure for the Y axis

#

but the FIRST action is NOT to place a ball

#

since it's already there#

eternal osprey
#

but i would constantly have to create while loops

quartz kindle
#

you can use recursive functions

boreal iron
#

the procedure repeats for both axis until you're stepping forward and being on a ball, then break it

eternal osprey
#
while(!in_front_of_wall()){
    put_ball();
        step();
  }  
  turn_right();
  turn_right();
   while(!in_front_of_wall()){
    put_ball();
        step();
  }  
  turn_right();
  turn_right();
 while(!on_ball){
   step();
 }
 turn_right();
 turn_right();
 step();
 put_ball();```
#

I would have to constantly use while loops

#

however we don't know what the width of the box is

#

so we cannot use such approach

sharp geyser
#

Are those while loops being nested in a while loop a good idea?

#

Unless there is a way to break out of them

#

or wait is that while loop being ended nevermind

#

that formatting fucked up my view on it

sharp geyser
#

is this for some school project or smth?

lyric mountain
#

it is, and the teacher imposes ridiculous conditions

sharp geyser
#

are we allowed to help with this?

lyric mountain
#

idk

cinder patio
#

no let me tell their teacher rn

eternal osprey
#

It doesn't count for a grade iirc

sharp geyser
#

then its cool

eternal osprey
#

it's just homework

sharp geyser
#

I just don't think helping someone with a graded project is the right thing to do. As it would be mostly us telling him what to do and him learning nothing

boreal iron
cinder patio
#

so you can't use any variables at all?

eternal osprey
#

nope

sharp geyser
#

What are the conditions

boreal iron
#

You still can use statements inside the loop

eternal osprey
#

only functions, if statements, put_ball(), on_ball(), in_front_of_wall(), get_ball(),turn_right/leftm step()

sharp geyser
#

this sounds familiar

boreal iron
#

He can create his own functions check if he’s on all ball or not to do the required steps

sharp geyser
#

I did something similar in my cs class that wasn't worth shit

boreal iron
#

And use it as statement inside the loop

eternal osprey
earnest phoenix
#

The hell is this goofy ass "homework"

lyric mountain
# sharp geyser What are the conditions
  • no value-returning functions
  • no break
  • no arrays
  • you cannot know the next tile without stepping first (except if it's a wall)
  • you cannot know the dimensions of the map
sharp geyser
lyric mountain
#

oh and no pointers

sharp geyser
eternal osprey
lyric mountain
sharp geyser
#

😔

eternal osprey
#

I am killing myself

lyric mountain
#

like, there's no way to retrieve the dimensions

sharp geyser
#

This some wack ass shit bro

boreal iron
#

Is this exercise a local program or available online?

sharp geyser
eternal osprey
#

it's c__

#

c++

sharp geyser
#

Oh fun

rigid maple
#

I want the lines outside the gray background to be deleted but the function I am using is not working

#

the lines in the middle should be visible and the dots in the corner should not

eternal osprey
#

and no I sadly cannot provide you the program as you gotta login using the students number and password

lyric mountain
sharp geyser
#

give us your student number and password /s

boreal iron
#

And credit card information

rigid maple
#

lines can change color

sharp geyser
eternal osprey
#

Right now i got this far, but then it of course reaches a ball he placed earlier on and tries to put another ball which causes a rash

boreal iron
lyric mountain
#

a mask should always be BW

#

simply set alpha to be how white the mask is at that part

#

white means 255, black means 0, interpolate for other tones

boreal iron
#

But check if you’re not already on a ball

#

That procedure is just a repeating process

eternal osprey
#
  while(!north()){
  if(!in_front_of_wall()){
    step();
  }else{
    turn_right();
    turn_right();
    if(!on_ball()){
put_ball();
    }else{
step();
put_ball();
    }
   
  }
  }  ```i know, i got this far now. So it basically goes on, till there's a gap. However, how does the bot know that he's on the last tile?
cinder patio
#

I feel like this is pretty easy, but I don't have an env to test so I can't really be sure

boreal iron
#

What’s north()?

lyric mountain
#

it kinda is, simply track the amount of steps until the next ball, divide by two and step that amount

boreal iron
#

A function to check the facing angle?

lyric mountain
#

then turn 90deg and repeat

#

you'll always end at the middle

eternal osprey
#

to check if it's looking north

eternal osprey
lyric mountain
#

wtf

eternal osprey
#

so how would i be able to track balls placed lmao

boreal iron
#

Is there any direction or just north?

eternal osprey
#

just noeth

boreal iron
#

Yes that confirms that the mentioned way is exactly what they expect you to do

#

As the last step would be from down to up being on a ball, turning 180 going down again and you’re in the middle of the y axis

eternal osprey
#

Waaaaht

boreal iron
#

It’s the same procedure like for the x axis

#

Like I explained above

eternal osprey
#

yeah but i am still stuck at the x-asix code

boreal iron
#

Taking a shower real quick

#

Be so kind and send the entire code incl all prebuilt functions please and ping me

#

Maybe not in a code block oldEyes

eternal osprey
#
void find_center_agent()
{

while(!in_front_of_wall()){
  put_ball();
  step();
}
  
  
 
 
   
}```is what i have rn
#

I deleted the rest

sharp geyser
#

is there documentation on premade functions?

eternal osprey
#

no, but all the functions are: step(), north(), turn_right()/left, on_ball(), in_front_of_wall(), get_ball(), put_ball()

#

this is all

#

most of them are boolean functions

sharp geyser
#

I see

boreal iron
#

Yeah brb

#

How do you actually end the code?

eternal osprey
#

only with a certain condition

#

so imagine i use a while loop with !north

#

I could first do everything, then at the end once it's in the center look up north

boreal iron
#

does that mean you don't actually have to place balls on the y axis?

#

you can turn around 360° on each step down as long as you not in front of a wall

#

when being in the middle of the y axis and looking north the script would be done, right?

#

no matter balls or placed or not?!

#

@eternal osprey

eternal osprey
#

You don't have to place balls as long as you find the middle

boreal iron
#

so lol

quasi depot
#

is there a hiring channel?>>

boreal iron
boreal iron
eternal osprey
#

like in the code

boreal iron
#

ah ok

quasi depot
#

Cargo.toml "port" category?
With category I mean e.g. [dependencies]

eternal osprey
#

yeah i am so stuck that i think to just give up

boreal iron
#

lemme try something

eternal osprey
#

alrighty thank you very much

#

let me know if you need anything

boreal iron
#

I'll ping u

quasi depot