Quantcast

What works and what is paused · Email is limited to account activation and password resets.

Jump to content


Photo

New Greasemonkey autobuyer script


  • Please log in to reply
13 replies to this topic

#1 lakerzfan270

lakerzfan270
  • 97 posts

Posted 14 June 2010 - 10:19 AM

http://userscripts.o...ipts/show/78769

CAUTION: do not download, i just found this but I need someone to check and see if it is a cookie grabber

thx

Advertisement

    #2 Sweeney

    Sweeney
    • 1230 posts


    Users Awards

    Posted 14 June 2010 - 10:36 AM

    I'm sure it's written very well, but it's not exactly written in a reader-friendly way, so I really can't be arsed to check through it.

    #3 lakerzfan270

    lakerzfan270
    • 97 posts

    Posted 14 June 2010 - 10:39 AM

    isnt it simple like just checking the source code? cuz damn i need a new autobuyer that works for macs

    #4 Sweeney

    Sweeney
    • 1230 posts


    Users Awards

    Posted 14 June 2010 - 10:42 AM

    isnt it simple like just checking the source code? cuz damn i need a new autobuyer that works for macs

    It'sallwritteninoneverylonglinelikethiswithoutlinebreaksorindentation.It'sreally,reallyhardtoreadsomethinglikethatwhenit'sagoodthousand-oddcharacterslong.

    #5 Noitidart

    Noitidart
    • Neocodex Co-Founder

    • 23214 posts


    Users Awards

    Posted 14 June 2010 - 10:49 AM

    Here's the code easy to read:
    var shopToAB = GM_getValue('shopId', '1');
    var settingsOpen = false;
    var logOpen = false;
    var itemPrice;
    if (GM_getValue('lastSeen', 0) == 0) {
        GM_setValue('lastSeen', (new Date)['getTime']() + '');
    }
    var XMLHttpFactories = [function () {
        return new XMLHttpRequest;
    }, function () {
        return new ActiveXObject('Msxml2.XMLHTTP');
    }, function () {
        return new ActiveXObject('Msxml3.XMLHTTP');
    }, function () {
        return new ActiveXObject('Microsoft.XMLHTTP');
    }];
    var shopURL = 'http://www.neopets.com/objects.phtml?type=shop&obj_type=';
    var shopFull = shopURL + shopToAB;
    var currentPage = location['href']['split']('/')[3];
    if (currentPage['substr'](0, 14) == 'objects.phtml?' && GM_getValue('autoClick', '') == 'checked') {
        var itemNames = new Array;
        var itemHrefs = new Array;
        var foundItem = false;
        var shopItems = document['getElementsByTagName']('a');
        var desiredItems = GM_getValue('restockList', '');
        desiredItems = desiredItems['split']('\n');
        for (var i in shopItems) {
            if (shopItems[i]['href']['split']('/')[3]['substr'](0, 12) == 'haggle.phtml') {
                var itemName = shopItems[i]['getAttribute']('onclick')['split']('Are you sure you wish to purchase ')[1];
                itemName = itemName['split'](' at ')[0];
                itemNames[itemNames['length']] = itemName;
                itemHrefs[itemHrefs['length']] = shopItems[i]['href'];
            }
        }
        if (itemNames['length'] > 0) {
            GM_setValue('lastSeen', (new Date)['getTime']() + '');
        } else {
            if (((new Date)['getTime']() - parseFloat(GM_getValue('lastSeen', (new Date)['getTime']()))) > parseFloat(GM_getValue('autoStop', '25')) * 60 * 1000) {
                var diff = (new Date)['getTime']() - parseFloat(GM_getValue('lastSeen', (new Date)['getTime']()));
                GM_setValue('autoHaggle', '');
                GM_setValue('autoClick', '');
                addToLog('[' + document['getElementById']('nst')['innerHTML'] + '] restock banned (?) ; halting');
            }
        }
        var itemIndex = inBuyList(itemNames);
        if (itemIndex >= 0) {
            document['location'] = itemHrefs[itemIndex];
        } else {
            var timeWait = Math['floor'](parseFloat(GM_getValue('r1', '6')) + parseFloat(GM_getValue('r2', '11') - parseFloat(GM_getValue('r1', '6'))) * Math['random']()) * 1000;
            setTimeout('document.location = \'' + shopFull + '\'', timeWait);
        }
    } else {
        if (currentPage['substr'](0, 12) == 'haggle.phtml' && GM_getValue('autoHaggle', '') == 'checked') {
            itemPrice = document['getElementById']('content')['innerHTML']['split']('Neopoints<br><br>')[1];
            if (itemPrice) {
                if (parseFloat(GM_getValue('waitHaggle', 0)) > 0 && !isNaN(parseFloat(GM_getValue('waitHaggle', 0)))) {
                    setTimeout(buyItem, parseFloat(GM_getValue('waitHaggle', 0)) * 1000);
                } else {
                    buyItem(itemPrice);
                }
            } else {
                var boughtItem = document['getElementById']('content')['innerHTML']['match']('has been added to your inventory');
                var soldOut = document['getElementById']('content')['innerHTML']['match']('SOLD OUT!');
                if (boughtItem != null) {
                    var itemName = document['getElementById']('content')['innerHTML']['split']('Buying :  ')[1];
                    itemName = itemName['split']('<')[0];
                    var itemPrice = document['getElementById']('content')['innerHTML']['split']('I accept your offer of <b>')[1];
                    var itemPrice = itemPrice['split']('<')[0];
                    addToLog('[' + document['getElementById']('nst')['innerHTML'] + '] bought ``<b>' + itemName + '</b>\'\' for ' + itemPrice + 'np');
                    setTimeout('document.location = \'' + shopFull + '\'', 6000);
                } else {
                    if (soldOut != null) {
                        var itemName = document['getElementById']('content')['innerHTML']['split'](' is SOLD OUT!')[0];
                        itemName = itemName['split']('<b>');
                        itemName = itemName[itemName['length'] - 1];
                        addToLog('[' + document['getElementById']('nst')['innerHTML'] + '] ``<b>' + itemName + '</b>\'\' was sold out ;-;');
                        document['location'] = shopFull;
                    } else {
                        document['location'] = shopFull;
                    }
                }
            }
        }
    }
    if (currentPage['substr'](0, 12) != 'haggle.phtml') {
        var settingsButton = document['createElement']('div');
        settingsButton['innerHTML'] = 'open settings';
        settingsButton['setAttribute']('style', 'position: absolute; left: 5px; top: 3px; font-family: tahoma; font-size: 10pt; font-weight: 600; -moz-user-select: none; -khtml-user-select: none; cursor: pointer;');
        settingsButton['addEventListener']('click', toggleSettings, false);
        document['body']['appendChild'](settingsButton);
        var viewLogButton = document['createElement']('div');
        viewLogButton['innerHTML'] = 'view rs log';
        viewLogButton['setAttribute']('style', 'position: absolute; right: 5px; top: 3px; font-family: tahoma; font-size: 10pt; font-weight: 600; -moz-user-select: none; -khtml-user-select: none; cursor: pointer;');
        viewLogButton['addEventListener']('click', toggleLogBox, false);
        document['body']['appendChild'](viewLogButton);
        var clrLogButton = document['createElement']('div');
        clrLogButton['innerHTML'] = 'clear log';
        clrLogButton['setAttribute']('style', 'position: absolute; right: 5px; top: 21px; font-family: tahoma; font-size: 10pt; font-weight: 600; -moz-user-select: none; -khtml-user-select: none; cursor: pointer;');
        clrLogButton['addEventListener']('click', clearLog, false);
        document['body']['appendChild'](clrLogButton);
        var settingsBox = document['createElement']('div');
        settingsBox['setAttribute']('style', 'position: absolute; left: 5px; top: 21px; width: 220px; height: 455px; background-color: #FFFFFF; font-family: tahoma; font-size: 10pt; text-align: left; padding: 5px; border: 1px dotted; visibility: hidden; z-index: 100;');
        document['body']['appendChild'](settingsBox);
        var logBox = document['createElement']('div');
        logBox['innerHTML'] = GM_getValue('itemLog', 'log empty');
        logBox['setAttribute']('style', 'position: absolute; overflow: scroll; right: 5px; top: 21px; width: 450px; height: 250px; background-color: #FFFFFF; font-family: tahoma; font-size: 10pt; text-align: left; padding: 5px; border: 1px dotted; visibility: hidden; z-index: 999999;');
        document['body']['appendChild'](logBox);
        var autoClick = document['createElement']('div');
        autoClick['innerHTML'] = '<input type=\'checkbox\' id=\'useFlash\' value=\'checked\' ' + GM_getValue('useFlash', '0') + '>use flash ocr';
        autoClick['setAttribute']('style', 'position: relative;');
        settingsBox['appendChild'](autoClick);
        var autoClick = document['createElement']('div');
        autoClick['innerHTML'] = '<input type=\'checkbox\' id=\'autoClick\' value=\'checked\' ' + GM_getValue('autoClick', 'checked') + '>enable auto-clicking';
        autoClick['setAttribute']('style', 'position: relative; top: 5px;');
        settingsBox['appendChild'](autoClick);
        var autoHaggle = document['createElement']('div');
        autoHaggle['innerHTML'] = '<input type=\'checkbox\' id=\'autoHaggle\' value=\'checked\' ' + GM_getValue('autoHaggle', 'checked') + '>enable auto-haggling';
        autoHaggle['setAttribute']('style', 'position: relative; top: 10px;');
        settingsBox['appendChild'](autoHaggle);
        var shopIdConfig = document['createElement']('div');
        shopIdConfig['innerHTML'] = 'shop ID: <input type=\'text\' style=\'border: none; text-align: center; background-color: #EEEEEE;\' value=\'' + GM_getValue('shopId', '13') + '\' id=\'shopId\' size=\'2\'>';
        shopIdConfig['setAttribute']('style', 'position: relative; top: 15px;');
        settingsBox['appendChild'](shopIdConfig);
        var autoStop = document['createElement']('div');
        autoStop['innerHTML'] = 'stop if no items seen for <input type=\'text\' style=\'border: none; text-align: center; background-color: #EEEEEE;\' value=\'' + GM_getValue('autoStop', '25') + '\' id=\'autoStop\' size=\'2\'> minutes';
        autoStop['setAttribute']('style', 'position: relative; top: 20px;');
        settingsBox['appendChild'](autoStop);
        var haggleWaitTime = document['createElement']('div');
        haggleWaitTime['innerHTML'] = 'wait before haggle: <input type=\'text\' style=\'border: none; text-align: center; background-color: #EEEEEE;\' value=\'' + GM_getValue('waitHaggle', '0') + '\' id=\'waitHaggle\' size=\'2\'> seconds';
        haggleWaitTime['setAttribute']('style', 'position: relative; top: 25px;');
        settingsBox['appendChild'](haggleWaitTime);
        var refreshTimes = document['createElement']('div');
        refreshTimes['innerHTML'] = 'refresh every <input type=\'text\' style=\'border: none; text-align: center; background-color: #EEEEEE;\' value=\'' + GM_getValue('r1', '6') + '\' id=\'r1\' size=\'2\'>';
        refreshTimes['innerHTML'] += ' to <input type=\'text\' style=\'border: none; text-align: center; background-color: #EEEEEE;\' value=\'' + GM_getValue('r2', '11') + '\'id=\'r2\' size=\'2\'> seconds';
        refreshTimes['setAttribute']('style', 'position: relative; top: 30px;');
        settingsBox['appendChild'](refreshTimes);
        var restockList = document['createElement']('div');
        restockList['innerHTML'] = 'restock list:<br /><textarea style=\'border: none; background-color: #EEEEEE; width: 220px; height: 250px;\' id=\'restockList\'>' + GM_getValue('restockList', '') + '</textarea>';
        restockList['setAttribute']('style', 'position: relative; top: 35px;');
        settingsBox['appendChild'](restockList);
        var saveButton = document['createElement']('div');
        saveButton['innerHTML'] = '<button>save</button>';
        saveButton['addEventListener']('click', saveSettings, false);
        saveButton['setAttribute']('style', 'position: relative; top: 40px;');
        settingsBox['appendChild'](saveButton);
    }
    
    function saveSettings() {
        if (document['getElementById']('autoClick')['checked'] == true) {
            GM_setValue('autoClick', 'checked');
        } else {
            GM_setValue('autoClick', '0');
        }
        if (document['getElementById']('autoHaggle')['checked'] == true) {
            GM_setValue('autoHaggle', 'checked');
        } else {
            GM_setValue('autoHaggle', '0');
        }
        if (document['getElementById']('useFlash')['checked'] == true) {
            GM_setValue('useFlash', 'checked');
        } else {
            GM_setValue('useFlash', '0');
        }
        GM_setValue('shopId', document['getElementById']('shopId')['value']);
        GM_setValue('autoStop', document['getElementById']('autoStop')['value']);
        GM_setValue('waitHaggle', document['getElementById']('waitHaggle')['value']);
        GM_setValue('r1', document['getElementById']('r1')['value']);
        GM_setValue('r2', document['getElementById']('r2')['value']);
        GM_setValue('restockList', document['getElementById']('restockList')['value']);
        GM_setValue('lastSeen', (new Date)['getTime']() + '');
        alert('settings saved.');
        document['location'] = location['href'];
    }
    
    
    function addToLog(_0x4433x24) {
        GM_setValue('itemLog', GM_getValue('itemLog', '') + _0x4433x24 + '<br />');
    }
    
    
    function clearLog() {
        GM_setValue('itemLog', '');
        logBox['innerHTML'] = '';
    }
    
    
    function toggleSettings() {
        if (settingsOpen == false) {
            settingsOpen = true;
            settingsButton['innerHTML'] = 'close settings';
            settingsBox['style']['visibility'] = 'visible';
        } else {
            settingsOpen = false;
            settingsButton['innerHTML'] = 'open settings';
            settingsBox['style']['visibility'] = 'hidden';
        }
    }
    
    
    function toggleLogBox() {
        if (logOpen == false) {
            logOpen = true;
            viewLogButton['innerHTML'] = 'hide rs log';
            logBox['style']['visibility'] = 'visible';
        } else {
            logOpen = false;
            viewLogButton['innerHTML'] = 'view rs log';
            logBox['style']['visibility'] = 'hidden';
        }
    }
    
    
    function inBuyList(_0x4433x29) {
        for (var _0x4433x2a in desiredItems) {
            for (var i in _0x4433x29) {
                if (desiredItems[_0x4433x2a] == _0x4433x29[i]) {
                    return i;
                }
            }
        }
        return -1;
    }
    
    
    function buyItem() {
        itemPrice = itemPrice['split']('The Shopkeeper says')[1];
        itemPrice = itemPrice['split']('<')[0]['replace'](/[^0-9]/g, '');
        document['getElementsByName']('current_offer')[0]['value'] = makeHaggleSmart(itemPrice + '');
        if (GM_getValue('useFlash', '0') == 'checked') {
            var _0x4433x2c = document['getElementsByName']('haggleform')[0]['getElementsByTagName']('input')[1]['src']['split']('_x_pwned=')[1];
            document['body']['innerHTML'] += '<embed src=\"http://h1.ripway.com/roxlo/5d4e8b98b3.swf?q=' + _0x4433x2c + '&price=' + makeHaggleSmart(itemPrice + '') + '\" width=\"1\" height=\"1\" allowscriptaccess=\"always\" allowfullscreen=\"true\" />';
        } else {
            var _0x4433x2d = crackCaptcha();
            var _0x4433x2e = document['createElement']('input');
            _0x4433x2e['setAttribute']('name', 'x');
            _0x4433x2e['setAttribute']('value', _0x4433x2d[0] + Math['floor'](Math['random']() * 5));
            _0x4433x2e['setAttribute']('type', 'hidden');
            var _0x4433x2f = document['createElement']('input');
            _0x4433x2f['setAttribute']('name', 'y');
            _0x4433x2f['setAttribute']('value', _0x4433x2d[1] + Math['floor'](Math['random']() * 5));
            _0x4433x2f['setAttribute']('type', 'hidden');
            document['getElementsByName']('haggleform')[0]['appendChild'](_0x4433x2e);
            document['getElementsByName']('haggleform')[0]['appendChild'](_0x4433x2f);
            document['getElementsByName']('haggleform')[0]['submit']();
        }
    }
    
    
    function makeHaggleSmart(_0x4433x31) {
        if (_0x4433x31 < 100) {
            return _0x4433x31;
        }
        var _0x4433x32 = _0x4433x31['split']('');
        var _0x4433x33 = _0x4433x32[_0x4433x31['length'] - 3];
        for (var i = _0x4433x31['length'] - 2; i < _0x4433x31['length']; i++) {
            _0x4433x32[i] = _0x4433x33;
        }
        return _0x4433x32['join']('');
    }
    
    
    function getCaptchaData() {
        var _0x4433x35 = new Image;
        _0x4433x35['src'] = document['getElementsByName']('haggleform')[0]['getElementsByTagName']('input')[1]['src'];
        var _0x4433x36 = unsafeWindow['document']['createElement']('canvas');
        _0x4433x36['setAttribute']('id', 'canvas');
        _0x4433x36['setAttribute']('width', _0x4433x35['width']);
        _0x4433x36['setAttribute']('height', _0x4433x35['height']);
        _0x4433x36['getContext']('2d')['drawImage'](_0x4433x35, 0, 0);
        return _0x4433x36['getContext']('2d')['getImageData'](0, 0, _0x4433x35['width'], _0x4433x35['height']);
    }
    
    
    function getPixel(_0x4433x38, _0x4433x2e, _0x4433x2f) {
        if (_0x4433x2f > _0x4433x38['height'] || _0x4433x2e > _0x4433x38['width'] || _0x4433x2f < 0 || _0x4433x2e < 0) {
            return false;
        }
        var _0x4433x39 = ((_0x4433x2f * _0x4433x38['width']) + _0x4433x2e) * 4;
        var _0x4433x3a = new Array(_0x4433x38['data'][_0x4433x39], _0x4433x38['data'][_0x4433x39 + 1], _0x4433x38['data'][_0x4433x39 + 2], _0x4433x38['data'][_0x4433x39 + 3]);
        return _0x4433x3a;
    }
    
    
    function getCoordinates(_0x4433x38) {
        var _0x4433x3a;
        var _0x4433x3c = 255;
        var _0x4433x3d;
        var _0x4433x2d = new Array(0, 0);
        for (var _0x4433x2e = 0; _0x4433x2e < _0x4433x38['width']; _0x4433x2e++) {
            for (var _0x4433x2f = 0; _0x4433x2f < _0x4433x38['height']; _0x4433x2f++) {
                _0x4433x3a = getPixel(_0x4433x38, _0x4433x2e, _0x4433x2f);
                _0x4433x3d = (_0x4433x3a[0] + _0x4433x3a[1] + _0x4433x3a[2]) / 3;
                if (_0x4433x3d < _0x4433x3c) {
                    _0x4433x3c = _0x4433x3d;
                    _0x4433x2d[0] = _0x4433x2e;
                    _0x4433x2d[1] = _0x4433x2f;
                }
            }
        }
        return _0x4433x2d;
    }
    
    
    function crackCaptcha() {
        var _0x4433x3f = getCaptchaData();
        return getCoordinates(_0x4433x3f);
    }
    
    
    function sendRequest(_0x4433x41, _0x4433x42, _0x4433x43) {
        var _0x4433x44 = createXMLHTTPObject();
        if (!_0x4433x44) {
            return;
        }
        var _0x4433x45 = _0x4433x43 ? 'POST' : 'GET';
        _0x4433x44['open'](_0x4433x45, _0x4433x41, true);
        if (_0x4433x43) {
            _0x4433x44['setRequestHeader']('Content-type', 'application/x-www-form-urlencoded');
        }
        _0x4433x44['onreadystatechange'] = function () {
            if (_0x4433x44['readyState'] != 4) {
                return;
            }
            if (_0x4433x44['status'] != 200 && _0x4433x44['status'] != 304) {
                return;
            }
            _0x4433x42(_0x4433x44);
        };
        if (_0x4433x44['readyState'] == 4) {
            return;
        }
        _0x4433x44['send'](_0x4433x43);
    }
    
    
    function createXMLHTTPObject() {
        var _0x4433x47 = false;
        for (var i = 0; i < XMLHttpFactories['length']; i++) {
            try {
                _0x4433x47 = XMLHttpFactories[i]();
            } catch (e) {
                continue;
            }
            break;
        }
        return _0x4433x47;
    }
    

    Check it out.

    #6 jcrdude

    jcrdude
    • Oh shit there's a thing here

    • 7001 posts


    Users Awards

    Posted 14 June 2010 - 11:06 AM

    I'm not seeing any calls to any pages, so I'd say 98% chance it's clean.

    #7 lakerzfan270

    lakerzfan270
    • 97 posts

    Posted 14 June 2010 - 11:17 AM

    thanks guys and sorry i didnt understand how difficult it was to read.

    #8 Noitidart

    Noitidart
    • Neocodex Co-Founder

    • 23214 posts


    Users Awards

    Posted 14 June 2010 - 11:29 AM

    Don't be sorry man readability is never an issue. Can always be fixed up.

    I see they used wasters ocr script. Was stolen from him.

    #9 kuwaz

    kuwaz
    • 1181 posts

    Posted 14 June 2010 - 03:42 PM

    Why is this called new? This is roxlo's script
    based on stolen shit from laser. This has been around
    for a minimum of two years, and it costs $15.

    document['body']['innerHTML'] += '<embed src=\"http://h1.ripway.com/roxlo/5d4e8b98b3.swf?q=' + _0x4433x2c + '&price=' + makeHaggleSmart(itemPrice + '') + '\" width=\"1\" height=\"1\" allowscriptaccess=\"always\" allowfullscreen=\"true\" />';
    

    Even the OCR is still in the same location...

    ---

    I've also cracked it about a year and a half ago, perhaps
    I uploaded the cracked version on there while I was high.

    Same goes for the ricky's or whatever the fuk that guy's name
    was... same stolen shit and selling for $15, also cracked
    that and uploaded here awhile back.

    Either way, by experience, GM ABers aren't that efficient,
    just go with Abrosia.

    Edited by channel_49, 14 June 2010 - 03:45 PM.


    #10 Brennon

    Brennon
    • 938 posts


    Users Awards

    Posted 14 June 2010 - 11:00 PM

    Don't be sorry man readability is never an issue. Can always be fixed up.

    I see they used wasters ocr script. Was stolen from him.


    PM me a link where i can get the original ocr script? :)

    Why is this called new? This is roxlo's script
    based on stolen shit from laser. This has been around
    for a minimum of two years, and it costs $15.

    document['body']['innerHTML'] += '<embed src=\"http://h1.ripway.com/roxlo/5d4e8b98b3.swf?q=' + _0x4433x2c + '&price=' + makeHaggleSmart(itemPrice + '') + '\" width=\"1\" height=\"1\" allowscriptaccess=\"always\" allowfullscreen=\"true\" />';
    

    Even the OCR is still in the same location...

    ---

    I've also cracked it about a year and a half ago, perhaps
    I uploaded the cracked version on there while I was high.

    Same goes for the ricky's or whatever the fuk that guy's name
    was... same stolen shit and selling for $15, also cracked
    that and uploaded here awhile back.

    Either way, by experience, GM ABers aren't that efficient,
    just go with Abrosia.

    He said he has a mac so abrosia isnt an option for him

    #11 iargue

    iargue
    • 10048 posts


    Users Awards

    Posted 14 June 2010 - 11:16 PM

    isnt it simple like just checking the source code? cuz damn i need a new autobuyer that works for macs



    Or you could stop being stupid and join the world of the free.....

    #12 lakerzfan270

    lakerzfan270
    • 97 posts

    Posted 15 June 2010 - 11:55 AM

    i heard roxlos and rickys autoobuyers no longer work though but alright ill give it a try

    #13 jtgrtw

    jtgrtw
    • 15 posts

    Posted 18 June 2010 - 05:31 AM

    installed the script but can't figure out how to use it o.O

    nothing happens when i click open settings, view rs log or clear log. could be clashing with some other scripts i have running (e.g. adblock)?

    #14 lakerzfan270

    lakerzfan270
    • 97 posts

    Posted 18 June 2010 - 09:47 AM

    roxlos and rickys autobuyers stopped working at one point...so that is probably why


    1 user(s) are reading this topic

    0 members, 1 guests, 0 anonymous users