Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Userscript 

How To Make Your Own Userscripts!

Amazing Thread, in my eyes, it deserves a sticky!
(Jul 27, 2013 02:43 PM)๖ۣۜXilluX Wrote:  Amazing Thread, in my eyes, it deserves a sticky!

If we only had an userscript section 🤫
(Jul 27, 2013 03:04 PM)'Snorlax Wrote:  If we only had an userscript section 🤫

That'd be wayy too helpful and useful for Hackforums to have :P
[Image: 2wAf2IN.gif]
(Jul 28, 2013 06:14 PM)xadamxk Wrote:  One of these days I'm going to read this hahaha.

Damn good tutorial mate!

I appreciate it! I wouldn't have gotten into userscripts if you hadn't commissioned HFES in the first place. Maybe we'll see you make one in the near future!
[Image: 2wAf2IN.gif]
(Aug 1, 2013 08:44 PM)xadamxk Wrote:  Where would you suggest learning Javascript?
Any good eBooks, or online tutorials?

Honestly I would suggest learning a language like Python first, once you understand the fundamentals of one language, it's very easy to jump to another. If you wish to go head first into javascript (not a very complicated language), I'm not entirely sure what tutorial out there would be best, but glancing at some ebooks this one caught my eye: http://eloquentjavascript.net/contents.html

Of course you can always PM me any questions you have.
[Image: 2wAf2IN.gif]
Thanks for this.

I became interested in this topic after using the HFES and realizing that I should not have been able to exist without multi-quotes. :P
Let's start :) thank you @Emylbus for giving me the starting direction
(Jul 21, 2013 12:07 PM)Emylbus Wrote:  
PHP Code

<?php 
// ==UserScript==
// @name  HF Enhancement Suite
// @author  Emylbus
// @namespace   http://www.sublyme.net
// @description This userscript defines general enhancement tweaks that apply to the entire HackForums site.
// @include  *hackforums.net/*
// @version  0.32
// @updateURL   http://sublyme.net/site_media/userscripts/HFES.user.js
// @grant  GM_addStyle
// @grant  GM_xmlhttpRequest
// @grant  GM_getValue
// @grant  GM_setValue
// @grant  GM_log
// @require  http://github.com/sizzlemctwizzle/GM_config/raw/master/gm_config.js
// @require  http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js
// @require  http://sublyme.net/site_media/userscripts/GM_SuperValues.user.js
// ==/UserScript== 

If you're going to link to my library (GM_config) and not mention it, the least you could do is link to the wiki.
(Sep 2, 2013 02:30 PM)sizzlemctwizzle Wrote:  If you're going to link to my library (GM_config) and not mention it, the least you could do is link to the wiki.

I didn't mention it in this thread because it doesn't discuss this plugin. I'll link to the wiki in the release thread of my script.
[Image: 2wAf2IN.gif]
(Sep 2, 2013 02:32 PM)Emylbus Wrote:  I didn't mention it in this thread because it doesn't discuss this plugin. I'll link to the wiki in the release thread of my script.

I figured since you mentioned the other two libraries used in that script in this thread, you might as well mention mine (I think it's something that many user script devlopers would find useful). You don't need to link the wiki in the release thread since that thread is about your script and not user script development.

Also,
(Jul 21, 2013 12:07 PM)Emylbus Wrote:  
  • @updateURL
    • Define where the userscript manager will download updates from.
    • PHP Code

      <?php 
      // @updateURL http://www.example.org/example.meta.js 

That isn't exactly correct. @updateURL defines where to check for updates (i.e parse the metadata and compare the version number with the installed script). If an update is found it is downloaded from the location specified by @downloadURL.

Source: I implemented user script updating in Greasemonkey.
(Sep 2, 2013 06:02 PM)sizzlemctwizzle Wrote:  I figured since you mentioned the other two libraries used in that script in this thread, you might as well mention mine (I think it's something that many user script devlopers would find useful). You don't need to link the wiki in the release thread since that thread is about your script and not user script development.
btw, the release thread for my userscript I was referencing is here: https://hackforums.net/showthread.php?tid=3603256

I linked to the wiki there to give credit to you for the code. Usually I'm so good at that, but it must have slipped my mind. There are a ton of libraries people might find useful and I only had a limited space so I needed to try to figure out which ones are most useful. Also the documentation for GM_Config is pretty abysmal. If there's a decent place that explains every possible option for it, please let me know. In addition to this, there are two versions (yours and JoeSimmons) which leads to confusion.

(Sep 2, 2013 06:02 PM)sizzlemctwizzle Wrote:  Also,

That isn't exactly correct. @updateURL defines where to check for updates (i.e parse the metadata and compare the version number with the installed script). If an update is found it is downloaded from the location specified by @downloadURL.

Source: I implemented user script updating in Greasemonkey.

Thank you for the clarification, the official docs aren't the greatest in some places.
[Image: 2wAf2IN.gif]
(Sep 2, 2013 06:42 PM)Emylbus Wrote:  Also the documentation for GM_Config is pretty abysmal. If there's a decent place that explains every possible option for it, please let me know.

All the documentation you could ever want is in the wiki. Here's a link to the full list of pages. The fields page is probably what you're really looking for.

(Sep 2, 2013 06:42 PM)Emylbus Wrote:  In addition to this, there are two versions (yours and JoeSimmons) which leads to confusion.

https://github.com/sizzlemctwizzle/GM_co...scriptsorg
(Sep 2, 2013 07:11 PM)sizzlemctwizzle Wrote:  All the documentation you could ever want is in the wiki. Here's a link to the full list of pages. The fields page is probably what you're really looking for.

https://github.com/sizzlemctwizzle/GM_co...scriptsorg

Well you just have the answers for everything, don't you! Thanks, I had been looking for a list of fields for a long time now but got jumbled up with the multiple different versions.
[Image: 2wAf2IN.gif]
(Sep 2, 2013 07:18 PM)Emylbus Wrote:  Thanks, I had been looking for a list of fields for a long time now

Truth be told, the detailed documentation is pretty new. GM_config has been around since '09 and until recently the only way of knowing what was possible was looking at either GM_config's source or existing scripts using GM_config. Hopefully with the new documentation more people will decide to use it, rather than trying to build their own settings panel from scratch.
(Sep 2, 2013 07:34 PM)sizzlemctwizzle Wrote:  Truth be told, the detailed documentation is pretty new. GM_config has been around since '09 and until recently the only way of knowing what was possible was looking at either GM_config's source or existing scripts using GM_config. Hopefully with the new documentation more people will decide to use it, rather than trying to build their own settings panel from scratch.

Keep up the excellent work. I hope to see you stay around HF! I'll be sure to PM you if I have any questions.
[Image: 2wAf2IN.gif]


Possibly Related Threads...
Thread / Author Replies Views Last Post
by Hash G.Sep 5, 2016 02:18 AM 6 291 Sep 5, 2016 02:18 AM
Last Post: Frukt
[Userscript] by mrnapolean1May 10, 2016 04:57 PM 11 381 May 10, 2016 04:57 PM
Last Post: mrnapolean1
by RemixNov 11, 2015 10:18 PM 14 429 Nov 11, 2015 10:18 PM
Last Post: Atharva