-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAutoFan
77 lines (59 loc) · 1.74 KB
/
AutoFan
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
75
76
77
$(document).ready(function(){
//When script loads
API.sendChat("Medigador de fan on !")
$('#button-vote-positive').click();
//global var
var total = 0;
if (localStorage.usData === undefined) {
localStorage.usData = JSON.stringify({
counter: 0,
})
}
function fanEveryone(data) {
var relationship = require('app/models/TheUserModel');
if (relationship.getRelationship(data.id) < 2) {
var fan = require('app/services/user/UserFanService');
fan = new fan(true, data.id);
var totalCount = JSON.parse(localStorage.usData);
++totalCount.counter;
console.log('Fanned new user: ' + data.username + '. Total number fanned: ' + totalCount.counter);
localStorage.usData = JSON.stringify(totalCount);
total + 1;
}
}
API.on(API.USER_FAN, fanEveryone);
//chat commands and so on below here
var intervalMessage = setInterval(function(){message();},240000);
function message(){
var m, msgs;
msgs = ["Fan 4 fan ?", "Vira meu fan que viro o seu automaticamente!", "Retribuo fan! ", "Fan 4 Fan ! :))", "Quem virar meu fan viro de volta1"];
m = Math.floor(Math.random() * msgs.length);
API.sendChat(msgs[m]);
}
API.on(API.CHAT_COMMAND, command);
function command(value)
{
switch(value)
{
case "/stopchat":
clearInterval(intervalMessage);
API.chatLog("FanBOT CHAT OFFLINE => BOT ONNLINE", alert)
break;
case "/restart":
intervalMessage = setInterval(function(){message();},240000);
break;
case "/fans?":
//API.sendChat(total + " People fanned since launched");
API.chatLog(total + " People fanned since launched", alert)
break;
case "/chat":
message();
break;
}
}
API.on(API.DJ_ADVANCE, woot);
function woot()
{
$('#button-vote-positive').click();
}
});