-
Notifications
You must be signed in to change notification settings - Fork 4
/
change.js
41 lines (38 loc) · 1.38 KB
/
change.js
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
on("chat:message", function(msg) {
//This allows players to enter !sr <number> to roll a number of d6 dice with a target of 4.
if(msg.type == "api" && msg.content.indexOf("!change ") !== -1) {
var sndr=msg.who;
var raw_msg = msg.content.replace("!change ", "");
//Marking the log, note that if logit is disabled, nothing will be shown
logit("Following results will track the session of "+msg.who);
logit("The command input was : "+raw_msg);
var cmd=message.split(" ");
if (cmd.length<2){
return null;
};
var cmd_name=cmd[0];
var cmd_val=cmd[1];
var auth=[" attr_Life_Points",
"attr_Endurance_Points",
"attr_general_item_weapon1",
"attr_general_item_weapon2",
"attr_general_item_weapon3",
"attr_base_damage_dices",
"attr_exal_damage_dices"];
logit(auth);
logit(cmd_name);
logit(cmd_val);/*
for (var i = 0; i < auth.length; i++) {
if (auth[i].indexOf(cmd_name)!==-1){
var attribObj = findObjs({ type: 'attribute', characterid: character.id, name: auth[i] })[0];
logit(attribObj);
logit(cmd_val);
// if (attribObj){attribObj.set('current', cmd_val);};
}
}*/
};
};
function logit(txt){
//Due to the restriction of console.log()
log(txt);
};