Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-01-2006, 07:30 AM
Omini Omini is offline
Millenium Owner
Join Date: Feb 2006
Location: N.Ireland
Posts: 293
Omini is on a distinguished road
Send a message via AIM to Omini Send a message via MSN to Omini Send a message via Yahoo to Omini
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!;
}

__________________



Reply With Quote
  #2  
Old 06-01-2006, 08:35 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
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...
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #3  
Old 06-01-2006, 10:35 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
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.
__________________
Skyld
Reply With Quote
  #4  
Old 06-01-2006, 10:44 AM
Omini Omini is offline
Millenium Owner
Join Date: Feb 2006
Location: N.Ireland
Posts: 293
Omini is on a distinguished road
Send a message via AIM to Omini Send a message via MSN to Omini Send a message via Yahoo to Omini
Personally I don't use HTML either, but I asked this out of curiousity. Thanks for the replies.
__________________



Reply With Quote
  #5  
Old 06-01-2006, 01:50 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Can't be detected yet, can add variables for it on clientside may be
Reply With Quote
  #6  
Old 06-01-2006, 02:01 PM
Omini Omini is offline
Millenium Owner
Join Date: Feb 2006
Location: N.Ireland
Posts: 293
Omini is on a distinguished road
Send a message via AIM to Omini Send a message via MSN to Omini Send a message via Yahoo to Omini
'yet', so does that mean it will be able to be detected in the future?
__________________



Reply With Quote
  #7  
Old 06-01-2006, 03:44 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
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?
Reply With Quote
  #8  
Old 06-01-2006, 04:25 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
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.
__________________
Skyld
Reply With Quote
  #9  
Old 06-01-2006, 05:30 PM
Omini Omini is offline
Millenium Owner
Join Date: Feb 2006
Location: N.Ireland
Posts: 293
Omini is on a distinguished road
Send a message via AIM to Omini Send a message via MSN to Omini Send a message via Yahoo to 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.
__________________



Reply With Quote
  #10  
Old 06-01-2006, 05:39 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Would be neat, but oh hey - who needs html in Graal?
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #11  
Old 06-01-2006, 05:48 PM
Omini Omini is offline
Millenium Owner
Join Date: Feb 2006
Location: N.Ireland
Posts: 293
Omini is on a distinguished road
Send a message via AIM to Omini Send a message via MSN to Omini Send a message via Yahoo to Omini
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.
__________________



Reply With Quote
  #12  
Old 06-02-2006, 02:11 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
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
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:39 PM.


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