 |
Fergal1982 Wanderer
Joined: 08 Aug 2005 Posts: 70
|
Posted: Wed Feb 22, 2006 5:51 pm
Daily Capture |
I'd like to create an alias which checks the date in a variable (say 'date'), and if this is different from the current date, run the command 'view citylog x' where x is the day part of the date (ie 28) for the day PRIOR to the current date (sound confusing? i mean that if its the 28th, it will run view citylog 27).
Id like it to gag the output of the citylog (shown in the format below), and capture the entire output of the command to a text file. Finally, id like it to set the date to the current date, so that next time the command is run this cycle will begin.
If the date is the same i want it to do nothing.
Code: |
1600/1600h 200/200m 21xp >
17.57.08 20-2-2006: Phoenix donated 100000 gold.
End of File.
1600/1600h 200/200m 21xp > |
Note that the output can contain many lines, this is just a short example.
Any ideas how you would even start doing this? i dont have a clue
Thanks
Fergal |
|
|
 |
JQuilici Adept
Joined: 21 Sep 2005 Posts: 250 Location: Austin, TX
|
Posted: Wed Feb 22, 2006 6:47 pm |
Off the top of my head, without testing:
Code: |
#IF (@currentDay <> %time(d)) {
currentDay=%time(d)
#SEND view citylog %eval(%time(d)-1)
#NOOP -- gag/capture output here
} |
Of course, that will send 'view citylog 0' when you run it on the first of the month, so you may need to add a special case there. |
|
_________________ Come visit Mozart Mud...and tell an imm that Aerith sent you! |
|
|
 |
TonDiening GURU

Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Wed Feb 22, 2006 6:53 pm |
As for storing the information it will depend on how much it is and what you need to track.
One idea is to write it to a text file so you can use the %grep.
Another is to check and remember total donated and last donated use database variables or the database module. |
|
|
 |
Fergal1982 Wanderer
Joined: 08 Aug 2005 Posts: 70
|
Posted: Wed Feb 22, 2006 7:09 pm |
its a variety of different logs, not just donations, but id be looking at simply amending it to the end of a standard text file.
|
|
|
 |
|
|