Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Detecting HTML? (https://forums.graalonline.com/forums/showthread.php?t=66384)

Omini 06-01-2006 07:30 AM

Detecting HTML?
 
Is there any way to detect if the player has HTML enabled or not? Lets say in the NPC Server, if the player has HTML it sends a PM (containing HTML) and if HTML is disabled then it sends a different PM?

Example:
NPC Code:
if (htmlenabled) {
sendpm <b>Welcome! to the Server!</b>;
} else {
sendpm Welcome to the Server!;
}


napo_p2p 06-01-2006 08:35 AM

I'm guessing if there was one it would be one of the $pref vars (which would be clientside anyways).

But, I couldn't find one on the wiki, so I am guessing no...

Skyld 06-01-2006 10:35 AM

Quote:

Originally Posted by Omini
Is there any way to detect if the player has HTML enabled or not? Lets say in the NPC Server, if the player has HTML it sends a PM (containing HTML) and if HTML is disabled then it sends a different PM?

Example:
NPC Code:
if (htmlenabled) {
sendpm <b>Welcome! to the Server!</b>;
} else {
sendpm Welcome to the Server!;
}


Personally I don't endorse sending HTML. On linux/mac clients, all the HTML often does not render properly, making it difficult to read.

Omini 06-01-2006 10:44 AM

Personally I don't use HTML either, but I asked this out of curiousity. Thanks for the replies.

Admins 06-01-2006 01:50 PM

Can't be detected yet, can add variables for it on clientside may be

Omini 06-01-2006 02:01 PM

'yet', so does that mean it will be able to be detected in the future?

excaliber7388 06-01-2006 03:44 PM

Quote:

Originally Posted by Skyld
Personally I don't endorse sending HTML. On linux/mac clients, all the HTML often does not render properly, making it difficult to read.

Are you able to detect if a person is using Linux, Mac, or Windows, etc?

Skyld 06-01-2006 04:25 PM

Quote:

Originally Posted by excaliber7388
Are you able to detect if a person is using Linux, Mac, or Windows, etc?

Yes. Using the player.platform variable, I guess you could do something like this:
PHP Code:

if (player.platform in {"linux""mac"})
{
  
player.sendPM("foo");
}
  else
{
  
player.sendPM("bar");


The possible values for player.platform are "linux", "mac" and "win", and the variable is readable from the serverside.

Omini 06-01-2006 05:30 PM

So if you were able to combine the player.platform to see if they're on Windows, then check if HTML is enabled?

ie
NPC Code:
if (player.platform == "win") {
if (htmlenabled) {
sendpm <b>Welcome to the server!</b>;
} else {
sendpm Welcome to the server!;
}
} else {
sendpm Welcome to the server!;
}



Unless you can simplify it some more, which I'm sure is possible.

xXziroXx 06-01-2006 05:39 PM

Would be neat, but oh hey - who needs html in Graal?

Omini 06-01-2006 05:48 PM

Well, it could 'brighten up the welcome message', so to speak. Or use HTML to highlight important points (ie. Rules, commands, etc). That's mainly the only reason why I would use HTML, to point out new paragraph topics.

Example
Quote:

Originally Posted by Imaginary Welcome Message (HTML Enabled)
Welcome to [Server Name]

Rules: (Last Updated 1st June 2006)
Please make sure you keep up to date with the server rules, if you are unsure then please check the forums at [Random link to imaginary forums]

Updates:
New guns are due for release on 8th June.

ETC ETC

It would neaten things out a bit using HTML, and if the person has it disabled then the PM isn't crowded with stupid HTML flags which don't do anything - thus making it easier to read.

ApothiX 06-02-2006 02:11 PM

Quote:

Originally Posted by Omini
So if you were able to combine the player.platform to see if they're on Windows, then check if HTML is enabled?

ie
NPC Code:
if (player.platform == "win") {
if (htmlenabled) {
sendpm <b>Welcome to the server!</b>;
} else {
sendpm Welcome to the server!;
}
} else {
sendpm Welcome to the server!;
}



Unless you can simplify it some more, which I'm sure is possible.

PHP Code:

if(htmlenabled && player.platform == "win") {
  
// ..
} else {
 
// ..


probably


All times are GMT +2. The time now is 10:31 AM.

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