• About web browser.
    38 replies, posted
I'm Trying to make a simple system that use Google Chrome Module, and Mozilla module. So When the players will join the server, it will download those dll modules for them. so i want it to detect if the players have those web browsers. for example: *if the player don't has the web browsers, it will display internet explorer frame (default) *if the player has firefox and no google chrome, it will draw firefox frame instead of internet explorer. *if the player have firefox and google chrome, it will draw the google chrome frame instead of FF and IE. Is it possible? Thanks ALOT!
[code] if(file.Exists("../lua/includes/modules/gm_chrome.dll")) then --Make that window end [/code]
[quote]it will download those dll modules for them[/quote] Can't be done as .dlls can have potentialy harmfull content and thus can only be downloaded manually.
[QUOTE=Skapocalypse;16961424][code] if(file.Exists("../lua/includes/modules/gm_chrome.dll")) then --Make that window end [/code][/QUOTE] Perfect, But if the both dll's exist?
Couldn't you rename the dll, download it, then rename it back as a dll?
[code] if (file.Exists("../lua/includes/modules/gm_chrome.dll")) || (file.Exists("../lua/includes/modules/gm_firefox.dll")) then --Idk firefox's name if (file.Exists("../lua/includes/modules/gm_chrome.dll")) then --Make Chrome else --Make Firefox end else -- Make Poop Default IE end [/code] Should work *shrug*
[QUOTE=Skapocalypse;16962191][code] if (file.Exists("../lua/includes/modules/gm_chrome.dll")) || (file.Exists("../lua/includes/modules/gm_firefox.dll")) then --Idk firefox's name if (file.Exists("../lua/includes/modules/gm_chrome.dll")) then --Make Chrome else --Make Firefox end else -- Make Poop Default IE end [/code] Should work *shrug*[/QUOTE] That would still make chrome even if they didn't have both dlls. As (for some reason) he doesn't want chrome to draw if they don't have the firefox: [lua]if file.Exists("../lua/includes/modules/gm_firefox.dll") then --Idk firefox's name if file.Exists("../lua/includes/modules/gm_chrome.dll") then --Make Chrome else --Make Firefox end else -- Make Poop Default IE end[/lua]
[quote]*if the player has firefox and no google chrome, it will draw firefox frame instead of internet explorer.[/quote] And how would mine make chrome either way? Doesn't || mean or in lua?
[QUOTE=Lexic;16962273] [lua]if file.Exists("../lua/includes/modules/gm_firefox.dll") then --Idk firefox's name if file.Exists("../lua/includes/modules/gm_chrome.dll") then --Make Chrome else --Make Firefox end else -- Make Poop Default IE end[/lua][/QUOTE] Does lua have elseif?
Yes, it does.
[QUOTE=iRzilla;16963297]You're all dumb. [lua] require("chrome") require("firefox") if CHROME then -- Checks if they have Chrome first. -- Make Chrome elseif FIREFOX then -- This will only get called if a player has the firefox module and no chrome one. -- Make Firefox else -- Make IE end [/lua][/QUOTE] This is what I thought it should look like, and I don't even know lua, I was looking at the other ones going what? Why an if in an if? elseif.
Where is that firefox library and source, I've never been able to find it. Anyone have a link?
[QUOTE=Lexic;16962273] [lua]if file.Exists("../lua/includes/modules/gm_firefox.dll") then --Idk firefox's name if file.Exists("../lua/includes/modules/gm_chrome.dll") then --Make Chrome else --Make Firefox end else -- Make Poop Default IE end[/lua][/QUOTE] What if chrome exists and firefox doesn't? This is silly.
i give up for the firefox thing, the dll module is not available to download.
Damn, I was really hoping you had a copy.
[QUOTE=iRzilla;16963297]You're all dumb. [lua] require("chrome") require("firefox") if CHROME then -- Checks if they have Chrome first. -- Make Chrome elseif FIREFOX then -- This will only get called if a player has the firefox module and no chrome one. -- Make Firefox else -- Make IE end [/lua][/QUOTE] Your code will not work if they don't have both installed. [lua] hasfirefox = pcall( require, "firefox" ) haschrome = pcall( require, "chrome" ) if not ( hasfirefox or haschrome ) then --IE elseif hasfirefox then --Firefox else --Chrome end [/lua]
[QUOTE=iRzilla;16968828]Yours either. haschrome = pcall( reuiqire, "chrome" )[/QUOTE] Sorry for the typo.
[QUOTE=Kogitsune;16967466]Your code will not work if they don't have both installed. [lua] hasfirefox = pcall( require, "firefox" ) haschrome = pcall( require, "chrome" ) if not ( hasfirefox or haschrome ) then --IE elseif hasfirefox then --Firefox else --Chrome end [/lua][/QUOTE] Why are you even pcall'ing? [lua] ] lua_run require( "lolwut" ) Msg( "MESSAGE\n" ) > require( "lolwut" ) Msg( "MESSAGE\n" )... ERROR! Module 'lolwut' not found! MESSAGE [/lua]
[QUOTE=TehBigA;16969602]Why are you even pcall'ing? [lua] ] lua_run require( "lolwut" ) Msg( "MESSAGE\n" ) > require( "lolwut" ) Msg( "MESSAGE\n" )... ERROR! Module 'lolwut' not found! MESSAGE [/lua][/QUOTE] In the standard Lua build, also the wxLua one used in it's IDE, requiring a module that doesn't exist is a fatal error. I was not aware that garry changed that, and assumed that it behaved normally. That doesn't mean you shouldn't catch it, though, just because it isn't a fatal error. Also fuck, that still prints the error message :(. I hate red errors. So, I stand corrected. The code will work, but only because require doesn't create an error like it normally does.
Yea garry probably wrapped require around a pcall in C++ do it doesn't halt or return anything.
[QUOTE=iRzilla;16963297]You're all dumb. [lua] require("chrome") require("firefox") if CHROME then -- Checks if they have Chrome first. -- Make Chrome elseif FIREFOX then -- This will only get called if a player has the firefox module and no chrome one. -- Make Firefox else -- Make IE end [/lua][/QUOTE] Get out dumbkid, you were born in 1996 and your birthday was not so long time ago, so you are 13 now. If you don't believe me, check his Facepunch profile. tl;dr [b]iRzilla was born in 1996 LOL![/b]
[QUOTE=FloppyUK;17006569]Get out dumbkid, you were born in 1996 and your birthday was not so long time ago, so you are 13 now. If you don't believe me, check his Facepunch profile. tl;dr [b]iRzilla was born in 1996 LOL![/b][/QUOTE] How is that relevant?
[QUOTE=FloppyUK;17006569]Get out dumbkid, you were born in 1996 and your birthday was not so long time ago, so you are 13 now. If you don't believe me, check his Facepunch profile. tl;dr [b]iRzilla was born in 1996 LOL![/b][/QUOTE] And you're an 09'er.:smugdog:
[QUOTE=AlienFanatic;17007175]And you're an 09'er.:smugdog:[/QUOTE] Look at your birth date LOL! [code] Date of Birth January 2, 1996 (13) [/code] [editline]08:43PM[/editline] Get out 96'fags. You are too young to be on a site for mature people.
Really? Mature people like yourself? [sp]/sarcasm[/sp]
None of the codes here works..
[QUOTE=nivek;16964319]What if chrome exists and firefox doesn't? This is silly.[/QUOTE] [QUOTE=Lyoko2;16961400]*if the player don't has the web browsers, it will display internet explorer frame (default) *if the player has firefox and no google chrome, it will draw firefox frame instead of internet explorer. *if the player have firefox and google chrome, it will draw the google chrome frame instead of FF and IE. Is it possible?[/QUOTE] That is exactly what he asked for.
[QUOTE=AlienFanatic;17007838]Really? Mature people like yourself? [sp]/sarcasm[/sp][/QUOTE] Oh come on use your mic, I want to hear your earhurting voice
Let's do it bitch. Post steam ID.
[QUOTE=AlienFanatic;17008195]Let's do it bitch. Post steam ID.[/QUOTE] LOL fag born in 1996, I see you try to troll. Well you see, generally fags like you who were born in 1996 are tolls without trolling, so you shouldn't even try to.
Sorry, you need to Log In to post a reply to this thread.