How to get a characters ID from their character name

I am making a money bot, the bot’s syntax will be pretty simple like:
send Username = 100
So my question is

How can I get a character ID from a character name?

1 Like

Call call.core.player.$PLAYERID.getChar with params charName: $FULLNAME. This will return a core.char.$TARGETCID model.

1 Like

That sounds really coo,

1 Like

Cool, Ico! But first some terminology:

Term Description
playerID Unique ID for each account. Same as userID. Only available to admins.
characterID Unique ID for each character. Available to everyone.
CID In the RES Service Protocol, the CID stands for connection ID, which is a unique ID given to each connection for as long as it remains. But I assume you meant the Character ID though, as bots don’t ever see their own connection ID (CID).

Farcaller is correct when it comes to finding a characterID based on a character’s full name.

But in order to see playerID in any way, the bot must be owned by an admin. For non-admins, the only player ID that can be retrieved is ones own.

2 Likes

sorry, i am a little late to the reply, but I asume what you are trying to say is that i cannot get a characterID without the playerID which can only be obtained by an admin?

No worries!

Sorry if I was unclear and muddled up Far’s correct answer:
YES, you can get CHARACTER ID if you have the full name of the character:

If you open Chrome’s developer tools (F12) and click Console, you can try it out yourself:

app.getModule('player').getPlayer()
    .call('getChar', { charName: 'Accipiter Nisus' })
    .then(char => console.log("Character ID: ", char.id));

Result:

Character ID: c0n144ot874c2tqpubpg

Bots can do the same as well.

But you can NOT get another player’s ID (I am talking about their account/user/player ID, not the ID of one of their character). That Player IDs can only be seen by admins.

1 Like

Awesome, thanks boss, when me sparkling new pc is set-up I will continue my development, I just need to add this functionality to the boy’s library and a way to await on these requests in python, and return them to a certain point. In a function >w<… After reading this I think I am going to need to do a major re-write of the library >w< sigh. Hehe.