forked from Bluefissure/cactbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
138 lines (129 loc) · 7.12 KB
/
test.html
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<html>
<head>
<title></title>
<meta charset="utf-8" />
<!-- OverlayPlugin widget resize handle -->
<link rel="stylesheet" href="../../resources/defaults.css">
<link rel="stylesheet" href="../../resources/resize_handle.css">
<script src="../../resources/resize_handle.js"></script>
<script src="test.js"></script>
<style>
body, html {
margin: 0;
}
html {
height: 100%;
overflow: hidden;
background-color: transparent;
/* FFXIV font look */
font-family: "Meiryo";
font-size: 12px;
text-shadow: -1px 0 3px #217AA2, 0 1px 3px #217AA2, 1px 0 3px #217AA2, 0 -1px 3px #217AA2;
font-weight: 300;
color: #E2EBF5;
}
div {
overflow: hidden;
padding-left: 2px;
padding-right: 2px;
}
</style>
<script>
document.addEventListener("onZoneChangedEvent", function (e) {
document.getElementById("currentZone").innerText = "currentZone: " + e.detail.zoneName;
});
document.addEventListener("onInCombatChangedEvent", function (e) {
document.getElementById("inCombat").innerText = "inCombat: act: " + (e.detail.inACTCombat ? "yes" : "no") + " game: " + (e.detail.inGameCombat ? "yes" : "no");
});
document.addEventListener("onPlayerChangedEvent", function (e) {
document.getElementById("id").innerText = e.detail.id.toString(16);
document.getElementById("hp").innerText = e.detail.currentHP + '/' + e.detail.maxHP;
document.getElementById("mp").innerText = e.detail.currentMP + '/' + e.detail.maxMP;
document.getElementById("tp").innerText = e.detail.currentTP + '/' + e.detail.maxTP;
document.getElementById("cp").innerText = e.detail.currentCP + '/' + e.detail.maxCP;
document.getElementById("gp").innerText = e.detail.currentGP + '/' + e.detail.maxGP;
document.getElementById("job").innerText = e.detail.level + ' ' + e.detail.job;
document.getElementById("bait").innerText = e.detail.bait;
document.getElementById("debug").innerText = e.detail.debugJob;
var jobDetail = e.detail.jobDetail;
if (e.detail.job == "RDM") {
document.getElementById("jobinfo").innerText = jobDetail.whiteMana + " | " + jobDetail.blackMana;
} else if (e.detail.job == "WAR") {
document.getElementById("jobinfo").innerText = jobDetail.beast;
} else if (e.detail.job == "DRK") {
document.getElementById("jobinfo").innerText = jobDetail.blood;
} else if (e.detail.job == "PLD") {
document.getElementById("jobinfo").innerText = jobDetail.oath;
} else if (e.detail.job == "BRD") {
document.getElementById("jobinfo").innerText = jobDetail.songName + " | " + jobDetail.songProcs + " | " + jobDetail.songMilliseconds;
} else if (e.detail.job == "NIN") {
document.getElementById("jobinfo").innerText = jobDetail.hutonMilliseconds + " | " + jobDetail.ninkiAmount;
} else if (e.detail.job == "DRG") {
document.getElementById("jobinfo").innerText = jobDetail.bloodMilliseconds + " | " + jobDetail.lifeMilliseconds + " | " + jobDetail.eyesAmount;
} else if (e.detail.job == "BLM") {
document.getElementById("jobinfo").innerText = jobDetail.umbralStacks + " (" + jobDetail.umbralMilliseconds + ") | " + jobDetail.umbralHearts + " | " + jobDetail.enochian + " " + jobDetail.polygot + " (" + jobDetail.nextPolygotMilliseconds + ")";
} else if (e.detail.job == "THM") {
document.getElementById("jobinfo").innerText = jobDetail.umbralStacks + " (" + jobDetail.umbralMilliseconds + ")";
} else if (e.detail.job == "WHM") {
document.getElementById("jobinfo").innerText = jobDetail.lilies;
} else if (e.detail.job == "SMN") {
document.getElementById("jobinfo").innerText = jobDetail.aetherflowStacks + " | " + jobDetail.dreadwyrmStacks + " | " + jobDetail.bahamutStacks + " ( " + jobDetail.dreadwyrmMilliseconds + " | " + jobDetail.bahamutMilliseconds + " )";
} else if (e.detail.job == "SCH") {
document.getElementById("jobinfo").innerText = jobDetail.aetherflowStacks + " | " + jobDetail.fairyGauge;
} else if (e.detail.job == "ACN") {
document.getElementById("jobinfo").innerText = jobDetail.aetherflowStacks;
} else if (e.detail.job == "MNK") {
document.getElementById("jobinfo").innerText = jobDetail.lightningStacks + " | " + jobDetail.chakraStacks + " (" + jobDetail.lightningMilliseconds + ")";
} else if (e.detail.job == "PGL") {
document.getElementById("jobinfo").innerText = jobDetail.lightningStacks + " (" + jobDetail.lightningMilliseconds + ")";
} else if (e.detail.job == "MCH") {
document.getElementById("jobinfo").innerText = jobDetail.overheatMilliseconds + " | " + jobDetail.heat + " | " + jobDetail.ammunition + " | " + jobDetail.gauss;
} else if (e.detail.job == "AST") {
document.getElementById("jobinfo").innerText = jobDetail.drawMilliseconds + " | " + jobDetail.drawnCard + " | " + jobDetail.spreadCard + " | " + jobDetail.roadCard + " | " + jobDetail.arcanumCard;
} else if (e.detail.job == "SAM") {
document.getElementById("jobinfo").innerText = jobDetail.kenki + " | " + jobDetail.setsu + " | " + jobDetail.gekko + " | " + jobDetail.ka;
} else {
document.getElementById("jobinfo").innerText = "";
}
document.getElementById("pos").innerText = e.detail.pos.x + "," + e.detail.pos.y + "," + e.detail.pos.z;
});
document.addEventListener("onTargetChangedEvent", function (e) {
if (!e.detail) {
document.getElementById("target").innerText = "--";
document.getElementById("tid").innerText = "";
document.getElementById("tdistance").innerText = "";
} else {
document.getElementById("target").innerText = e.detail.name;
document.getElementById("tid").innerText = e.detail.id.toString(16);
document.getElementById("tdistance").innerText = e.detail.distance;
}
});
document.addEventListener("onGameExistsEvent", function (e) {
//console.log("Game exists: " + e.detail.exists);
});
document.addEventListener("onGameActiveChangedEvent", function (e) {
//console.log("Game active: " + e.detail.active);
});
document.addEventListener("onLogEvent", function(e) {
for (var i = 0; i < e.detail.logs.length; i++) {
// Match "/echo tts:<stuff>"
var r = e.detail.logs[i].match('00:0038:tts:(.*)');
if (r)
OverlayPluginApi.overlayMessage(OverlayPluginApi.overlayName, JSON.stringify({ 'say': r[1] }));
}
});
</script>
</head>
<body>
<div id="currentZone">currentZone: --</div>
<div id="inCombat">inCombat: ?</div>
<div>hp: <span id="hp"></span> mp: <span id="mp"></span> tp: <span id="tp"></span> cp: <span id="cp"></span> gp: <span id="gp"></span></div>
<div>id: <span id="id"></span></div>
<div>job: <span id="job"></span> <span id="jobinfo"></span></div>
<div>pos: <span id="pos"></span></div>
<div>bait: <span id="bait"></span></div>
<div>debug: <span id="debug"></span></div>
<div>target: <span id="target">--</span> id: <span id="tid"></span> distance: <span id="tdistance"></span></div>
<div id="event">--</event>
</body>
</html>