Add files via upload

master
aardlyworthit 6 years ago committed by GitHub
parent 6afac39cf5
commit 4a7f313471
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -62,7 +62,7 @@ You can set the highlight colo r with the following command:
<aliases> <aliases>
<alias <alias
match="^info \-h (\w+) (.+)$" match="^info \-h (\w+)( (?<words>.+))?$"
enabled="y" enabled="y"
regexp="y" regexp="y"
script="go" script="go"
@ -87,6 +87,8 @@ You can set the highlight colo r with the following command:
require "gmcphelper" require "gmcphelper"
local color = GetVariable("color") or "yellow" local color = GetVariable("color") or "yellow"
local count = -1
local do_reset = false
function my_name() function my_name()
local me = gmcp("char.base.name") local me = gmcp("char.base.name")
@ -100,9 +102,14 @@ function set_color(name, line, args)
end end
function go(name, line, args) function go(name, line, args)
count = 0
do_reset = false
if args.words ~= "" then
do_reset = true
ColourNote("darkred", "", "[", "red", "", "[", "silver", "", " Highlighting info history lines that contain '"..args[2].."'. ", "red", "", "]", "darkred", "", "]") ColourNote("darkred", "", "[", "red", "", "[", "silver", "", " Highlighting info history lines that contain '"..args[2].."'. ", "red", "", "]", "darkred", "", "]")
Note() Note()
SetTriggerOption("info_highlight", "match", "^\\[[\\d:\\s\\w]+\\] INFO: .*"..args[2]..".*$") SetTriggerOption("info_highlight", "match", "^\\[[\\d:\\s\\w]+\\] INFO: .*"..args[2]..".*$")
end
EnableTrigger("end_of_info", true) EnableTrigger("end_of_info", true)
DoAfterSpecial(1, "send_it('"..args[1].."')", 12) DoAfterSpecial(1, "send_it('"..args[1].."')", 12)
end end
@ -113,6 +120,7 @@ function send_it(w)
end end
function highlight_line(name, line, args) function highlight_line(name, line, args)
count = count + 1
ColourNote(color, "", args[0]) ColourNote(color, "", args[0])
end end
@ -122,8 +130,15 @@ function reset()
Note("Error getting player name from gmcp.") Note("Error getting player name from gmcp.")
return return
end end
if count == 1 then
ColourNote("darkred", "", "[", "red", "", "[ ", "silver", "", count.." line highlighted. ", "red", "", "]", "darkred", "", "]")
elseif count >= 0 then
ColourNote("darkred", "", "[", "red", "", "[ ", "silver", "", count.." lines highlighted. ", "red", "", "]", "darkred", "", "]")
end
if do_reset then
ColourNote("darkred", "", "[", "red", "", "[", "silver", "", " Resetting info -h highlight to "..me..". ", "red", "", "]", "darkred", "", "]") ColourNote("darkred", "", "[", "red", "", "[", "silver", "", " Resetting info -h highlight to "..me..". ", "red", "", "]", "darkred", "", "]")
SetTriggerOption("info_highlight", "match", "^\\[[\\d:\\s\\w]+\\] INFO: .*"..me..".*$") SetTriggerOption("info_highlight", "match", "^\\[[\\d:\\s\\w]+\\] INFO: .*"..me..".*$")
end
EnableTrigger("end_of_info", false) EnableTrigger("end_of_info", false)
end end

Loading…
Cancel
Save