Tip: "Bookmarklet IDE" (Chrome)

Discussion in 'Scripts & Independent Tools' started by Luggruff, Nov 17, 2018.

Share This Page

  1. Luggruff

    Luggruff New Member

    Joined:
    Nov 17, 2018
    Messages:
    2
    Likes Received:
    2
    Hey!

    I have compressed this thread with spoiler tags so not to overwhelm you with the fact that this guide can be long, and also to give you a shortcut if you don't like to read too much!
    If this thread is inappropriate for any reason, feel free to delete it. I just created this in hope to help a few users take the next step.

    A guide to help you use scripts more easily and efficiently!

    As I was trying to help a friend that doesn't know any JavaScript at all how to use scripts, I found a very useful method that seems to be quite a bit more effective and simpler than the current alternatives I've found during a couple of hours googling. This should come in good use for both new and experienced users of scripts for Tribal Wars.

    Every guide I found about scripting here started out with "javascript: " before the actual script. This suggest that users have to either 1) write "javascript: " manually in their address bar in Chrome and then paste the code (since Chrome automatically removes the "javascript: " if pasted into the address bar) or 2) the same issue where "javascript: " is removed when pasted into a bookmark as the address (also known as a "bookmarklet" - a way to save and re-use the script). So, if you tried scripts here before, you are surely familiar with one or both of these methods, and how tedious they can be! With my method, you will be able to:
    • Save a script once, then run it any time, with the click of a button!
    • Be able to edit the scripts in a CLEAN way (no more huge scripts in only ONE unreadable line). Editing is for example important in the following script where you have to replace "name1;name2;name3;" with the actual usernames you want to be filled out in the recipient field of your mail page:
      Code:
      javascript:igm_to_insert_adresses('name1;name2;name3;');void(0);
      With the addon however, as soon as you save this code, it will look like this instead:
      [​IMG]
      (don't get distracted by this image, we'll get back to that later! This is, for now, only a demonstration of how much more easy it is to edit and read the scripts when needed!)

    If you're interested, keep reading (yes, it's a lot to read, but keep in mind that the goal is to simplify in the end).
    1. Find "Bookmarklet IDE" on Chrome Webstore, or click: https://chrome.google.com/webstore/detail/bookmarklet-ide/peebnjhlifoemfpcffdlbcdppmikglek?hl=en
    2. Make sure you only have one folder called "Bookmarklets" in your bookmarks, and move it to the top of your bookmark folders in the bookmark manager (CTRL+SHIFT+O). To move it, simply click and drag it!
    3. Show the bookmarks bar (CTRL+SHIFT+B)

      By performing step 1 and 2, you will now have quick access to any scripts you add, from any page you are on!

    1. Now to add a script, simply click here (top right in your Chrome window):
      [​IMG]
    2. Now, insert the script you want by selecting line #2 (the: "/* todo */" line) and pasting your script code instead. DO NOT INCLUDE THE "javascript: " part of the script!
    3. Give your script a suitable title so you remember what it does and where it can be used
    4. Save
    5. Now you can access your scripts easily by clicking here (and then just click the one you want to use):
      [​IMG]

    Thank you for your attention! I hope you will find this guide useful (and that the image hosting service, tinypic.io, hosts the images for a long time so this guide can live).

    • Do you play Tribal Wars?
      - Never has, never will. I went through the tutorial and it's just not a game for me. I'm glad it is for you!
    • Why did you create this guide? What's it to you?
      - A friend wanted to learn how to use scripts, but just couldn't get his/her head around it and has no previous experience with JavaScript. I do however so I wanted to help, and I didn't find a smooth way to add scripts and found no mention of this method in the forum already, or anything similar. Since it turned out to be very efficient and easy, I figured I might just share it with all of you (even though I don't play this game myself).. because, why not? I do recognize that the possibility of scripts are wonderful, and for that I think more should have that joy!
    • Did you create the Chrome addon "Bookmarklet IDE"?
      - No. I have zero relation to the developer and simply found it searching for "bookmarklet" on the Chrome Webstore!
    • Each time I add a new script, the addon opens a new tab. Adding a lot of scripts after each other gets messy fast. Can this be fixed?
      - Most certainly! I have a "hack" for that! Bookmark the page "chrome-extension://peebnjhlifoemfpcffdlbcdppmikglek/new.html" (without the quotes) and move it to the top of your "Bookmarklets" folder. This way, you can open the page where you add a new script without having to open a new tab (this will open in the tab you are currently in, instead of opening a new one which the addon itself will do if you click that instead to create a new script
    • Are scripts legal on Tribal Wars?
      - Yes, to some extent. Read the forums to find out which scripts are legal (this at least differs between premium and non-premium members, to my understanding).
    • What is "JavaScript" and how do I learn more?
      - JavaScript is a high-level, interpreted programming language. It is a language which is also characterized as dynamic, weakly typed, prototype-based and multi-paradigm. On the web, it is one of three core technologies alongside HTML (the structure of a website) and CSS (the style of the website) whereas JavaScript provides the functions. Very simply put. To learn more, check out Lynda.com, Treehouse Coding or the completely free SoloLearn (as you can see by the links, I make no money from them as there is no affiliate-codes at the end of the URL's).
     
    Last edited: Nov 17, 2018
    tcamps likes this.
  2. Math Debator

    Math Debator Non-stop Poster

    Joined:
    Aug 27, 2013
    Messages:
    101
    Likes Received:
    37
    This could be good for non-premium users, but anyone who has a premium account, which 99% anyone who actually takes the time to learn to play TW seriously enough to utilize scripts has, includes an ingame quickbar that you can load all your scripts to, and it is accessible from any page in the game! You can even hotkey scripts to number keys on your keyboard! Best of all, it takes 15 seconds to add a script to your quickbar!

    quick bar screen shot: https://gyazo.com/1385ac286768eb9952a9b9c2465cbeed

    Also, if you use Chrome, you can just make a bookmark with your javascript, too, and save it to your bookmarks toolbar, no extension needed...
     
  3. Luggruff

    Luggruff New Member

    Joined:
    Nov 17, 2018
    Messages:
    2
    Likes Received:
    2
    Sounds good, for premium users! So good addition to the thread.

    About the Chrome bookmarking, that's exactly the painful process this thread is meant to tackle. I've used it extensively as I created this thread, and there is no comparison to the ease it is to use the extension.

    -Less steps
    -No need to write "javascript: " manually since it cannot be pasted in either bookmarks or the address bar in Chrome
    -You won't have to deal with editing code in a "one line enviroment"

    I find it insane how many "fixes" there are in this game that requires payment of real money. So this is in any way a healthy alternative for those that can't pay to win. Even that, this game has managed to demand money for though in some sense, as some scripts are forbidden for non-premium members.

    A little sense of logic tells anyone that they might just play another game if winning without losing real money is a goal.
     
    tcamps likes this.