Jump to content
  • 0

is this correct?


Question

Posted

public List<FakePlayer> getFakePlayers() {
        return World.getInstance().getPlayers().stream().filter(x -> x instanceof FakePlayer && !x.isInsideZone(ZoneId.PEACE)).map(x -> (FakePlayer) x)

 

i want to get the count of fakeplayers that are not inside a peacefull zone

5 answers to this question

Recommended Posts

  • 1
Posted

If you want only the count and not a list with all those fakes, change the return type to long (since you are looking for a value) and use the method .count()

 

public long getFakePlayers() 
{
    return World.getInstance().getPlayers().stream().filter(x -> x instanceof FakePlayer && !x.isInsideZone(ZoneId.PEACE)).count();
}

  • 0
Posted (edited)
On 12/17/2020 at 8:31 AM, arm4729 said:

public List<FakePlayer> getFakePlayers() {
        return World.getInstance().getPlayers().stream().filter(x -> x instanceof FakePlayer && !x.isInsideZone(ZoneId.PEACE)).map(x -> (FakePlayer) x)

 

i want to get the count of fakeplayers that are not inside a peacefull zone

Just collect them to list

Edited by Zake
  • 0
Posted (edited)

hey thank you i was after many minutes of trying to make 2 separate task for walkers and others 

8 hours ago, melron said:

If you want only the count and not a list with all those fakes, change the return type to long (since you are looking for a value) and use the method .count()

 

public long getFakePlayers() 
{
    return World.getInstance().getPlayers().stream().filter(x -> x instanceof FakePlayer && !x.isInsideZone(ZoneId.PEACE)).count();
}

i need a list to make all fakeplayers that are inside town to use a other separate aitask from players that are in combat zone , i am trying to spawn 100 bots ... 30 in town and 60 in lets say monastery of sillence and pagans temple i want to get best performance out of them because sometime they get stuck and get an error in console about aitask 

 

 

i changed this and i google it a bit , i was trying to get best performance for 100 spawned bots do you have any suggestions ? 

 

 

# Specifies how many threads will be in a single scheduled pool.
ThreadsPerScheduledThreadPool = 33 (it was 4)

# Determines the amount of instant thread pools. If set to -1, the server will decide the amount depending on the available processors.
InstantThreadPoolCount = -1

# Specifies how many threads will be in a single instant pool.
ThreadsPerInstantThreadPool = 33 (it was 8)

and im using separate iterations for walkers and others that are in combat

    private final int aiTaskRunnerInterval = 180;
    private final int _playerCountPerTask = 193; (this is combaT)

 

    private final int aiTaskRunnerInterval = 4800;
    private final int _playerCountPerTask = 93;(this is walkers)

 

i dont know if im doing something good here but bots are running better 

cpu dual core 2.39ghz

Edited by arm4729
  • 0
Posted
16 minutes ago, arm4729 said:

hey thank you i was after many minutes of trying to make 2 separate task for walkers and others 

i need a list to make all fakeplayers that are inside town to use a other separate aitask from players that are in combat zone , i am trying to spawn 100 bots ... 30 in town and 60 in lets say monastery of sillence and pagans temple i want to get best performance out of them because sometime they get stuck and get an error in console about aitask 

 

 

Can you explain it better? You need to move out of town 60 bots at different locations OR to 'create' 100 bots (30 spawn at town, 60 at not peace zones) ?

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...