Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   alllplayers (https://forums.graalonline.com/forums/showthread.php?t=76430)

DustyPorViva 08-22-2007 05:52 AM

alllplayers
 
After talking to someone about one of my scripts, it got me to thinking about allplayers.
Why does it return the NPC server, why does it return IRC bots, why does it return players from other servers if they are on your buddylist?
From a scripting perspective, I don't think we really need all that information, who uses allplayers for IRC bots and players from other servers? I think allplayers should be reserved strictly for players on the server, and maybe another variable to get all the other info.

PrinceOfKenshin 08-22-2007 06:43 AM

Atrius uses allplayers.

DustyPorViva 08-22-2007 07:04 AM

Ya, but do you use it to get info on IRC bots?
Anytime I use it, I had to add more just to filter out the NPC server, IRC bots and players from other servers. What's the point when you can't even have scripts interact with them?

zokemon 08-22-2007 10:10 AM

-Playerlist does.

Inverness 08-22-2007 11:08 AM

Quote:

Originally Posted by zokemon (Post 1342194)
-Playerlist does.

And there you have it.

Make a function like getRealPlayers() that filters it for you.

DustyPorViva 08-22-2007 05:49 PM

Ya, but I think that's the only script that'd ever have to use it, don't you think? Maybe there should be a variable getplayerlist or something that returns all players shown in the playerlist(as it seems that's exactly what allplayers does), and just leave allplayers reserved for actual players on the server.

xXziroXx 08-23-2007 07:20 AM

PHP Code:

requesttext("pmserverplayers"str servername); 

:)

PrinceOfKenshin 08-23-2007 01:44 PM

why dont you just do

realplayer= find(allplayers);

i am on my psp so i couldnt put the script in php

Admins 08-23-2007 02:12 PM

allplayers[] always included all players: normal clients and RCs etc. I am not sure where the problem is.

Inverness 08-23-2007 03:02 PM

Quote:

Originally Posted by Stefan (Post 1342441)
allplayers[] always included all players: normal clients and RCs etc. I am not sure where the problem is.

Hes just being lazy and wants an array that only contains the actual player clients connected to the server and not the "virtual" players like the npcserver, IRC bots, and players on other servers that are appearing in your buddy list.

DustyPorViva 08-23-2007 07:57 PM

I wouldn't consider it being lazy, I just don't see the point. The only thing that really has a use for it is the -playerlist, which we can't really do anything with, so why should we have to filter out all the other stuff? You'd think allplayers would be for just actual players, and there'd be another variable for all clients.

xXziroXx 08-23-2007 09:35 PM

Quote:

Originally Posted by xXziroXx (Post 1342411)
PHP Code:

requesttext("pmserverplayers"str servername); 

:)

Hello?

Inverness 08-24-2007 03:38 AM

Quote:

Originally Posted by xXziroXx (Post 1342538)
Hello?

#1. Last time I checked, requesttext() and sendtext() were clientside only.
#2. I believe using that triggers a separate function for the information you're receiving, which is not ideal.
#3. I thought requesttext() and sendtext() were disabled for all but the login server.

zokemon 08-24-2007 07:14 AM

Quote:

Originally Posted by Inverness (Post 1342578)
#1. Last time I checked, requesttext() and sendtext() were clientside only.
#2. I believe using that triggers a separate function for the information you're receiving, which is not ideal.
#3. I thought requesttext() and sendtext() were disabled for all but the login server.

#1. Don't think so.
#2. Yes.
#3. You forgot IRC bots. Only the client-rc stuff was made exclusive.

xXziroXx 08-24-2007 12:12 PM

Quote:

Originally Posted by Inverness (Post 1342578)
#1. Last time I checked, requesttext() and sendtext() were clientside only.
#2. I believe using that triggers a separate function for the information you're receiving, which is not ideal.
#3. I thought requesttext() and sendtext() were disabled for all but the login server.

#1. Nope.
#2. Not everything have to be ideal as long as it works the way its supposed too.
#3. Like Zero said, only the client rc related stuff.


Next time you try smartmouthing me, get your facts straight.

Inverness 08-25-2007 09:28 AM

Quote:

Originally Posted by xXziroXx (Post 1342620)
Next time you try smartmouthing me, get your facts straight.

Quote:

Originally Posted by Inverness
#1. Last time I checked, requesttext() and sendtext() were clientside only.
#2. I believe using that triggers a separate function for the information you're receiving, which is not ideal.
#3. I thought requesttext() and sendtext() were disabled for all but the login server.

I wasn't trying to "smartmouth" you, rather stating my reasons for not wanting to use that method because my knowledge of requesttext() and sendtext() is limited.

Stop being a jackass. You were asking for a response to your statement so I decided to point out why I wouldn't do it that way.

Negative Reputation for that one.

Anyhow, if Stefan wants to add another variable (allrealplayers?) then that would be nice, but I don't think its necessary as I don't really mind adding a line for filtering it. The only difference it would make is that the new variable would filter allplayers on each player login/logout rather than each time you execute the script, and save you a line of typing :rolleyes:

Inverness 08-29-2007 10:33 AM

PHP Code:

function onPlayerLogin(obj)
  if (<
filter conditions>)
    
allrealplayers.add(obj);

function 
onPlayerLogout(obj)
  
allrealplayers.remove(obj); 


zokemon 08-30-2007 06:36 AM

Quote:

Originally Posted by Inverness (Post 1344499)
PHP Code:

function onPlayerLogin(obj)
  if (<
filter conditions>)
    
allrealplayers.add(obj);

function 
onPlayerLogout(obj)
  
allrealplayers.remove(obj); 


I've seen cases where onPlayerLogin and onPlayerLogout failed to execute or the "obj" wasn't the same as the one that logged in (in the case of logout).

Inverness 08-30-2007 12:22 PM

Quote:

Originally Posted by zokemon (Post 1344709)
I've seen cases where onPlayerLogin and onPlayerLogout failed to execute or the "obj" wasn't the same as the one that logged in (in the case of logout).

Not my problem.

I don't mind using allplayers.


All times are GMT +2. The time now is 06:32 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.