help regarding player tracking

Posts 3141 of 41 · Page 3 of 3
I found out why is giving me the error, but its the type of thing thats hard for me to fix since i dont know TypeScript very well, please @ArkMods end my suffering and show me the player-sniper-config document
Quote Originally Posted by Fabi0wZ1 View Post
I found out why is giving me the error, but its the type of thing thats hard for me to fix since i dont know TypeScript very well, please @ArkMods end my suffering and show me the player-sniper-config document
It's not that hard to guess what the structure of the config looks like by just having a look at the code. Let's have a look for any occurrences of the config in Ark's code.

Code:
for (let i = 0; i < config.list.length; i++) {
OK, so there is an array called 'list'.

Code:
player.name.toLowerCase() == config.list[i].name.toLowerCase()) {
The items in that array have a property called 'name' which we know is a string since it's being compared to one here.

Code:
'Found: '+ player.name + ' : ' + config.list[i].type);
The items also have a property called 'type' which is most likely also a string.

Code:
for (let i = 0; i < config.portals.length; i++) {
There is another array called 'portals'.

Code:
update.newObjects[k].objectType == config.portals[i].id
The items in that array have a property called 'id' which we know is a number since its being compared to one here.

Code:
' Found: ' + config.portals[i].name);
The items also have a property called 'name' which is most likely a string.

Putting all of this information together, we can guess that the config looks something like this
Code:
{
    "list": [
        {
            "name": "Eendi",
            "type": "Cool players"
        },
        {
            "name": "Oshyu",
            "type": "Fame Trainers"
        },
        {
            "name": "You get the idea",
            "type": "I hope"
        }
    ],
    "portals": [
        {
            "id": 81942,
            "name": "Ice Tomb Portal"
        },
        {
            "id": 23879423,
            "name": "Cave of a Thousand Treasures"
        }
    ]
}
Quote Originally Posted by Killer Be Killed View Post
It's not that hard to guess what the structure of the config looks like by just having a look at the code. Let's have a look for any occurrences of the config in Ark's code.

Code:
for (let i = 0; i < config.list.length; i++) {
OK, so there is an array called 'list'.

Code:
player.name.toLowerCase() == config.list[i].name.toLowerCase()) {
The items in that array have a property called 'name' which we know is a string since it's being compared to one here.

Code:
'Found: '+ player.name + ' : ' + config.list[i].type);
The items also have a property called 'type' which is most likely also a string.

Code:
for (let i = 0; i < config.portals.length; i++) {
There is another array called 'portals'.

Code:
update.newObjects[k].objectType == config.portals[i].id
The items in that array have a property called 'id' which we know is a number since its being compared to one here.

Code:
' Found: ' + config.portals[i].name);
The items also have a property called 'name' which is most likely a string.

Putting all of this information together, we can guess that the config looks something like this
Code:
{
    "list": [
        {
            "name": "Eendi",
            "type": "Cool players"
        },
        {
            "name": "Oshyu",
            "type": "Fame Trainers"
        },
        {
            "name": "You get the idea",
            "type": "I hope"
        }
    ],
    "portals": [
        {
            "id": 81942,
            "name": "Ice Tomb Portal"
        },
        {
            "id": 23879423,
            "name": "Cave of a Thousand Treasures"
        }
    ]
}
You wont believe how close i was to making it.
Anyway got it up and running thank you so much both @ArkMods and @Killer Be Killed

Last thing where can i find every portal static id? I know its probably in the xml file, just dont know wich one
Quote Originally Posted by Fabi0wZ1 View Post
You wont believe how close i was to making it.
Anyway got it up and running thank you so much both @ArkMods and @Killer Be Killed

Last thing where can i find every portal static id? I know its probably in the xml file, just dont know wich one
nrelay uses the Objects.json file instead of the Objects.xml file and it will automatically download the latest one when it runs so you should already have it. If you search that file for the term
Code:
"Class": "Portal"
You will be able to see all portals. The id field in the config file should correspond to the "type" field in the Objects.json file. For example the Ice tomb portal has a "type" of 0x7fb8

One useful thing about TypeScript (and many other languages) is that using a hexadecimal literal as a number is fine. So you can put "0x7fb8" right into the config file instead of converting it to a decimal number first.
i keep getting this error [18:30:47 | PluginManager] TypeError: Cannot read property 'toLowerCase' of null
on this line of code
Code:
if (player.name != '' && player.name.toLowerCase() == config.list[i].name.toLowerCase()){
why is it giving me null values instead of just an empty string?


it is tracking my accounts, but it's also giving me that error
for now i will have to use without .toLowerCase but it's kinda hard if someone has a hidden realmeye and i dont know which letters in their name is caps locked and wich ones are not, whenever someone can help me i appreciate it
Quote Originally Posted by Fabi0wZ1 View Post
for now i will have to use without .toLowerCase but it's kinda hard if someone has a hidden realmeye and i dont know which letters in their name is caps locked and wich ones are not, whenever someone can help me i appreciate it
cause you're not checking if it's null, null isn't hte same as a empty string, and empty string is still a string, not a null value.

Check it for null not an empty string

if (player.name != null && player.name.toLowerCase() == config.list[i].name.toLowerCase())
{
}

would probably do what you want.
When you process the data from new objects => IPlayerData if the object is not a player <IPlayerData>.name will be an empty string.
Quote Originally Posted by ddddog View Post
@ArkMods @Killer Be Killed could someone add me on skype @ddddog and give me like a walk through cause I have no idea where to begin with tracking players
*******: Ark Died#2791
Ill help for like $5 paypal, I already explained this earlier on the thread...
well nevermind then im a broke boy
Posts 3141 of 41 · Page 3 of 3

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?