Hello. I am new. Can you guys tell me how can i learn?

Discussion in 'Help & Guides' started by cany30, Aug 29, 2018.

  1. cany30

    cany30 New Turker

    Messages:
    6
    Gender:
    Male
    Ratings:
    +0
    Hello. I am new. Can you guys tell me how can i learn? I interested to making scripts but idk how i can learn. Can you guys tell me what i must do and not do?

    Many thanks.
     
  2. GucciCthulhu

    GucciCthulhu Active Turker

    Messages:
    369
    Gender:
    Male
    Ratings:
    +982
  3. cany30

    cany30 New Turker

    Messages:
    6
    Gender:
    Male
    Ratings:
    +0
    Last edited: Aug 29, 2018
  4. GucciCthulhu

    GucciCthulhu Active Turker

    Messages:
    369
    Gender:
    Male
    Ratings:
    +982
    Put this as your first line.

    var $ = window.jQuery;

    I'm still new to writing scripts, but I'll try to help out where I can.
     
  5. Kadauchi

    Kadauchi Administrator Former MTG MotM

    Messages:
    4,367
    Ratings:
    +8,589
    You should never have to do that (setting $). Include something more recent. Here's the most recent prod version for jQuery https://code.jquery.com/jquery-3.3.1.min.js.
     
  6. GucciCthulhu

    GucciCthulhu Active Turker

    Messages:
    369
    Gender:
    Male
    Ratings:
    +982
    Tampermonkey still says that it's not defined. Scripts will still work though even with the error.
     
  7. Kadauchi

    Kadauchi Administrator Former MTG MotM

    Messages:
    4,367
    Ratings:
    +8,589
    Oh, the linter in the editor is saying that? The linter is wrong. It just doesn't know about the global variable being added from the @require. You need to add this to the top of the script under the metadata.

    Code:
    /* globals $ */
    Then it will look like.

    [​IMG]
     
    • Today I Learned Today I Learned x 2
    • Like Like x 1
  8. GucciCthulhu

    GucciCthulhu Active Turker

    Messages:
    369
    Gender:
    Male
    Ratings:
    +982
    That fixed it, thank you!
     
    • Like Like x 1