Hi Nick, thanks for the quick response.
Sorry I jumped into my problem without enough background...
I am following the "Making a script to count mobs killed" example/tutorial that can be found here:
I basically cut and past the code from the website into MC.
As I said before, I get the trigger working as well as activate the "tprint" module. Here is the code:
killed_mobs = killed_mobs or {} -- make mobs table
mob_name = "%1" -- this mob's name (first wildcard)
-- add this mob if first time
killed_mobs [mob_name] = killed_mobs [mob_name] or { count = 0 }
-- add 1 to count of mobs
killed_mobs [mob_name].count = killed_mobs [mob_name].count + 1
-- remember when we last killed it
killed_mobs [mob_name].last_time = os.time
And here is the output for "/tprint (killed_mobs)":
Quote:
"the wyvern":
"count"=1
"last_time"=function: 00D6FCD8
"the goblin":
"count"=8
"last_time"=function: 00D6FCD8
So everything up to here works. I follow the example further. But run into problems after I have configured and added the alias. Here is my Alias code:
if not killed_mobs or next (killed_mobs) == nil then
ColourNote ("white", "blue", "No mobs killed yet")
return
end -- if nothing
-- go through each one
count = 0
for k, v in pairs (killed_mobs) do
Note (string.format ("%%-30s x %%i (last at %%s)",
k,
v.count,
os.date ("%%H:%%M %%d %%b %%Y", v.last_time)))
count = count + v.count
end -- for loop
-- show total
Note (string.format ("%%5i mobs killed.", count))
With this code I get the following output for "show_killed":
Quote:
Run-time error
World: WaterdeepMUD - CharName
Immediate execution
[string "Alias: "]:13: bad argument #2 to 'date' (number expected, got function)
stack traceback:
[C]: in function 'date'
[string "Alias: "]:13: in main chunk
I hope I have explained my problem a little better. Hmmm, as an after thought, I use Mc through Wine on Ubuntu. My other trigers (Drink water and Show Exits, also from you website works fine). |