Update triggers to deal with nonsilent dfhack.run_command.

develop
expwnent 2014-07-01 02:15:38 -04:00
parent d765de4546
commit ebde2c2094
3 changed files with 3 additions and 4 deletions

@ -46,7 +46,7 @@ function processTrigger(command)
command2[i] = arg command2[i] = arg
end end
end end
print(dfhack.run_command(table.unpack(command2))) dfhack.run_command(table.unpack(command2))
end end
function fillTable(table1,table2) function fillTable(table1,table2)

@ -96,7 +96,7 @@ eventful.onJobCompleted.reactionTrigger = function(job)
local didSomething local didSomething
if action.command then if action.command then
local processed = processCommand(job, worker, worker, building, action.command) local processed = processCommand(job, worker, worker, building, action.command)
print(dfhack.run_command(table.unpack(processed))) dfhack.run_command(table.unpack(processed))
end end
if action.syndrome then if action.syndrome then
didSomething = syndromeUtil.infectWithSyndromeIfValidTarget(worker, action.syndrome, action.resetPolicy) or didSomething didSomething = syndromeUtil.infectWithSyndromeIfValidTarget(worker, action.syndrome, action.resetPolicy) or didSomething

@ -48,8 +48,7 @@ repeat
if args[i]~='\\SKILL_UNIT_ID' then table.insert(command,args[i]) else table.insert(command,args[1]) end if args[i]~='\\SKILL_UNIT_ID' then table.insert(command,args[i]) else table.insert(command,args[1]) end
end end
until i>#args or args[i]:find('DICEROLL') until i>#args or args[i]:find('DICEROLL')
local out = dfhack.run_command(table.unpack(command)) dfhack.run_command(table.unpack(command))
print(out)
scriptIsFinished=true scriptIsFinished=true
else else
i=i+1 i=i+1