blob: cb9e783bf3f58afcfd41b6a5a39858969b834d63 (
plain)
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
|
function hireMiner(){
sendRequest("craftmine.php", "op=hireMiner", function(xhr) {
//data.gold -= 40;
var ret = xhr.responseText;
if(ret != "you need to create a guild first" && ret!=""){
console.log(ret);
var tmp = ret.split(",");
console.log(tmp);
data.gold = parseInt(tmp[0]);
data.miners = parseInt(tmp[1]);
updateData("gold","miners");
}
})
}
function createGuild(){
sendRequest("craftmine.php", "op=createGuild", function(xhr) {
var ret = xhr.responseText;
if(ret != "g"){
document.getElementById("guild").innerHTML = ret;
data.gold -= 50;
updateData("gold");
}
})
}
|