READ THE RULES
0 Members and 1 Guest are viewing this topic.
--[[ GameServer 2.0 LUA 5.1 [Strict] By Mutor 06/20/07 Requested by achiever Reads aGSM html files and displays in hub on command +Changes from 1.0 11/26/09 ~Converted to API 2 strict. +Added context menus [right click]]]--Script Configuration local Aux = { --Admin's Nick OpNick = "Mutor", -- Name for bot ["" = Hub Bot] Bot = "[GameServer]", --Always respond in PM? true/false PmOnly = false, --Path to files [use absolute path] Path = "C:\\PxDev\\scripts\\Servers", --Index file name Index = "lan.html", -- "Command Menu" ["" = hub name] Menu = "", -- "Command SubMenu" ["" = script name] SubMenu = "", -- Script command to fetch server list Cmd = "servers", }local Files,Servers = {},{}OnStartup = function() Aux.Script,Aux.Prefixes = "GameServer 2.0",SetMan.GetString(29) Aux.Prefix = Aux.Prefixes:sub(1,1) if Aux.Bot == "" then Aux.Bot = SetMan.GetString(21) end if Aux.Bot ~= SetMan.GetString(21) then Core.RegBot(Aux.Bot,"","",true) end if Aux.Menu == "" then Aux.Menu = SetMan.GetString(0) end if Aux.SubMenu == "" then Aux.SubMenu = Aux.Script endendOnError = function(msg) local user = Core.GetUser(Aux.OpNick) if user then Core.SendToUser(user,"<"..Aux.Bot.."> "..msg.."|") endendChatArrival = function(user,data) local _,_,cmd = data:lower():find("%b<> ["..Aux.Prefixes.."]("..Aux.Cmd..")|") local to = data:find("$To: "..Aux.Bot.." From:",1,1) if cmd then local s = Parse(Aux.Path.."\\"..Aux.Index) if s then if to or Aux.PmOnly then Core.SendPmToUser(user,Aux.Bot,s.."|") else Core.SendToUser(user,"<"..Aux.Bot.."> "..s.."|") end end return true endendToArrival = ChatArrivalUserConnected = function(user, data) Core.SendToUser(user,"$UserCommand 1 1 "..Aux.Menu.."\\"..Aux.SubMenu.."\\".. "List Game Servers$<%[mynick]> "..Aux.Prefix..Aux.Cmd.."||$UserCommand 1 2 ".. Aux.Menu.."\\"..Aux.SubMenu.."\\".."List Game Servers$$To: "..Aux.Bot.. " From: %[mynick] $<%[mynick]> "..Aux.Prefix..Aux.Cmd.."||")endRegConnected,OpConnected = UserConnected,UserConnectedParse = function(path) local f,e = io.open(path) if f then local msg,cnt = "",0 local txt = f:read("*a") f:close() if txt:len() > 0 then for file,name in txt:gmatch("\<a href%=\"([^.]+)%.html\"\>([^<]+)\<\/a\>") do cnt = cnt + 1 msg = msg.."\t["..cnt.."]\t"..file.." - "..name.."\n" table.insert(Files,{file..".html",name}) end if next(Files) then for i,v in ipairs(Files) do local f,e = io.open(Aux.Path.."/"..v[1]) if f then Servers[v[2]] = {} local svr = f:read("*a") local _,_,hdr = svr:find("(Address%:.+)\<h2\>") local _,_,players = svr:find("(Address:.+)<h2>") for field,val in hdr:gmatch("(%w+)%s*:%s*([^<]+)") do table.insert(Servers[v[2]],{field,val}) end end end local msg = "" for i,v in pairs(Servers) do msg = msg.."\n\n\tServer: "..tostring(i).."\r\n" for idx,val in ipairs(v) do msg = msg.."\t\t"..val[1].." - "..val[2].."\r\n" end end collectgarbage("collect") return msg end else return path.." is empty." end else return e:sub(1,-2) endend
<a href="lan\ls_1.html">SHOOT_THEM _UP</a>
Server: Counter-Strike: Condition Zero Address - 172.19.19.90:27015 Players - 13 / 13 Game - HalfLife-TFC-CS Map - de_chateau_cz Ping - 16 State - running Number - 1
Generated by aGSM v2.52d on November 28, 2009 exactly at 9:36:12
List of servers, our LANNovember 28, 2009 at 9:36:12Server 1) : 24X7 Dedicated Death match Server Address - 10.100.94.1:27015 Players - 1 / 24 Game - HalfLife-TFC-CS Map - cs_untitled Ping - 0 State - running Number - 1Generated by aGSM v2.52d on November 28, 2009 exactly at 9:36:12
List of servers, our LANNovember 28, 2009 at 9:36:12No servers found !!
<table border=1 bgcolor="#eeeeee" width=650><tr><th>#</th><th>Name</th><th>Address</th><th>Players</th><th>State</th><th>Game</th><th>Launch!</th></tr> </table>
@ TZB , script outputs values in table Address , PLayers ,Maps , game etc,. if thrs no Server the table is empty and nothing is happening .
--[[ GameServer 2.0 LUA 5.1 [Strict] By Mutor 06/20/07 Requested by achiever Reads aGSM html files and displays in hub on command +Changes from 1.0 11/26/09 ~Converted to API 2 strict. +Added context menus [right click]]]
Mutor help me Undecided out with the above output !!If no servers are found , then nothing is being shown not even a notifying message , so plz change the output to look likethis
@echo offmkdir lan > nulmkdir lan\lan > nulmove ls*.* lan\lan > nulmove lan.html lan\ > nul
Reads aGSM html files and displays in hub on command
Since i hate agsm though many of them like it.. i have been finding an alternative for it and a version that's being updatedi am going to test the software as well which does the same work as aGSM so hoped if people are bored with the same outdated one and wanna try out something new then here is the link.http://www.hlsw.org/hlsw/features/i read about some lua plugin support also in it will check and keep it informed.
its far more better than aGSM. It also generates a Server list as lan.sl13There are many user friendly features in it if you know it also works in offline mode where people don't use Internet and use Local servers.And if every user on lan knows about it you wont require this script either since you can jump directly to the server using this software.+ there is some buddy list which i have not yet tested but it like adding favorites.and if you can learn bit lua you can make your own plugin here also and make your own output .