offtopic
textPage 14 of 447
50 messages on this page
Thursday, March 27, 2025
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
User 6ceaf4
Actually I don't think axios uses curl...
User 6ceaf4
Or you can make them inform their steam id on discord too
User 2fc02a
I'm pretty sure you just brain curled me 😂
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
User 2fc02a
I'd need CSMM to be live until Takaro can pull their discord role
User 2fc02a
No not impossible. I could also have Takaro check their admin privileges and assign it that way.
User 6ceaf4
At first look, does not seem impossible
User 6ceaf4
curl -X GET "https://discord.com/api/v10/guilds/GUILD_ID/members/USER_ID"
-H "Authorization: Bot YOUR_BOT_TOKEN"
-H "Authorization: Bot YOUR_BOT_TOKEN"
User 6ceaf4
Hummm. That would require knowledge about discord api
User 2fc02a
Sorry, CSMM assigns their admin level
User 2fc02a
CSMM assigns their role in CSMM
User 6ceaf4
Then what?
User 2fc02a
Yeah
User 6ceaf4
Are you using csmm link discord for that?
User 2fc02a
Takaro has no way to pull their discord role
User 6ceaf4
Why won't it work with takaro?
User 2fc02a
Ya
User 6ceaf4
Do you already have csmm doing it automatically?
User 2fc02a
Maybe have CSMM handle the admin part, then have Takaro check the admin file?
User 2fc02a
How are you getting people to have VIP associated? It would be impossible to do it manually
User 6ceaf4
Teleports, vip stuff, once per wipe stuff, statistics... some are just ancient stuff before I started to use expire date
User a827fb
That's a lot of entries! What're they for?
Wednesday, March 26, 2025
Monday, March 24, 2025
User 2fc02a
You have been anointed!
User a827fb
Just got a call from council. I am the chosen one!
Friday, March 21, 2025
User 69dd72
I had not tested if it works hence it is not shared xd
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>
User 69dd72
otherwise it gets messy
User 69dd72
Some best practices would be though to include some delete mechanism when you do not need them anymore.
User a827fb
That's great news, thanks. Will make many operations much easier!
User a827fb
@User 25117961 You don't need to use 80+ separate variables!
User bddf69
JSON.stringify() to store it
JSON.parse() when you pull it out :p
JSON.parse() when you pull it out :p
User bddf69
Yep!
User a827fb
ooh... so we could stringify an array and store it there?
User bddf69
Roughly the amount of text in a comprehensive guide to all Trappist monastery beers with their histories and tasting notes
:P
User 69dd72
Could you make an analogy for the Belgians as well @User 22055452 ?
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 🤷♂️
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
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
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.
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!
User 2fc02a
RNGeesus!
User a827fb
User a827fb
Not at the moment. I probably could re-write that way but for now I just trust in Random Number Jesus.
User 2fc02a
Does it know which ones it ran previously so some regions won't get looked over?
Thursday, March 20, 2025
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.
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?
User a827fb
Interview went well. Plenty of smiles, positive body language etc. Find out mid next week.
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
If that doesn't fix it, start a topic in support.
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.
