-
Notifications
You must be signed in to change notification settings - Fork 0
/
ds-gmcp.xml
52 lines (40 loc) · 1.34 KB
/
ds-gmcp.xml
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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE MudletPackage>
<MudletPackage version="1.001">
<TriggerPackage />
<TimerPackage />
<AliasPackage />
<ActionPackage />
<ScriptPackage>
<Script isActive="yes" isFolder="no">
<name>gmcpCharVitals</name>
<packageName></packageName>
<script>function gmcpCharVitals()
ds = ds or {}
ds.hp = tonumber(gmcp.Char.Vitals.hp)
ds.maxhp = tonumber(gmcp.Char.Vitals.maxhp)
ds.mana = tonumber(gmcp.Char.Vitals.mana)
ds.maxmana = tonumber(gmcp.Char.Vitals.maxmana)
--registerAnonymousEventHandler("sysGetHttpDone", onHttpGetDone)
--registerAnonymousEventHandler("sysGetHttpError", onGetHttpError)
--getHTTP("https://api.github.com/repos/brujah/ds-gmcp/releases/latest")
end
function onHttpGetDone(event, url, body)
cecho(string.format("<white>url: <dark_green>%s<white>, body: <dark_green>%s", url, body))
local response = yajl.to_value(body)
display("Tag: " .. response)
end
function onGetHttpError(event, error, url)
display("An error occurred: " .. error)
end
getHTTP("https://httpbin.org/are_you_awesome", {["X-am-I-awesome"] = "yep I am"})</script>
<eventHandlerList>
<string>gmcp.Char.Vitals</string>
</eventHandlerList>
</Script>
</ScriptPackage>
<KeyPackage />
<HelpPackage>
<helpURL></helpURL>
</HelpPackage>
</MudletPackage>