I got fed up with the extremely loud audio on some servers... so I made a menu state addon to remove the audio!
Copy and paste this script into a file in lua/menu/
and edit lua/menu/menu.lua to include it!
for example
named file nomusic.lua in directory lua/menu/
add
[code]
include( "nomusic.lua" );
[/code]
in lua/menu/menu.lua at end of file!
[code]
--[[
file name: menu/nomusic.lua
reason:
to remove all that shitty music from shitty server's shitty loading screens they bought
on scriptfucker™
remember to add an include for this file in menu/menu.lua!
]]
--[[
SETTINGS:
alternate_iframe:
used when shouldremove = false
this will basically reroute the videos/sounds to the specified link
shouldremove:
if true it will simply remove the sounds/videos, otherwise it will use the other values in the settings
]]
local SETTINGS = {
shouldremove = true;
alternate_iframe = "https://www.youtube.com/embed/qycqF1CWcXg?autoplay=1";
};
local success = Color(0,200,0,255);
local failure = Color(200,0,0,255);
local middle = Color(200,0,200,255); -- purple :)
local loadp = (GetLoadPanel or function() end)(); -- hopefully no change...
if(not loadp) then MsgC(failure, "Couldn't get pnlLoading! Not stopping sounds! :(\n"); end
MsgC(middle, "Got pnlLoading.. executing code to stop sounds...\n");
local ThinkName = "ThinkLoad";
local javascript = [[
var amount = 0;
function DeleteAll(name) {
var all = document.getElementsByTagName(name);
for(var i = 0; i < all.length; i++) {
amount = amount + 1;
all[i].parentElement.removeChild(all[i]);
}
}
function KillSrc(name) {
]]..(SETTINGS.shouldremove and [[
DeleteAll(name);
]] or [[
var all = document.getElementsByTagName(name);
for(var i = 0; i < all.length; i++) {
amount = amount + 1;
all[i].src = ']]..SETTINGS.alternate_iframe:JavascriptSafe()..[[';
}
]])..[[
}
KillSrc("iframe");
DeleteAll("audio");
KillSrc("source");
console.log("Removed "+amount+" elements!");
]];
local overwrite = [[
var old = document.createElement;
document.createElement = function(tagname) {
tagname = tagname.toLowerCase();
if(tagname === "iframe" || tagname === "audio" || tagname === "source") {
return; // sorry i am too lazy to redirect this to our stuff
}
return old(tagname);
};
console.log("Overwrote document.createElement :)!");
]];
local hasoverwritten = false;
local function ThinkLoad()
if(not IsValid(loadp)) then hook.Remove("Think", ThinkName); return; end
if(not IsValid(loadp.HTML)) then return; end -- wait for it
if(hasoverwritten == false) then
loadp.HTML:RunJavascript(overwrite);
MsgC(success, "Overwrote document.createElement - ;)\n");
hasoverwritten = true;
end
if(loadp.HTML:IsLoading()) then return; end -- wait for the load!
loadp.HTML:RunJavascript(javascript);
MsgC(success, "Removed all audio elements!\n");
hook.Remove("Think", ThinkName);
end
local old_showurl = loadp.ShowURL;
function loadp:ShowURL(a,b,c,d,e,f)
MsgC(middle, "ShowURL called!\n");
local ret = old_showurl(self,a,b,c,d,e,f);
hasoverwritten = false;
hook.Add("Think", ThinkName, ThinkLoad);
return ret;
end
MsgC(success, "All code executed successfully!\n");
--scriptfucker and all other trademarks are property of their respective owners
[/code]
Thank you, very usefull, but it would be better if u could change to a music u like,
Just set the hook for a youtube, its possible?
[QUOTE=Chokitu;46624251]Thank you, very usefull, but it would be better if u could change to a music u like,
Just set the hook for a youtube, its possible?[/QUOTE]
Added! (partially)
I probably won't add anything else to this since it was a 5 minute-discovery script for me.
Nice script, I would prefer servers use the addon that lets us set our own loading screen music. (Cant think of the link)
And on a side note, ScriptFodder is pretty decent, the downside is that it allows people trying to rip money from the community to set up a server more easily while putting minimal effort into it.
[QUOTE=makermod1;46625057]Nice script, I would prefer servers use the addon that lets us set our own loading screen music. (Cant think of the link)
And on a side note, ScriptFodder is pretty decent, the downside is that it allows people trying to rip money from the community to set up a server more easily while putting minimal effort into it.[/QUOTE]
Anybody who jacks up their server with scriptfodder shit wont be good
[QUOTE=MeepDarknessM;46623833]I got fed up with the extremely loud audio on some servers... so I made a menu state addon to remove the audio!
Copy and paste this script into a file in lua/menu/
and edit lua/menu/menu.lua to include it!
for example
named file nomusic.lua in directory lua/menu/
add
[code]
include( "nomusic.lua" );
[/code]
in lua/menu/menu.lua at end of file!
[code]
--[[
file name: menu/nomusic.lua
reason:
to remove all that shitty music from shitty server's shitty loading screens they bought
on scriptfucker™
remember to add an include for this file in menu/menu.lua!
]]
--[[
SETTINGS:
alternate_iframe:
used when shouldremove = false
this will basically reroute the videos/sounds to the specified link
shouldremove:
if true it will simply remove the sounds/videos, otherwise it will use the other values in the settings
]]
local SETTINGS = {
shouldremove = true;
alternate_iframe = "https://www.youtube.com/embed/qycqF1CWcXg?autoplay=1";
};
local success = Color(0,200,0,255);
local failure = Color(200,0,0,255);
local middle = Color(200,0,200,255); -- purple :)
local loadp = (GetLoadPanel or function() end)(); -- hopefully no change...
if(not loadp) then MsgC(failure, "Couldn't get pnlLoading! Not stopping sounds! :(\n"); end
MsgC(middle, "Got pnlLoading.. executing code to stop sounds...\n");
local ThinkName = "ThinkLoad";
local javascript = [[
var amount = 0;
function DeleteAll(name) {
var all = document.getElementsByTagName(name);
for(var i = 0; i < all.length; i++) {
amount = amount + 1;
all[i].parentElement.removeChild(all[i]);
}
}
function KillSrc(name) {
]]..(SETTINGS.shouldremove and [[
DeleteAll(name);
]] or [[
var all = document.getElementsByTagName(name);
for(var i = 0; i < all.length; i++) {
amount = amount + 1;
all[i].src = ']]..SETTINGS.alternate_iframe:JavascriptSafe()..[[';
}
]])..[[
}
KillSrc("iframe");
DeleteAll("audio");
KillSrc("source");
console.log("Removed "+amount+" elements!");
]];
local overwrite = [[
var old = document.createElement;
document.createElement = function(tagname) {
tagname = tagname.toLowerCase();
if(tagname === "iframe" || tagname === "audio" || tagname === "source") {
return; // sorry i am too lazy to redirect this to our stuff
}
return old(tagname);
};
console.log("Overwrote document.createElement :)!");
]];
local hasoverwritten = false;
local function ThinkLoad()
if(not IsValid(loadp)) then hook.Remove("Think", ThinkName); return; end
if(not IsValid(loadp.HTML)) then return; end -- wait for it
if(hasoverwritten == false) then
loadp.HTML:RunJavascript(overwrite);
MsgC(success, "Overwrote document.createElement - ;)\n");
hasoverwritten = true;
end
if(loadp.HTML:IsLoading()) then return; end -- wait for the load!
loadp.HTML:RunJavascript(javascript);
MsgC(success, "Removed all audio elements!\n");
hook.Remove("Think", ThinkName);
end
local old_showurl = loadp.ShowURL;
function loadp:ShowURL(a,b,c,d,e,f)
MsgC(middle, "ShowURL called!\n");
local ret = old_showurl(self,a,b,c,d,e,f);
hasoverwritten = false;
hook.Add("Think", ThinkName, ThinkLoad);
return ret;
end
MsgC(success, "All code executed successfully!\n");
--scriptfucker and all other trademarks are property of their respective owners
[/code][/QUOTE]
dude if this would work then anyone could have hack clients with out bypassers lol
[QUOTE=log404;46633481]dude if this would work then anyone could have hack clients with out bypassers lol[/QUOTE]
This isn't Minecraft Log404, It does work last I heard tho too...
[QUOTE=log404;46633481]dude if this would work then anyone could have hack clients with out bypassers lol[/QUOTE]
hello there is this thing called the menu state?
[QUOTE=nettsam;46635008]hello there is this thing called the menu state?[/QUOTE]
still it will go server side before ....
[QUOTE=log404;46651288]still it will go server side before ....[/QUOTE]
:suicide:
The only thing that can send to the server is the server itself, the client can only have client sided content, which doesn't effect the server side, because it can't, it has not direct contact. If its a shared file, then it goes for both server and client, but that's something the server can only do.
The client can however read the server, if the server set that specific function for shared, or networking it. But it doesn't write to the server, the only way to do that is, again, networking. But then the server need to have that setup for that specific function.
Sorry, you need to Log In to post a reply to this thread.