I get a problem with function OnRepeat in the exampleScript.lua.
I don't know how to setup my alias.
This is what I got from the code:
1. Create a new alias with name:^#(\d+)\s+(.+)$
2. Enable Regulare Expression
3. Send to "Script Engine"
4. But what content to be sent in the "Send" field?
How to match the function OnRepeat and call OnRepeat correctly?
Thanks.
I don't know how to setup my alias.
This is what I got from the code:
1. Create a new alias with name:^#(\d+)\s+(.+)$
2. Enable Regulare Expression
3. Send to "Script Engine"
4. But what content to be sent in the "Send" field?
How to match the function OnRepeat and call OnRepeat correctly?
Thanks.
-- --------------------------------------------
-- Subroutine to be called to repeat a command.
--
-- Call from the alias: ^#(\d+)\s+(.+)$
-- Regular Expression: checked
--
-- Example of use: #10 give sword to Trispis
-- This would send "give sword to Trispis" 10 times
-- --------------------------------------------
function OnRepeat (name, line, wildcards)
local count = wildcards [1]
if not tonumber (count) then
Note ("Repeat count must be numeric, you entered ", count)
return
end
local i
for i = 1, count do
Send (wildcards [2])
end
end -- of OnRepeat