Game server HTMLs display in hub - Page 2
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Game server HTMLs display in hub

Started by achiever, 20 June, 2007, 08:45:33

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bastya_elvtars

You're welcome. Now admit that you forgot to specify the exact file path. :P
Everything could have been anything else and it would have just as much meaning.

achiever

no i did not i had actually used this
G:\Servers\lan.html

but i think the script requires
G:/Servers/lan.html

u c the difference of \ and /

still gives error when i use the former, thought i kno the round :P

bastya i m thankful to u for making this script,
achiever
thks,
achiever.

bastya_elvtars

You should either use \\ or / in pathnames. Single backslashes serve a different purpose.
Everything could have been anything else and it would have just as much meaning.

achiever

actually i took the address from the html file adress bar which showed G:\Servers\lan.html
thks,
achiever.

achiever

wow mutor this 1 is good too

now have 2 scripts to the same thing :))

thanks far all ur help Bastya & Mutor,
achiever.
thks,
achiever.

bastya_elvtars

C:/Documents and Settings/SWAGAT.JAGIRDAR/Desktop/SERVER
Everything could have been anything else and it would have just as much meaning.

jack_port1000

 i want this path add in script but i dont know where to add so plaese can any one show me where to add?
this the path of html files og game server

bastya_elvtars

--Script Configuration
	local Aux = {
	--Admin's Nick
	OpNick = "Mutor",
	-- Botname pulled from the hub or use "CustomName"
	Bot = frmHub:GetHubBotName(),
	--Always respond in PM? "yes"/"no"
	PmOnly = "no",
	--Path to files [relevant to scripts folder or use absolute path]
	Path = "Servers",
	--Index file name
	Index = "lan.html"
	}


Change the Path variable.
Everything could have been anything else and it would have just as much meaning.

bastya_elvtars

It is not my script, Mutor made it. :-) Therefore I am forwarding your request to him. :-P
Everything could have been anything else and it would have just as much meaning.

jack_port1000

Sorry was pated wrong script  :o



--[[
This is a sample script base dupon my HTML parser
It grabs the content of a specified HTML file
and displays it in given intervals or on-demand.
Requested by achiever.

Distributed under a modified BSD license, see at the end of the file]]

-- Settings.

Timer = 0 -- Set to 0 to disable, otherwise specify the interval in minutes.

Command = "servers" -- The command for getting the serverinfo. NO prefix!

Filename = "C:/Documents and Settings/SWAGAT.JAGIRDAR/Desktop/SERVER/lan.html"

-- End of settings, only edit below if you know what you are doing.

function Main()
  if Timer ~= 0 then
    SetTimer (Timer*60000)
    StartTimer()
  end
end

function ChatArrival (user, data)
  local cmd = string.match (data, "^%b<>%s+[%+%!%-%?%?](%S+)%|$")
  if cmd == Command then
    --user:SendData(frmHub:GetHubBotName(),"\r\n"..HTML_ToText (Filename))
    SendToAll(frmHub:GetHubBotName(),"\r\n"..HTML_ToText (Filename))
    return 1
  end
end

function OnTimer()
  SendToAll(frmHub:GetHubBotName(),"\r\n"..HTML_ToText (Filename))
end

function HTML_ToText (file)
  -- Declare variables, load the file. Make tags lowercase.
  local nl = "\r\n"
  local text
  local f,err=io.open (file)
  if f then
    text = f:read ("*a")
    f:close()
  else
    SendToOps ("*** "..err)
  end
  text = string.gsub (text,"(%b<>)",
  function (tag)
    return tag:lower()
  end)
  --[[ 
  First we kill the developer formatting (tabs, CR, LF)
  and produce a long string with no newlines and tabs.
  We also kill repeated spaces as browsers ignore them anyway.
  ]]
  local devkill=
    {
      ["("..string.char(10)..")"] = " ",
      ["("..string.char(13)..")"] = " ",
      ["("..string.char(15)..")"] = "",
      ["(%s%s+)"]=" ",
    }
  for pat, res in pairs (devkill) do
    text = string.gsub (text, pat, res)
  end
  -- Then we remove the header. We do this by stripping it first.
  text = string.gsub (text, "(<%s*head[^>]*>)", "<head>")
  text = string.gsub (text, "(<%s*%/%s*head%s*>)", "</head>")
  text = string.gsub (text, "(<head>,*<%/head>)", "")
  -- Kill all scripts. First we nuke their attribs.
  text = string.gsub (text, "(<%s*script[^>]*>)", "<script>")
  text = string.gsub (text, "(<%s*%/%s*script%s*>)", "</script>")
  text = string.gsub (text, "(<script>,*<%/script>)", "")
  -- Ok, same for styles.
  text = string.gsub (text, "(<%s*style[^>]*>)", "<style>")
  text = string.gsub (text, "(<%s*%/%s*style%s*>)", "</style>")
  text = string.gsub (text, "(<style>.*<%/style>)", "")
  
  -- Replace <td> and <th> with tabulators.
  text = string.gsub (text, "(<%s*td[^>]*>)","\t")
  text = string.gsub (text, "(<%s*th[^>]*>)","\t")
  
  -- Replace <br> with linebreaks.
  text = string.gsub (text, "(<%s*br%s*%/%s*>)",nl)
  
  -- Replace <li> with an asterisk surrounded by spaces.
  -- Replace </li> with a newline.
  text = string.gsub (text, "(<%s*li%s*%s*>)"," *  ")
  text = string.gsub (text, "(<%s*/%s*li%s*%s*>)",nl)
  
  -- <p>, <div>, <tr>, <ul> will be replaced to a double newline.
  text = string.gsub (text, "(<%s*div[^>]*>)", nl..nl)
  text = string.gsub (text, "(<%s*p[^>]*>)", nl..nl)
  text = string.gsub (text, "(<%s*tr[^>]*>)", nl..nl)
  text = string.gsub (text, "(<%s*%/*%s*ul[^>]*>)", nl..nl)
    
  -- Some petting with the <a> tags. :-P
--[[   local addresses = {}
  local c = 0
  for url,name in string.gfind (text, "<%s*a%s*href=[\'\"](%S-)[\'\"][^>]*>(.+)<%s*%/a%s*>") do
    c = c + 1
    string.gsub (name, "<%s*a%s*href=[^>]+>(.+)<%s*%/a[^>]*>",
    function (nm)
      nm = string.gsub (nm, "(%b<>)","")
      nm = nm.."["..c.."]"
      return nm
    end)
    table.insert (addresses, {url, name})
    print(url, nm)
  end ]]
  
  -- Nuke all other tags now.
  text = string.gsub (text, "(%b<>)","")
  
  -- Replace entities to their correspondant stuff where applicable.
  -- C# is owned badly here by using a table. :-P
  -- A metatable secures entities, so you can add them natively as keys.
  -- Enclosing brackets also get added automatically (capture!)
  local entities = {}
  setmetatable (entities,
  {
    __newindex = function (tbl, key, value)
      key = string.gsub (key, "(%#)" , "%%#")
      key = string.gsub (key, "(%&)" , "%%&")
      key = string.gsub (key, "(%;)" , "%%;")
      key = string.gsub (key, "(.+)" , "("..key..")")
      rawset (tbl, key, value)
    end
  })
  entities = 
  {
    ["&nbsp;"] = " ",
    ["&bull;"] = " *  ",
    ["&lsaquo;"] = "<",
    ["&rsaquo;"] = ">",
    ["&trade;"] = "(tm)",
    ["&frasl;"] = "/",
    ["&lt;"] = "<",
    ["&gt;"] = ">",
    ["&copy;"] = "(c)",
    ["&reg;"] = "(r)",
    -- Then kill all others.
    -- You can customize this table if you would like to, 
    -- I just got bored of copypasting. :-)
    -- http://hotwired.lycos.com/webmonkey/reference/special_characters/
    ["%&.+%;"] = "",
  }
  for entity, repl in pairs (entities) do
    text = string.gsub (text, entity, repl)
  end
--   text = text..nl..nl..("-"):rep(27)..nl..nl
--   
--   for k,v in ipairs (addresses) do
--     text = text.."["..k.."] "..v[1]..nl
--   end
  
  return text
  
end


--[[
Copyright (c) 2007, bastya_elvtars

All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice, this
      list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
    * Neither the name of the author nor the names of contributors may be used
      to endorse or promote products derived from this code without specific
      prior written permission.

THIS CODE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
CODE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
]]

achiever

i think Bastya's script has this option of timed messages
Timer = 0 -- Set to 0 to disable, otherwise specify the interval in minutes.

just put this same as the refresh time of ur software. :)
thks,
achiever.

jack_port1000

some error here

Syntax D:\Hub\terminator\scripts\cs.lua:50: bad argument #1 to 'gsub' (string expected, got nil)

--[[
This is a sample script base dupon my HTML parser
It grabs the content of a specified HTML file
and displays it in given intervals or on-demand.
Requested by achiever.

Distributed under a modified BSD license, see at the end of the file]]

-- Settings.

Timer = 0 -- Set to 0 to disable, otherwise specify the interval in minutes.

Command = "s" -- The command for getting the serverinfo. NO prefix!

Filename = "C:\Documents and Settings\Vinay Bherwani\Desktop\SERVER\lan.html"

-- End of settings, only edit below if you know what you are doing.

function Main()
  if Timer ~= 0 then
    SetTimer (Timer*60000)
    StartTimer()
  end
end

function ChatArrival (user, data)
  local cmd = string.match (data, "^%b<>%s+[%+%!%-%?%?](%S+)%|$")
  if cmd == Command then
    --user:SendData(frmHub:GetHubBotName(),"\r\n"..HTML_ToText (Filename))
    SendToAll(frmHub:GetHubBotName(),"\r\n"..HTML_ToText (Filename))
    return 1
  end
end

function OnTimer()
  SendToAll(frmHub:GetHubBotName(),"\r\n"..HTML_ToText (Filename))
end

function HTML_ToText (file)
  -- Declare variables, load the file. Make tags lowercase.
  local nl = "\r\n"
  local text
  local f,err=io.open (file)
  if f then
    text = f:read ("*a")
    f:close()
  else
    SendToOps ("*** "..err)
  end
  text = string.gsub (text,"(%b<>)",
  function (tag)
    return tag:lower()
  end)
  --[[ 
  First we kill the developer formatting (tabs, CR, LF)
  and produce a long string with no newlines and tabs.
  We also kill repeated spaces as browsers ignore them anyway.
  ]]
  local devkill=
    {
      ["("..string.char(10)..")"] = " ",
      ["("..string.char(13)..")"] = " ",
      ["("..string.char(15)..")"] = "",
      ["(%s%s+)"]=" ",
    }
  for pat, res in pairs (devkill) do
    text = string.gsub (text, pat, res)
  end
  -- Then we remove the header. We do this by stripping it first.
  text = string.gsub (text, "(<%s*head[^>]*>)", "<head>")
  text = string.gsub (text, "(<%s*%/%s*head%s*>)", "</head>")
  text = string.gsub (text, "(<head>,*<%/head>)", "")
  -- Kill all scripts. First we nuke their attribs.
  text = string.gsub (text, "(<%s*script[^>]*>)", "<script>")
  text = string.gsub (text, "(<%s*%/%s*script%s*>)", "</script>")
  text = string.gsub (text, "(<script>,*<%/script>)", "")
  -- Ok, same for styles.
  text = string.gsub (text, "(<%s*style[^>]*>)", "<style>")
  text = string.gsub (text, "(<%s*%/%s*style%s*>)", "</style>")
  text = string.gsub (text, "(<style>.*<%/style>)", "")
  
  -- Replace <td> and <th> with tabulators.
  text = string.gsub (text, "(<%s*td[^>]*>)","\t")
  text = string.gsub (text, "(<%s*th[^>]*>)","\t")
  
  -- Replace <br> with linebreaks.
  text = string.gsub (text, "(<%s*br%s*%/%s*>)",nl)
  
  -- Replace <li> with an asterisk surrounded by spaces.
  -- Replace </li> with a newline.
  text = string.gsub (text, "(<%s*li%s*%s*>)"," *  ")
  text = string.gsub (text, "(<%s*/%s*li%s*%s*>)",nl)
  
  -- <p>, <div>, <tr>, <ul> will be replaced to a double newline.
  text = string.gsub (text, "(<%s*div[^>]*>)", nl..nl)
  text = string.gsub (text, "(<%s*p[^>]*>)", nl..nl)
  text = string.gsub (text, "(<%s*tr[^>]*>)", nl..nl)
  text = string.gsub (text, "(<%s*%/*%s*ul[^>]*>)", nl..nl)
    
  -- Some petting with the <a> tags. :-P
--[[   local addresses = {}
  local c = 0
  for url,name in string.gfind (text, "<%s*a%s*href=[\'\"](%S-)[\'\"][^>]*>(.+)<%s*%/a%s*>") do
    c = c + 1
    string.gsub (name, "<%s*a%s*href=[^>]+>(.+)<%s*%/a[^>]*>",
    function (nm)
      nm = string.gsub (nm, "(%b<>)","")
      nm = nm.."["..c.."]"
      return nm
    end)
    table.insert (addresses, {url, name})
    print(url, nm)
  end ]]
  
  -- Nuke all other tags now.
  text = string.gsub (text, "(%b<>)","")
  
  -- Replace entities to their correspondant stuff where applicable.
  -- C# is owned badly here by using a table. :-P
  -- A metatable secures entities, so you can add them natively as keys.
  -- Enclosing brackets also get added automatically (capture!)
  local entities = {}
  setmetatable (entities,
  {
    __newindex = function (tbl, key, value)
      key = string.gsub (key, "(%#)" , "%%#")
      key = string.gsub (key, "(%&)" , "%%&")
      key = string.gsub (key, "(%;)" , "%%;")
      key = string.gsub (key, "(.+)" , "("..key..")")
      rawset (tbl, key, value)
    end
  })
  entities = 
  {
    ["&nbsp;"] = " ",
    ["&bull;"] = " *  ",
    ["&lsaquo;"] = "<",
    ["&rsaquo;"] = ">",
    ["&trade;"] = "(tm)",
    ["&frasl;"] = "/",
    ["&lt;"] = "<",
    ["&gt;"] = ">",
    ["&copy;"] = "(c)",
    ["&reg;"] = "(r)",
    -- Then kill all others.
    -- You can customize this table if you would like to, 
    -- I just got bored of copypasting. :-)
    -- http://hotwired.lycos.com/webmonkey/reference/special_characters/
    ["%&.+%;"] = "",
  }
  for entity, repl in pairs (entities) do
    text = string.gsub (text, entity, repl)
  end
--   text = text..nl..nl..("-"):rep(27)..nl..nl
--   
--   for k,v in ipairs (addresses) do
--     text = text.."["..k.."] "..v[1]..nl
--   end
  
  return text
  
end


--[[
Copyright (c) 2007, bastya_elvtars

All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice, this
      list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
    * Neither the name of the author nor the names of contributors may be used
      to endorse or promote products derived from this code without specific
      prior written permission.

THIS CODE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
CODE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
]]

Please help for this
Thanks Swagat_j

bastya_elvtars

#37
Does the file exist and contain material?
Edit: Mutor has given me a filesizer checking snippet.
Edit2: Filename = "C:\Documents and Settings\Vinay Bherwani\Desktop\SERVER\lan.html" is wrong. Use it like this:
Code: lua
Filename = "C:\\Documents and Settings\\Vinay Bherwani\\Desktop\\SERVER\\lan.html"



Try this version:
Code: lua
--[[
This is a sample script base dupon my HTML parser
It grabs the content of a specified HTML file
and displays it in given intervals or on-demand.
Requested by achiever.

Distributed under a modified BSD license, see at the end of the file]]

-- Settings.

Timer = 0 -- Set to 0 to disable, otherwise specify the interval in minutes.

Command = "s" -- The command for getting the serverinfo. NO prefix!

Filename = "C:\Documents and Settings\Vinay Bherwani\Desktop\SERVER\lan.html"

-- End of settings, only edit below if you know what you are doing.

function Main()
  if Timer ~= 0 then
    SetTimer (Timer*60000)
    StartTimer()
  end
end

function ChatArrival (user, data)
  local cmd = string.match (data, "^%b<>%s+[%+%!%-%?%?](%S+)%|$")
  if cmd == Command then
    --user:SendData(frmHub:GetHubBotName(),"\r\n"..HTML_ToText (Filename))
    SendToAll(frmHub:GetHubBotName(),"\r\n"..HTML_ToText (Filename))
    return 1
  end
end

function OnTimer()
  SendToAll(frmHub:GetHubBotName(),"\r\n"..HTML_ToText (Filename))
end

function HTML_ToText (file)
  -- Declare variables, load the file. Make tags lowercase.
  local nl = "\r\n"
  local text
  local f,err=io.open (file)
  if f then
    if f:seek("end") <= 0 then 
      SendToOps ("*** ERROR: empty file specified: "..file) return
    end
    text = f:read ("*a")
    f:close()
  else
    SendToOps ("*** "..err)
  end
  text = string.gsub (text,"(%b<>)",
  function (tag)
    return tag:lower()
  end)
  --[[ 
  First we kill the developer formatting (tabs, CR, LF)
  and produce a long string with no newlines and tabs.
  We also kill repeated spaces as browsers ignore them anyway.
  ]]
  local devkill=
    {
      ["("..string.char(10)..")"] = " ",
      ["("..string.char(13)..")"] = " ",
      ["("..string.char(15)..")"] = "",
      ["(%s%s+)"]=" ",
    }
  for pat, res in pairs (devkill) do
    text = string.gsub (text, pat, res)
  end
  -- Then we remove the header. We do this by stripping it first.
  text = string.gsub (text, "(<%s*head[^>]*>)", "<head>")
  text = string.gsub (text, "(<%s*%/%s*head%s*>)", "</head>")
  text = string.gsub (text, "(<head>,*<%/head>)", "")
  -- Kill all scripts. First we nuke their attribs.
  text = string.gsub (text, "(<%s*script[^>]*>)", "<script>")
  text = string.gsub (text, "(<%s*%/%s*script%s*>)", "</script>")
  text = string.gsub (text, "(<script>,*<%/script>)", "")
  -- Ok, same for styles.
  text = string.gsub (text, "(<%s*style[^>]*>)", "<style>")
  text = string.gsub (text, "(<%s*%/%s*style%s*>)", "</style>")
  text = string.gsub (text, "(<style>.*<%/style>)", "")
  
  -- Replace <td> and <th> with tabulators.
  text = string.gsub (text, "(<%s*td[^>]*>)","\t")
  text = string.gsub (text, "(<%s*th[^>]*>)","\t")
  
  -- Replace <br> with linebreaks.
  text = string.gsub (text, "(<%s*br%s*%/%s*>)",nl)
  
  -- Replace <li> with an asterisk surrounded by spaces.
  -- Replace </li> with a newline.
  text = string.gsub (text, "(<%s*li%s*%s*>)"," *  ")
  text = string.gsub (text, "(<%s*/%s*li%s*%s*>)",nl)
  
  -- <p>, <div>, <tr>, <ul> will be replaced to a double newline.
  text = string.gsub (text, "(<%s*div[^>]*>)", nl..nl)
  text = string.gsub (text, "(<%s*p[^>]*>)", nl..nl)
  text = string.gsub (text, "(<%s*tr[^>]*>)", nl..nl)
  text = string.gsub (text, "(<%s*%/*%s*ul[^>]*>)", nl..nl)
    
  -- Some petting with the <a> tags. :-P
--[[   local addresses = {}
  local c = 0
  for url,name in string.gfind (text, "<%s*a%s*href=[\'\"](%S-)[\'\"][^>]*>(.+)<%s*%/a%s*>") do
    c = c + 1
    string.gsub (name, "<%s*a%s*href=[^>]+>(.+)<%s*%/a[^>]*>",
    function (nm)
      nm = string.gsub (nm, "(%b<>)","")
      nm = nm.."["..c.."]"
      return nm
    end)
    table.insert (addresses, {url, name})
    print(url, nm)
  end ]]
  
  -- Nuke all other tags now.
  text = string.gsub (text, "(%b<>)","")
  
  -- Replace entities to their correspondant stuff where applicable.
  -- C# is owned badly here by using a table. :-P
  -- A metatable secures entities, so you can add them natively as keys.
  -- Enclosing brackets also get added automatically (capture!)
  local entities = {}
  setmetatable (entities,
  {
    __newindex = function (tbl, key, value)
      key = string.gsub (key, "(%#)" , "%%#")
      key = string.gsub (key, "(%&)" , "%%&")
      key = string.gsub (key, "(%;)" , "%%;")
      key = string.gsub (key, "(.+)" , "("..key..")")
      rawset (tbl, key, value)
    end
  })
  entities = 
  {
    ["&nbsp;"] = " ",
    ["&bull;"] = " *  ",
    ["&lsaquo;"] = "<",
    ["&rsaquo;"] = ">",
    ["&trade;"] = "(tm)",
    ["&frasl;"] = "/",
    ["&lt;"] = "<",
    ["&gt;"] = ">",
    ["&copy;"] = "(c)",
    ["&reg;"] = "(r)",
    -- Then kill all others.
    -- You can customize this table if you would like to, 
    -- I just got bored of copypasting. :-)
    -- http://hotwired.lycos.com/webmonkey/reference/special_characters/
    ["%&.+%;"] = "",
  }
  for entity, repl in pairs (entities) do
    text = string.gsub (text, entity, repl)
  end
--   text = text..nl..nl..("-"):rep(27)..nl..nl
--   
--   for k,v in ipairs (addresses) do
--     text = text.."["..k.."] "..v[1]..nl
--   end
  
  return text
  
end


--[[
Copyright (c) 2007, bastya_elvtars

All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice, this
      list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
    * Neither the name of the author nor the names of contributors may be used
      to endorse or promote products derived from this code without specific
      prior written permission.

THIS CODE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
CODE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
]]
Everything could have been anything else and it would have just as much meaning.

jack_port1000

Tanx bastya this script has no error but i type in main chat +s it cant showing any html servers

bastya_elvtars

Quote from: swagat_j on 16 July, 2007, 16:54:42
Tanx bastya this script has no error but i type in main chat +s it cant showing any html servers
Ain't there any error messages? Could you please post the file contents (HTML) as code?
Everything could have been anything else and it would have just as much meaning.

bastya_elvtars

Works for me.
  List of servers on our Lan-X    Only at AnnA's Hub enjoy...go...pro...go..  

	#	 Name 	 Address 	 Players 	 State 	 Game 	 Launch!  

 	1 	!!.Re|0@D3D.!! - CS - 1.6 	172.16.16.212:27015 	3/23 	running 	Half-Life/TFC 	GO   

Generated by AnnA on July 16, 2007 exactly at 20:21:20   
Everything could have been anything else and it would have just as much meaning.

jack_port1000

tnx its work for me too problem of path slash i took \(front slash) instead of / (back slash) thatz it.thz for ur co operation
ur forums roxs :)

-KraNz-

hi guys .. m totally new to this .. can ne 1 tell me how do i make tht html file for LAN servers ??

thnx... !

bastya_elvtars

Quote from: achiever on 20 June, 2007, 08:45:33
i have software (aGsm) which gets me the information of our local game servers and save the information as html files.
Everything could have been anything else and it would have just as much meaning.

Yahoo

Sir
I think there is small problem but this time it is not in the script but in the software aGSM suggested by achiever
the problem is tht the when the servers are search through the software it creates different folder everytime in a specified format the name of the folder is like this 2007_12_01_22_09 (year_month_date_hour_min) everytime in this format only

So can the script be change to suit the software
"BoRN FIGhTEr"

bastya_elvtars

Can't it be configured properly? Otherwise the script cannot guess the exact date of the query (ie. it cannot guess where to search, only by dirty tricks.)
Everything could have been anything else and it would have just as much meaning.

Yahoo

i tried all possible things but the output is in different folder everytime.
Infact i asked achiever also but he also told me the same thing

I am also attaching the software u can personally try tht software
"BoRN FIGhTEr"

bastya_elvtars

Uh, then I have to create a folder scanner that parses all folders and selects the latest one. This is not trivial, but can be done.
Everything could have been anything else and it would have just as much meaning.

Yahoo

#48
thank you
i think der is some more prob in the script
when i type the servers command for 4 to 5 times
then after the script didnt work

i had to restart the script again and again i had to
face the same prob and u please look forward to my request


<[HeavY]> 
  List of servers on our LAN    List of servers on LAN 

December 2, 2007 at 15:06:56  

	No.	Name	Address	Players	State	Game	Launch!  

Generated by aGSM v2.35c on December 2, 2007 exactly at 15:06:56   
<[HeavY]> Servers:-

*** Server command: +addserver testing
<[HeavY]>  potter's Server added.Type +servers in main.	
<potter> +addserver testing
*** Server command: +Servers
<[HeavY]> Servers:-
- [ 1 ]	December 02 2007 15:31:28  [ potter's ] Server: testing

<potter> +Servers
*** Server command: +servers
<[HeavY]> 
  List of servers on our LAN    List of servers on LAN 

December 2, 2007 at 15:31:36  

	No.	Name	Address	Players	State	Game	Launch!  

Generated by aGSM v2.35c on December 2, 2007 exactly at 15:31:36   
<[HeavY]> Servers:-
- [ 1 ]	December 02 2007 15:31:28  [ potter's ] Server: testing

*** Server command: +servers
<[HeavY]> 
  List of servers on our LAN    List of servers on LAN 

December 2, 2007 at 15:31:36  

	No.	Name	Address	Players	State	Game	Launch!  

Generated by aGSM v2.35c on December 2, 2007 exactly at 15:31:36   
<[HeavY]> Servers:-
- [ 1 ]	December 02 2007 15:31:28  [ potter's ] Server: testing

*** Server command: +Servers
<[HeavY]> Servers:-
- [ 1 ]	December 02 2007 15:31:28  [ potter's ] Server: testing

<potter> +Servers
*** Server command: +Servers
<[HeavY]> Servers:-
- [ 1 ]	December 02 2007 15:31:28  [ potter's ] Server: testing

<potter> +Servers
*** Server command: +servers
<[HeavY]> Servers:-
- [ 1 ]	December 02 2007 15:31:28  [ potter's ] Server: testing

<potter> +servers
*** Server command: +servers
<[HeavY]> 
  List of servers on our LAN    List of servers on LAN 

December 2, 2007 at 15:32:44  

	No.	Name	Address	Players	State	Game	Launch!  

Generated by aGSM v2.35c on December 2, 2007 exactly at 15:32:44   
<[HeavY]> Servers:-
- [ 1 ]	December 02 2007 15:31:28  [ potter's ] Server: testing

"BoRN FIGhTEr"

SMF spam blocked by CleanTalk