forked from Johnson336/LotJPlugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlotj_repaint_buffer.xml
More file actions
54 lines (47 loc) · 1.31 KB
/
lotj_repaint_buffer.xml
File metadata and controls
54 lines (47 loc) · 1.31 KB
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
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Wednesday, December 01, 2010, 11:54 AM -->
<!-- MuClient version 4.70 -->
<muclient>
<plugin
name="Repaint_Buffer"
author="Fiendish"
id="e2a1af0b5e462318bb423764"
language="Lua"
purpose="Condenses repaint calls from other plugins to reduce display overhead"
date_written="2010-12-01 11:51:55"
requires="4.70"
version="1.0"
>
</plugin>
<!-- Script -->
<script>
<![CDATA[
local repaint_on_tick = false
local last_repaint_time = utils.timer()
function OnPluginBroadcast (msg, id, name, text)
if (msg == 999 and text == "repaint") then
repaint_on_tick = true
if (utils.timer() - last_repaint_time > .1) then
repaint_on_tick = false
Repaint()
last_repaint_time = utils.timer()
end
end
end
-- if ticks are coming through, then we have enough time to repaint again
function OnPluginTick()
if repaint_on_tick == true then
repaint_on_tick = false
Repaint()
last_repaint_time = utils.timer()
end
end
function OnPluginDisable()
EnablePlugin(GetPluginID(), true)
ColourNote("white", "blue", "You are not allowed to disable the "..
GetPluginInfo(GetPluginID(), 1).." plugin. It is necessary for other plugins.")
end
]]>
</script>
</muclient>