offtopic

textPage 14 of 447
50 messages on this page
Thursday, March 27, 2025
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
const axios = require('axios');

const BOT_TOKEN = 'YOUR_BOT_TOKEN';
const GUILD_ID = 'YOUR_GUILD_ID';
const USER_ID = 'TARGET_USER_ID';

axios.get(`https://discord.com/api/v10/guilds/${GUILD_ID}/members/${USER_ID}`, {
  headers: {
    Authorization: `Bot ${BOT_TOKEN}`
  }
})
.then(response => {
  console.log('User roles:', response.data.roles);
})
.catch(error => {
  console.error('Error fetching member info:', error.response?.data || error.message);
});
I'm sure @User 53442821 can pick up from here lol
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
Actually I don't think axios uses curl...
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
Or you can make them inform their steam id on discord too
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
I'm pretty sure you just brain curled me 😂
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
It already can if you make them inform their discord ID in game, just need to fill the info, do the curl with axios and deal with the answer
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
I'd need CSMM to be live until Takaro can pull their discord role
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
No not impossible. I could also have Takaro check their admin privileges and assign it that way.
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
At first look, does not seem impossible
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
curl -X GET "https://discord.com/api/v10/guilds/GUILD_ID/members/USER_ID"
-H "Authorization: Bot YOUR_BOT_TOKEN"
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
Hummm. That would require knowledge about discord api
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
Sorry, CSMM assigns their admin level
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
CSMM assigns their role in CSMM
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
Then what?
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
Yeah
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
Are you using csmm link discord for that?
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
Takaro has no way to pull their discord role
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
Why won't it work with takaro?
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
Ya
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
Do you already have csmm doing it automatically?
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
Maybe have CSMM handle the admin part, then have Takaro check the admin file?
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
How are you getting people to have VIP associated? It would be impossible to do it manually
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
Teleports, vip stuff, once per wipe stuff, statistics... some are just ancient stuff before I started to use expire date
Avatar for a827fb800b970377940da84d66abc498ff76568b3c64de46b25aee9fc715a430
User a827fb
That's a lot of entries! What're they for?
Wednesday, March 26, 2025
Avatar for 6ceaf41ff27d04ff247f59c1bc5a9f4cc4ace95acc526862d52cdbbb8702989b
User 6ceaf4
Maybe not for that...
image.png

image.png

PNG2.7 KB

Monday, March 24, 2025
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
You have been anointed!
Avatar for a827fb800b970377940da84d66abc498ff76568b3c64de46b25aee9fc715a430
User a827fb
Just got a call from council. I am the chosen one!
Friday, March 21, 2025
Avatar for 69dd72e9beda7be7af827395b1f4c2eae3591be65684955a7d6af40731acc13c
User 69dd72
I had not tested if it works hence it is not shared xd
Avatar for 69dd72e9beda7be7af827395b1f4c2eae3591be65684955a7d6af40731acc13c
User 69dd72
I built an afk module based on a cronjob that hold the x y z coordinates and then checks if they moved or not. WHen players are going offline with the next cronjob it deletes those variables as they become irrelevant. Hope to score some points with her @User 22055452 for this best practice<a:RareChar:626427443049136133>
Avatar for 69dd72e9beda7be7af827395b1f4c2eae3591be65684955a7d6af40731acc13c
User 69dd72
otherwise it gets messy
Avatar for 69dd72e9beda7be7af827395b1f4c2eae3591be65684955a7d6af40731acc13c
User 69dd72
Some best practices would be though to include some delete mechanism when you do not need them anymore.
Avatar for a827fb800b970377940da84d66abc498ff76568b3c64de46b25aee9fc715a430
User a827fb
That's great news, thanks. Will make many operations much easier!
Avatar for a827fb800b970377940da84d66abc498ff76568b3c64de46b25aee9fc715a430
User a827fb
@User 25117961 You don't need to use 80+ separate variables!
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
JSON.stringify() to store it
JSON.parse() when you pull it out :p
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Yep!
Avatar for a827fb800b970377940da84d66abc498ff76568b3c64de46b25aee9fc715a430
User a827fb
ooh... so we could stringify an array and store it there?
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Roughly the amount of text in a comprehensive guide to all Trappist monastery beers with their histories and tasting notes
:P
Avatar for 69dd72e9beda7be7af827395b1f4c2eae3591be65684955a7d6af40731acc13c
User 69dd72
Could you make an analogy for the Belgians as well @User 22055452 ?
Avatar for bddf696212701f4e2e40cc177bb39c1f9c5f0a4ce49c307b79e8101c2a98158e
User bddf69
Does maintaining 80+ variables present an unreasonable load on Takaro?
No :p
I made variables able to hold a lot more data semi-recently. From 500ish chars up to 128kb iirc. 128kb is about half of 'Hamlet" or for the americans here, 20 times the length of the declaration of independence. So you probably could fit it all into one var if you wanted to 🤷‍♂️
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
Well, you're smart, I am not, so I wanna hoping input here would be okay,
But assign each one a variable that starts with rr
It'll generate list, lets say 80.
And delete each one each time it's ran.
Each time it hits 0 variables left, it would get a new list.
If you want to add or remove them, just delete variables and a new list would populate
Avatar for a827fb800b970377940da84d66abc498ff76568b3c64de46b25aee9fc715a430
User a827fb
You're very welcome to! Everything I do is to share.
My concerns are:
  • Does maintaining 80+ variables present an unreasonable load on Takaro?
  • When/how do you update the master list? It's quite possible that additional reset regions get added or removed after initial setup?
If variables are big enough to hold the entire list, you'd only need one var. You could remove elements by randomly selected index, then when array.length==0, repopulate it by calling CPM again.
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
Do you mind if I tinker with it and try to get it to assign each one a variable and count them up? Would be neat as all heck to do one every hour!
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
RNGeesus!
Avatar for a827fb800b970377940da84d66abc498ff76568b3c64de46b25aee9fc715a430
User a827fb
Avatar for a827fb800b970377940da84d66abc498ff76568b3c64de46b25aee9fc715a430
User a827fb
Not at the moment. I probably could re-write that way but for now I just trust in Random Number Jesus.
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
Does it know which ones it ran previously so some regions won't get looked over?
Thursday, March 20, 2025
Avatar for a827fb800b970377940da84d66abc498ff76568b3c64de46b25aee9fc715a430
User a827fb
When you set up a new map, you use CPM to flag all regions you want to protect, such as dense city areas. On a 10k map, that's around 80-90 regions. On each run, the module builds a list of those ~80 regions, randomly selects number of regions from that list of ~80, then uses rr 0 on each.
So each server admin needs to consider mudflation and can adjust both the number of regions reset in each run, and how many times a day you run it.
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
@User 12497205 how does reset regions module work? does it reset all of the regions on each cronjob, just spaced out? Or do i need to run it a couple of times a day so it'll reset all of them by the end of the week?
Avatar for a827fb800b970377940da84d66abc498ff76568b3c64de46b25aee9fc715a430
User a827fb
Interview went well. Plenty of smiles, positive body language etc. Find out mid next week.
Avatar for 2fc02addfc2b08cf731c591ce3ec1458095131979eff88a05d79d32a80be0d20
User 2fc02a
While this isn't the correct place for issues https://discord.com/channels/336821518250147850/1132905935224983622 is the best place.
All you need to do is click on the
your profile button
up top and then update discord.
If that doesn't fix it, start a topic in support.