1. Glad you stopped in for a visit!

    Please feel free to peruse around and if you have a minute make sure to sign up for an account! We're one of the largest, most active, and helpful communities you'll find for learning about mTurk & registered accounts automatically get access to tons of useful features on the site.

    Features for members include:

    • The ability to post messages - our community is incredibly helpful & happy to welcome newcomers who are looking to learn the ropes!
    • Live thread update - no need to refresh pages to see new posts/HITs they flow onto the page automatically as they're posted.
    • Desktop alerts - direct PANDAs from exported HITs right on your desktop
    • Access to the full list of HITs exported through the Daily HIT Log
    • TurkerView account which will grant you extra access to HIT review information all across mTurk through TVJS

    But most importantly you'll be joining an amazing community. You'll find all types here, from stay-at-home Moms to IT pros. We're a great group - feel free to join us!

[Script] Panda Crazy Add-On for Overwatch

Discussion in 'mTurk Scripts & Resources' started by ceedj, Dec 9, 2017.

  1. ceedj

    ceedj Well-Known Member

    Messages:
    2,089
    Gender:
    Male
    Ratings:
    +4,147 / 3 / -0
    [​IMG]

    This small add-on to Overwatch adds PandaCrazy buttons on each new HIT. Code is only five lines, but it's critical to ensure the code goes into Overwatch at the right spot.

    Some notes: Both PandaCrazy and Overwatch must be on Worker (this won't matter in a few days, as everything will be on worker), and make sure you have the Worker version of Overwatch installed. If you use the following addresses to access PC and OW:

    Overwatch: https://worker.mturk.com/overwatch
    PandaCrazy: https://worker.mturk.com/?filters[search_term]=pandacrazy=on
    EDIT: More recent PC link: https://worker.mturk.com/requesters/PandaCrazy/projects


    Then you should be fine. Please note that if Overwatch updates, you will need to add this again to Overwatch, as this script is an add-on, and not part of the original code. Also, this add-on is placed inside the Overwatch script, and communicates with PandaCrazy (I send the GID found in OW to PC), not the other way around.

    Look for this line (line 405-ish in the most current version of Overwatch):

    Code:
      $("#rightWindow").prepend(display_HTML);
    }
    
    The add-on code:
    Code:
    //Panda Crazy add-on starts here:
       function PC_Panda(){localStorage.setItem("JR_message_pandacrazy", JSON.stringify({"time":(new Date().getTime()),"command":"addJob","data":{"groupId":hitObject.GID} }));}
       function PC_Once(){localStorage.setItem("JR_message_pandacrazy", JSON.stringify({"time":(new Date().getTime()),"command":"addOnceJob","data":{"groupId":hitObject.GID} }));}
       $(`div[value='${hitObject.GID}']`).append($("<button class ='text_css offSet'>").html("Once").click(PC_Once));
       $(`div[value='${hitObject.GID}']`).append($("<button class ='text_css offSet'>").html("Panda").click(PC_Panda));
       $(`div[value='${hitObject.GID}']`).append($("<span class ='text_css offSet'>").html("[PC] Add: "));
    
    The add-on code NEEDS to go in the spot between the semi-colon ( ; ) and the right brace ( } ), so it looks like this:
    Code:
    $("#rightWindow").prepend(display_HTML);
    //Panda Crazy add-on starts here:
       function PC_Panda(){localStorage.setItem("JR_message_pandacrazy", JSON.stringify({"time":(new Date().getTime()),"command":"addJob","data":{"groupId":hitObject.GID} }));}
       function PC_Once(){localStorage.setItem("JR_message_pandacrazy", JSON.stringify({"time":(new Date().getTime()),"command":"addOnceJob","data":{"groupId":hitObject.GID} }));}
       $(`div[value='${hitObject.GID}']`).append($("<button class ='text_css offSet'>").html("Once").click(PC_Once));
       $(`div[value='${hitObject.GID}']`).append($("<button class ='text_css offSet'>").html("Panda").click(PC_Panda));
       $(`div[value='${hitObject.GID}']`).append($("<span class ='text_css offSet'>").html("[PC] Add: "));
    }
    
    If the code winds up outside the brace, the buttons may show, but not work, so make sure your code looks like the above.

    Thanks JR (PandaCrazy author), Ethraiel (author of Overwatch) and all the great testers who tried this out and found it useful. If you too find it useful and you want to donate, please use the Donate link above!
     
    • Love Love x 8
    • Useful / Informative Useful / Informative x 6
    • Like Like x 4
    Last edited: Feb 7, 2018
  2. ref2018

    ref2018 New Member

    Messages:
    4
    Gender:
    Female
    Ratings:
    +3 / 0 / -0
    Yay, thanks! I got it working!

    This might be my first post on here, I'm not sure. I joined all the forums and I have not kept track of which ones I posted on. I go by this username on reddit too.

    Have a pleasant day!
     
    • Love Love x 1
  3. Dr McCoy

    Dr McCoy Active Member

    Messages:
    400
    Gender:
    Male
    Ratings:
    +823 / 0 / -0
    I love you, man. Thank you.
     
    • Like Like x 1
  4. HarryHood

    HarryHood Well-Known Member

    Messages:
    2,543
    Gender:
    Male
    Ratings:
    +4,166 / 2 / -4
    Dude, thank you so much for this add on! This really speeds up my workflow.
     
    • Like Like x 1
  5. knottypiper

    knottypiper Well-Known Member

    Messages:
    5,402
    Gender:
    Female
    Ratings:
    +12,488 / 1 / -0
    [​IMG]

    This is amazing! Thank you!!
     
    • Like Like x 1
    • LOL LOL x 1
  6. klyde

    klyde Member

    Messages:
    57
    Gender:
    Male
    Ratings:
    +116 / 1 / -0
    Edited: nvm
     
  7. BurtTurker

    BurtTurker New Member

    Messages:
    12
    Gender:
    Male
    Ratings:
    +12 / 0 / -0
    brilliant, thank you.
     
  8. klyde

    klyde Member

    Messages:
    57
    Gender:
    Male
    Ratings:
    +116 / 1 / -0
    Edited: nvm
     
    Last edited: Feb 22, 2018
  9. ceedj

    ceedj Well-Known Member

    Messages:
    2,089
    Gender:
    Male
    Ratings:
    +4,147 / 3 / -0
    From what I can tell, there has been no upgrade for OW in 58 days. In any case, where it goes hasn't changed, per the first post.
     
  10. klyde

    klyde Member

    Messages:
    57
    Gender:
    Male
    Ratings:
    +116 / 1 / -0
    Yeah, no idea what I was looking at. Just checked again and right there it was.
     
  11. ScooterPie

    ScooterPie Active Member

    Messages:
    134
    Gender:
    Female
    Ratings:
    +327 / 0 / -0
    Awesome! THANK YOU! :)
     
  12. SunlitSunflower

    SunlitSunflower Active Member

    Messages:
    697
    Ratings:
    +749 / 8 / -0
    For some reason this doesn't work? It creates the task in Panda crazy but it doesn't want to search for it. It searches once and then stops and turns purple. Have I done something wrong?
     
  13. lefty

    lefty Well-Known Member

    Messages:
    15,821
    Gender:
    Female
    Ratings:
    +42,475 / 22 / -0
    When a link goes purple in Panda crazy it's because you're not qualified
     
    • Useful / Informative Useful / Informative x 1
  14. SunlitSunflower

    SunlitSunflower Active Member

    Messages:
    697
    Ratings:
    +749 / 8 / -0
    Oh god, I look dumb. Thank you!
     
    • Like Like x 1
  15. Havoc928

    Havoc928 Active Member

    Messages:
    327
    Gender:
    Male
    Ratings:
    +269 / 0 / -0
    It works! thank you, I use this to look for surveys when it is slow