1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

After Prop. ID (+Rep for answer)

Discussion in 'Code Snippets and Tutorials' started by Fexxel, Sep 26, 2009.

  1. Fexxel

    Fexxel Level IV

    Joined:
    Jan 28, 2009
    Messages:
    959
    Likes Received:
    26
    That's the error I get.
    My script looks like this:
    Code (Text):
    1. GM_registerMenuCommand("Wise old King", {
    2.     document.location.href = "http://www.neopets.com/medieval/wiseking.phtml";
    3.     enter;
    4. });
    5. GM_registerMenuCommand("Crack a Joke- Grumpy old King", {
    6.     document.location.href = "http://www.neopets.com/medieval/grumpyking.phtml";
    7.     enter;
    8. });
    I get an "After Property ID" error for "enter;" and the document.location.href line.
    Searched google, didn't find an answer that makes sense.
    Whoever poses a solution gets +Rep.
     
  2. jazzeh

    jazzeh Level I

    Joined:
    Jan 1, 2008
    Messages:
    144
    Likes Received:
    15
    What's enter?
    Code (Text):
    1.  
    2. GM_registerMenuCommand("Wise old King", function(){
    3.     document.location.href = "http://www.neopets.com/medieval/wiseking.phtml";
    4. });
    5. GM_registerMenuCommand("Crack a Joke- Grumpy old King", function(){
    6.     document.location.href = "http://www.neopets.com/medieval/grumpyking.phtml";
    7. });
    8.  
     
  3. Fexxel

    Fexxel Level IV

    Joined:
    Jan 28, 2009
    Messages:
    959
    Likes Received:
    26
    It makes the page load. So it sets the location to x, then hits enter to make it load.
     
  4. ricky92

    ricky92 Administrator
    Staff Member

    Joined:
    Nov 10, 2006
    Messages:
    1,866
    Likes Received:
    67
    Lol, whoever told you this is an idiot XD
     
  5. Fexxel

    Fexxel Level IV

    Joined:
    Jan 28, 2009
    Messages:
    959
    Likes Received:
    26
    I saw the use of enter in a seperate script.
    Off to go get rid of the enter thing. BRB.
    Edit:
    Problem not solved- the items still don't show up in the user scripts user script command menu.
    Am I using it right?
    Code (Text):
    1.  
    2. GM_registerMenuCommand("Wise old King", {
    3.     document.location.href = "http://www.neopets.com/medieval/wiseking.phtml";
    4. });
    5. GM_registerMenuCommand("Crack a Joke- Grumpy old King", {
    6.     document.location.href = "http://www.neopets.com/medieval/grumpyking.phtml";
    7. });
    8.  
     
  6. ricky92

    ricky92 Administrator
    Staff Member

    Joined:
    Nov 10, 2006
    Messages:
    1,866
    Likes Received:
    67
    You missed the "function() { ... }" part...
    GM_registerMenuCommand("Wise old King", function() {
    document.location.href = "http://www.neopets.com/medieval/wiseking.phtml";
    });
    GM_registerMenuCommand("Crack a Joke- Grumpy old King", function() {
    document.location.href = "http://www.neopets.com/medieval/grumpyking.phtml";
    });
     
    Fexxel likes this.
  7. jazzeh

    jazzeh Level I

    Joined:
    Jan 1, 2008
    Messages:
    144
    Likes Received:
    15
    You could've named the function elsewhere or used a generic function like I had posted in the first reply to your question
     
  8. Fexxel

    Fexxel Level IV

    Joined:
    Jan 28, 2009
    Messages:
    959
    Likes Received:
    26
    I now owe you 2 Reps, I need to "spread it around" first.
    (If it's alright with everyone here, I'ma go put in it DL section for like 10 points or something.)
    @Ricky: +Rep'd