Results 1 to 6 of 6

Thread: Need non neopet script help

  1. #1

    Joined
    Oct 2013
    Posts
    3,313
    Thanks
    1,323
    Thanked
    1,859/1,104
    DL/UL
    110/0
    Mentioned
    479 times
    Time Online
    325d 9h 4m
    Avg. Time Online
    1h 53m

    Need non neopet script help

    Last edited by Bowsette; 07-12-2024 at 10:37 AM.

  2. #2

    Joined
    Jan 2012
    Posts
    7
    Userbars
    1
    Thanks
    12
    Thanked
    21/7
    Mentioned
    8 times
    Time Online
    7h 13m
    Avg. Time Online
    N/A
    Post the code...?

  3. The Following 2 Users Say Thank You to Pac For This Useful Post:

    Junellie (12-25-2024),Shawn (12-26-2024)

  4. #3

    Joined
    Oct 2013
    Posts
    3,313
    Thanks
    1,323
    Thanked
    1,859/1,104
    DL/UL
    110/0
    Mentioned
    479 times
    Time Online
    325d 9h 4m
    Avg. Time Online
    1h 53m
    Quote Originally Posted by Pac View Post
    Post the code...?
    posted it

  5. #4
    Nyu's Avatar
    Joined
    Jun 2016
    Posts
    1,033
    Pronouns
    She
    Userbars
    77
    Thanks
    1,264
    Thanked
    4,247/724
    DL/UL
    32/0
    Mentioned
    211 times
    Time Online
    100d 13h 20m
    Avg. Time Online
    46m
    It would help to know what needs fixing too.
    The expected behaviour vs the current one.

    also, if you post it inside CODE tags, it'll be easier to read.

  6. The Following User Says Thank You to Nyu For This Useful Post:

    Junellie (12-25-2024)

  7. #5

    Joined
    Oct 2013
    Posts
    3,313
    Thanks
    1,323
    Thanked
    1,859/1,104
    DL/UL
    110/0
    Mentioned
    479 times
    Time Online
    325d 9h 4m
    Avg. Time Online
    1h 53m
    Quote Originally Posted by Nyu View Post
    It would help to know what needs fixing too.
    The expected behaviour vs the current one.

    also, if you post it inside CODE tags, it'll be easier to read.
    Oh duh sorry it auto clicks 10 people at a time but before the server change it would repeat infinitely. Now it stops at person 10

  8. #6
    kopiko's Avatar
    Joined
    Dec 2011
    Posts
    513
    Userbars
    55
    Thanks
    618
    Thanked
    826/353
    DL/UL
    55/0
    Mentioned
    88 times
    Time Online
    71d 9h 56m
    Avg. Time Online
    22m
    Quote Originally Posted by Bowsette View Post
    Oh duh sorry it auto clicks 10 people at a time but before the server change it would repeat infinitely. Now it stops at person 10
    Somehow on the 10th person, the XMLHttpRequest (XHR) isn't getting returned, so this following code doesn't run

    Code:
    unsafeWindow.XMLHttpRequest.prototype.open = function () {
    if (arguments[1].includes("users/load")) {
    this.addEventListener("load", load);
    }
    if (arguments[1].includes("summary/interact")) {
    this.addEventListener("load", nextPage)
    }
    xmlHttpRequestOpen.apply(this, arguments);
    };
    As a workabout until someone comes and fixes it, you could edit the code to add a count.

    What it does now is run through 9 users, instead of going to the 10th user, it will visit the next 10 user and start again.

    Code:
    // ==UserScript==
    // @name PokeFarm Auto-Clicker
    // @Description PokeFarm Auto-Clicker
    // @match https://pokefarm.com/users/*
    // @icon https://www.google.com/s2/favicons?s...n=pokefarm.com
    // @Run-at document-start
    // @Version 1.0
    // ==/UserScript==
    
    var pageWait = 4000;
    var count=0;
    
    (function () {
    var timeoutID;
    var xmlHttpRequestOpen = unsafeWindow.XMLHttpRequest.prototype.open;
    
    function load() {
    clearTimeout(timeoutID);
    timeoutID = null;
    
    var clickables = document.querySelectorAll("div.tab-active .action > a[data-berry=aspear]:first-child, div.tab-active .berrybuttons > a:first-child");
    if (clickables.length < 1) { nextPage(); }
    clickables.forEach(function (clickable) {
    clickable.click();
    });
    }
    
    function nextPage() {
        count++;
        if (count>8){
            var link = document.querySelector('a.onetime[href="/user/~online"]');
            timeoutID = setTimeout(function () { link.click(); }, pageWait);
        }
    else {timeoutID = setTimeout(function () { document.querySelector("#partybox .mu_navlink.next").click(); }, pageWait);
    }}
    
    unsafeWindow.XMLHttpRequest.prototype.open = function () {
    if (arguments[1].includes("users/load")) {
    this.addEventListener("load", load);
    }
    if (arguments[1].includes("summary/interact")) {
    this.addEventListener("load", nextPage)
    
    }
    xmlHttpRequestOpen.apply(this, arguments);
    };
    
    const targetScriptUrl = '//pfq-static.com/js/users/users.min.js/t=1714566466';
    
    function removeScript(scriptElement) {
    if (scriptElement.src.includes(targetScriptUrl)) {
    scriptElement.parentNode.removeChild(scriptElement );
    'use strict';
    $(function() {
    function w(a, b) {
    $(document.body).trigger("pfq-purge-interactions");
    var d = a.attr("data-name");
    a.data("preload") ? (g(a, b, a.data("preload")),
    a.removeData("preload")) : ajax("users/load", {
    name: d
    }).success(function(c) {
    b.hasClass("tab-active") && g(a, b, c)
    }).failure(function(c) {
    return c.html ? (g(a, b, c),
    !1) : !0
    });
    0 < a.next().length && x(a.next(), b.next())
    }
    function x(a, b) {
    return;
    }
    function g(a, b, d) {
    b.html(d.html);
    d.name && a.find("label").text(d.name);
    d.link && b.find("h1 .uname").html(d.link).find("img").remove();
    setTimeout(function() {
    y();
    z();
    A();
    b.accordion();
    b.find(".bbcode .tabbed_interface").each(function() {
    var c = $(this)
    , e = c.find(">div.tab-active");
    e.length ? c.find(">ul>li").eq(e.index() - 1).trigger("click.tabs") : c.find(">ul>li:first-child").trigger("click.tabs")
    });
    l && $("#partybox")[0].scrollIntoView(!1)
    }, 10)
    }
    function y() {
    var a = $("#trainercard>.tc-name")[0];
    if (a) {
    if ("string" == typeof a.style.transform)
    a.style.transform = "scaleX(" + a.offsetWidth / a.scrollWidth + ")",
    a.style.transformOrigin = "left top";
    else
    for (var b = 14; a.scrollWidth > a.offsetWidth; )
    a.style.fontSize = --b + "pt";
    a.style.overflow = "visible"
    }
    if (a = $("#trainercard>.tc-status")[0]) {
    b = 24;
    do
    a.style.fontSize = b + "pt",
    b--;
    while (10 <= b && a.scrollHeight > a.offsetHeight)
    }
    }
    function z() {
    var a = $("#aboutbox");
    a.find(">h3>.menu").remove();
    a.find(">div>.menu").remove()
    }
    function A() {
    function a(m) {
    return function(h) {
    h.preventDefault();
    $("#multiuser>ul>li.tab-active")[m]("li").trigger("click")
    }
    }
    var b = $("<a>").attr("href", "#").addClass("mu_navlink")
    , d = b.clone()
    , c = b.clone()
    , e = $('<input type="checkbox" />').prop("checked", 1 == l)
    , n = $("<label> Auto-scroll</label>")
    , p = $('<input type="checkbox" />').prop("checked", 1 == k)
    , q = $('<label class="compact-view-toggle"> Compact View</label>');
    e.on("click", function() {
    l = localStorage[$.USERID + ".multi.autoscroll"] = this.checked ? 1 : 0
    });
    n.prepend(e);
    p.on("click", function() {
    k = localStorage[$.USERID + ".multi.compact"] = this.checked ? 1 : 0;
    $(document.documentElement)[k ? "addClass" : "removeClass"]("multi-compact")
    });
    q.prepend(p);
    c.addClass("toggle").text("\ud83d\udd04\ufe0e").on ("click", function() {
    $("#partybox").toggleClass("swap-panels")
    });
    b.addClass("prev").text("< Previous").on("click", a("prev"));
    d.addClass("next").text("Next >").on("click", a("next"));
    e = $("#multiuser>ul>li.tab-active");
    0 == e.prev("li").length && b.addClass("disabled").prop("disabled", !0);
    if (0 == e.next("li").length) {
    var r = location.search.match(/\bsrc=~(\w+)\b/);
    if (r)
    d.text("Get more +").off("click").on("click", function(m) {
    function h() {
    0 < $(".action.working").length ? setTimeout(h, 100) : location.href = "/user/~" + r[1]
    }
    m.preventDefault();
    d.replaceWith('<span class="mu_navlink next disabled">Loading...</span>');
    h()
    });
    else
    d.addClass("disabled").prop("disabled", !0)
    }
    $(".fieldslink").before(c, b, d).after(q, "&emsp;", n)
    }
    function B() {
    var a = f.join(" ");
    a.match(/(\(\d+,\d+\)(?: \(\d+,\d+\)){2,}) \1/) && (setTimeout(function() {
    ajax("users/integrity", {
    events: a
    }).failure(function() {
    return !1
    })
    }, 1E3),
    f = [])
    }
    $("#multiuser").on("click", ">ul>li", function() {
    var a = $(this)
    , b = a.index()
    , d = a.parent().parent().find(">div")
    , c = d.eq(b);
    d.empty().append($.loadingSpinner());
    location.hash = "tab=" + (1 + b);
    w(a, c)
    });
    var t = location.hash.match(/tab=(\d+)/);
    $("#multiuser>ul>li").eq(t ? t[1] - 1 : 0).trigger("click");
    var l = +(localStorage[$.USERID + ".multi.autoscroll"] || 0)
    , k = +(localStorage[$.USERID + ".multi.compact"] || 0);
    k && $(document.documentElement).addClass("multi-compact");
    $(window).on("keydown.multiprofile_shortcuts", function(a) {
    if (0 == $(a.target).closest("input, textarea").length)
    switch (a.keyCode) {
    case 37:
    case 65:
    $("#multiuser .mu_navlink.prev").trigger("click");
    break;
    case 39:
    case 68:
    $("#multiuser .mu_navlink.next").trigger("click")
    }
    });
    var u = -1
    , v = -1
    , f = [];
    $(window).on("mousemove", function(a) {
    u = a.pageX;
    v = a.pageY
    }).on("mousedown keydown", function() {
    var a = "(" + u + "," + v + ")";
    if (0 == f.length || f[f.length - 1] != a)
    f.push(a),
    B()
    });
    $("#multiuser").on("click", "a.summarylink, a.fieldslink", function(a) {
    var b = $(this);
    b.data("origtext") || (a.preventDefault(),
    b.data("origtext", b.text()),
    b.text("Click again to open"),
    setTimeout(function() {
    b.text(b.data("origtext"));
    b.data("origtext", null)
    }, 2E3))
    })
    });
    
    }
    }
    
    function handleMutations(mutations) {
    for (const mutation of mutations) {
    for (const node of mutation.addedNodes) {
    if (node.nodeName === 'SCRIPT') {
    removeScript(node);
    }
    }
    }
    }
    
    const observer = new MutationObserver(handleMutations);
    observer.observe(document.documentElement, { childList: true, subtree: true });
    })();

  9. The Following 3 Users Say Thank You to kopiko For This Useful Post:

    Bowsette (07-12-2024),Junellie (12-25-2024),xmilo (12-27-2024)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •