[Script] Panda Crazy Add-On for Overwatch

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

  1. ceedj

    ceedj Survey Slinger

    Messages:
    2,767
    Gender:
    Male
    Ratings:
    +6,020
    [​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 10
    • Today I Learned Today I Learned x 6
    • Like Like x 4
    Last edited: Feb 7, 2018
  2. ref2018

    ref2018 New Turker

    Messages:
    21
    Gender:
    Female
    Ratings:
    +18
    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 Turker

    Messages:
    406
    Gender:
    Male
    Ratings:
    +826
    I love you, man. Thank you.
     
    • Like Like x 1
  4. HarryHood

    HarryHood Survey Slinger

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

    knottypiper Survey Slinger

    Messages:
    5,776
    Gender:
    Female
    Ratings:
    +12,728
    [​IMG]

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

    klyde Turker

    Messages:
    72
    Gender:
    Male
    Ratings:
    +132
    Edited: nvm
     
  7. BurtTurker

    BurtTurker New Turker

    Messages:
    17
    Gender:
    Male
    Ratings:
    +16
    brilliant, thank you.
     
  8. klyde

    klyde Turker

    Messages:
    72
    Gender:
    Male
    Ratings:
    +132
    Edited: nvm
     
    Last edited: Feb 22, 2018
  9. ceedj

    ceedj Survey Slinger

    Messages:
    2,767
    Gender:
    Male
    Ratings:
    +6,020
    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 Turker

    Messages:
    72
    Gender:
    Male
    Ratings:
    +132
    Yeah, no idea what I was looking at. Just checked again and right there it was.
     
  11. ScooterPie

    ScooterPie Active Turker

    Messages:
    166
    Gender:
    Female
    Ratings:
    +349
    Awesome! THANK YOU! :)
     
  12. SunlitSunflower

    SunlitSunflower baby head

    Messages:
    22,494
    Ratings:
    +36,431
    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 Survey Slinger

    Messages:
    18,930
    Gender:
    Female
    Ratings:
    +49,005
    When a link goes purple in Panda crazy it's because you're not qualified
     
    • Today I Learned Today I Learned x 1
  14. SunlitSunflower

    SunlitSunflower baby head

    Messages:
    22,494
    Ratings:
    +36,431
    Oh god, I look dumb. Thank you!
     
    • Like Like x 1
  15. Havoc928

    Havoc928 Active Turker

    Messages:
    854
    Gender:
    Male
    Ratings:
    +818
    It works! thank you, I use this to look for surveys when it is slow
     
  16. moonshay76

    moonshay76 Survey Slinger

    Messages:
    1,876
    Gender:
    Female
    Ratings:
    +2,279
    this is great I love it
     
  17. Trinidad

    Trinidad Turker

    Messages:
    139
    Ratings:
    +87
    Just wanted to say thanks for sharing this, super helpful for efficiency.