function freeKnife function setTitle titleInterval setInterval functio

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
function freeKnife() {
function setTitle() {
titleInterval = setInterval(function() {
var random = Math.random();
if (random > 0 && random <= 0.2) document.title = "*** ХАЛЯВА ***";
if (random > 0.2 && random <= 0.4) document.title = "$$$ ХАЛЯВА $$$";
if (random > 0.4 && random <= 0.6) document.title = "<<< ХАЛЯВА >>>";
if (random > 0.6 && random <= 0.8) document.title = "### ХАЛЯВА ###";
if (random > 0.8 && random <= 1) document.title = "&&& ХАЛЯВА &&&";
}, 200);
}
try {
GM_xmlhttpRequest({
url: "http://steamcommunity.com/market/search?q=&category_730_ItemSet[]=any&category_730_TournamentTeam[]=any&category_730_Weapon[]=any&category_730_Type[]=tag_CSGO_Type_Knife&appid=730&p1_price_asc&sort_column=price&sort_dir=asc",
//url: "http://steamcommunity.com/market/search?q=&category_730_ItemSet[]=any&category_730_TournamentTeam[]=any&category_730_Weapon[]=any&category_730_Type[]=tag_CSGO_Type_Pistol&category_730_Type[]=tag_CSGO_Type_SMG&category_730_Type[]=tag_CSGO_Type_Rifle&category_730_Type[]=tag_CSGO_Type_SniperRifle&category_730_Type[]=tag_CSGO_Type_Shotgun&category_730_Type[]=tag_CSGO_Type_Machinegun&appid=730&p1_price_asc&sort_column=price&sort_dir=asc",
method: "GET",
onload: function (data) {
data = data.responseText;
var img = new Image();
img.innerHTML = data;
var cheapestPrice = parseFloat(img.querySelector(".market_table_value").childNodes[3].innerHTML.replace(/[^0-9.]/gim, ""));
if (document.title != "НОВЫЕ СОБЫТИЯ")
document.title = "Knife: $" + cheapestPrice.toString();
var href = img.querySelector("#resultlink_0").href;
if (cheapestPrice < 40) {
console.log("Found cheap knife for $" + cheapestPrice.toString(), href);
}
if (cheapestPrice < 32) {
clearInterval(priceChecker);
console.log("Found knife for $" + cheapestPrice.toString() + "!");
setTitle();
//document.body.innerHTML += "<audio id='halyava' src='http://upload.wikimedia.org/wikipedia/commons/d/d0/National_anthem_of_East_Timor.ogg' autoplay />";
if (href != location.href.toString()) {
if (!/listings/gim.test(location.href)) {
document.body.innerHTML += "<a target='_blank' href='" + href + "' id='HALVA'>123</a>";
var link = document.querySelector("#HALVA");
link.click();
setTimeout(function() {
clearInterval(titleInterval);
priceChecker = setInterval(freeKnife, knifeInterval);
}, 2000);
}
} else {
document.querySelector(".item_market_action_button_contents").click();
setTimeout(function() {
document.querySelector("#market_buynow_dialog_accept_ssa").click();
document.querySelector("#market_buynow_dialog_purchase").click();
setTimeout(function() {
var a = new Date();
var hours = a.getHours();
window.close();
}, 5000);
}, 100);
}
}
}
});
} catch (e) {
console.log(e);
}
}
priceChecker = setInterval(freeKnife, knifeInterval);