Forums Kongregate

We need a way to "turn off lights" page 2

47 posts

Flag Post

I think Kongregate should invest in this feature. Maybe even make it better and unique from other gaming sites.

 
Flag Post

Maybe even make it better and more unique from other gaming sites.

That is absolutely and utterly impossible. Something can’t be more unique than something else.
It’s either unique, or it isn’t. There are no degrees of uniqueness.

*grammar nazi strikes again*

 
This post has been removed by an administrator or moderator
 
Flag Post
Originally posted by MaistlinRajere:

I am very interested.

Ask and ye shall receive. http://zalbee.intricus.net/2012/12/kongregate-night-mode-script/ Works in Chrome/IE, not Firefox yet. Others untested.

 
Flag Post
Originally posted by zAlbee:
Originally posted by MaistlinRajere:

I am very interested.

Ask and ye shall receive. http://zalbee.intricus.net/2012/12/kongregate-night-mode-script/ Works in Chrome/IE, not Firefox yet. Others untested.

I see myself using that a lot in the future…

 
Flag Post
Originally posted by MaistlinRajere:

Maybe even make it better and more unique from other gaming sites.

That is absolutely and utterly impossible. Something can’t be more unique than something else.
It’s either unique, or it isn’t. There are no degrees of uniqueness.

grammar nazi strikes again

That was a very interesting read, Maistlin! =)

 
Flag Post
Originally posted by zAlbee:
Originally posted by MaistlinRajere:

I am very interested.

Ask and ye shall receive. http://zalbee.intricus.net/2012/12/kongregate-night-mode-script/ Works in Chrome/IE, not Firefox yet. Others untested.

Is it possible to change the background color, just for lulz?

 
Flag Post

Sure. I only use two colours mainly, so do a find/replace in the script for “#000” (black) and “#111” (dark gray). You can use hex codes or named colours (“black”, “red”, “blue”, etc).

 
Flag Post

zAlbee, is there a way to make this permanent, i.e. I don’t have to click the bookmark?

 
Flag Post

I suppose we could convert it to a browser add-on, then it can run automatically. I don’t know how to do that though.

 
Flag Post
// ==UserScript==
// @name         script name
// @namespace    any nonsense, just so it doesn't mess with other installed scripts
// @version	    1	
// @include        where will it run? http://www.kongregate.com/games/*/*
// @exclude	we don't want it to run in the comments or other game-related pages:	   http://www.kongregate.com/games/*/*/*
// @grant          GM_addStyle <- that's GreaseMonkey's buil-in method to change CSS **
// @require		 You can include any library you may need. ie,  http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js
// @run-at         document-end
// @icon 		   http://mysite.com/images/icon.ico
// ==/UserScript==

Code goes here.

** The GM_addStyle method takes a string with the CSS.
ie; GM_addStyle('#stuff,#more_stuff,#even_more{background-color:'+myColor+';}');
That said, for browser compatibility, you may be better off simply adding the javascript in the usual (appendChild) way instead of using the GM function.

The file is saved as filename.user.js

As far as I know, you can run such scripts in Firefox (they were born there with Greasemonkey), Chrome (you just drag-drop the file in the extensions tab), Opera (with limited functionality) and Safari (Don’t know much about this, but you have to install GreaseKit and maybe more stuff).

Of course, as it’s “native” to Firefox, sometimes there are compatibility issues with other browsers, either because they don’t accept one or more of the starting parameters or because they implement things their own way.

 
Flag Post

The reason is this script relies on the $ and $$ functions that are defined in Kongregate’s javascripts. Apparently, Firefox doesn’t allow bookmarklets to access those.

Hrm. Are you sure? I personally haven’t tested, but you might be able to get around it the same way I get around them (well, I stole this technique from Ventero really) in Chrome with loading issues. Just package your script inside a script tag, wait 100 ms on page load, then inject the script tag on the page. You should have full access to Prototype’s functions/features.


On topic: I think this feature should be K+ only.

 
Flag Post

I remember being able to use Kong’s JS things ($, $$) in Firefox without problems. Although I didn’t give them much use, but they never caused issues.
On the other hand, I remember trying to run the same script on Chrome and it was complaining about undefined stuff.

Gotta love the browser wars. HTML5 is the future. trolololol

 
Flag Post

Senekis: Very interesting, I shall look into this. Thanks!

UnknownGuardian: It appears that $/$$ does work in FF. I was originally testing by pasting a javascript: URL and that was giving an error. With the actual bookmarklet, those calls now succeed, but my CSS-modifying function still fails. Firefox throws:

Error: SecurityError: The operation is insecure.

 
Flag Post

I agree with UnknownGuardian on this one, you could make it a K+ feature!

 
Flag Post
Originally posted by zAlbee:
Originally posted by MaistlinRajere:

I am very interested.

Ask and ye shall receive. http://zalbee.intricus.net/2012/12/kongregate-night-mode-script/ Works in Chrome/IE, not Firefox yet. Others untested.

I like it keep the updates coming

 
Flag Post

I’m pretty sure there is a Crome add-on called “Lights Off” that performs this feature.

 
Flag Post

There is. But not everyone uses Chrome.

Also. YOU CAN’T CHANGE THE COLOURS IN THE ADD ON.

 
Flag Post
Originally posted by MaistlinRajere:

Maybe even make it better and more unique from other gaming sites.

That is absolutely and utterly impossible. Something can’t be more unique than something else.
It’s either unique, or it isn’t. There are no degrees of uniqueness.

grammar nazi strikes again

It’s Nazi, not nazi.
*Punctuation Nazi strikes back*
Wonderful read, too. Thank you.

 
Flag Post

Just figured out an obvious way to set it back to normal without refreshing.

Just make another bookmarklet with the regular colors.

 
Flag Post

Updated my script. I fixed the colours on the following elements: Chat Dropdown Menu, Chat Room Selection, High Scores Tab, BOTD notification, Game Tags.

Originally posted by moomoofire11:

I’m pretty sure there is a Crome add-on called “Lights Off” that performs this feature.

I actually used the “Turn Off the Lights” Chrome extension for a while, and it annoyed me enough that it drove me to create this one. The major annoyance was that the “lights” would turn back on whenever you clicked outside the game window. That’s fine for watching Youtube, but terrible for something interactive like a game, where you’re clicking all over the place. It was also too hard to read or interact with chat.

 
Flag Post

Much better! Awesome, and thanks!