Official ScriptUO EasyUO Scripts > Script development tools

TrailMyx's Advanced Journal Handler

(1/18) > >>

TrailMyx:

--- Code: ---;=================================================================
; Script Name: TrailMyx's Advanced Journal Scanner
; Author: TrailMyx
; Version: 1.0
; Shard OSI / FS: OSI / FS?
; Revision Date: 10/20/2007
; Purpose:
;   Use these subs to quickly find text in your #journal entries.  These subs
; use #jindex for flawless journal scanning and is much more reliable than using
; standard indexing of #journal and #SYSMSG.
;
;   Now it is possible to manage separate journals based on unrelated text.  It's now possible
; to monitor spellcasting, bandaging, stealing, or anything else without a TM_AdvJournalSync
; potentially removing text needed for another UO funciton.
;
;   New is the ability to either gosub or call these functions without the need to change the
; header!  When calling, a limit of 10 arguments is allowed, but more can be added by editing the
; call interface section.
;
;  Examples:
;     gosub TM_AdvJournalSync speech 100 ; sync "speech" journal space, set #LPC to 100 from default of 1000
;     gosub TM_AdvJournalScan speech VALID Find_this_text and_find_this_too ; will not advance copy of #jindex
;     gosub TM_AdvJournalScan heal VALID_ADVANCE you_heal_what that_patient_is_not ; advances pointer after scan
;     gosub TM_AdvJournalScan spellcast NONE fizzle ; no spam checking and doesn't advance #jindex copy automatically
;
;  Subs included:
;     TM_AdvJournalSync - Must call this in initialzation
;     TM_AdvJournalScan - see header for details....
;
;  Release history:
;    v1.0 - Initial release.
;
;  Requirements:
;    Nothing special
;
;  Credit:
;    If you use these subs, please leave credit for me somewhere in your script header.
;=================================================================

--- End code ---

... Snipped from another thread...

By this example:


--- Code: ---gosub TM_AdvJournalScan heal VALID_ADVANCE you_heal_what that_patient_is_not

--- End code ---

The first argument "heal" what you are calling this particular journal scanner.  Since you can have different scanners looking for different things and behaving differently, then you can set this.  An example of multiple journal scanners is perhaps you are looking for journal information that's spell casting related, but another part of your script is looking for journal output that's healing related.  Now you can separate these.

The second argument can be the following values:

NONE: defaults to basic journal scan (no SPAM checking, no #jindex pointer copy advancing)
ADVANCE: no spam checking, advances #jindex copy
VALID: invokes SPAM filtering, no advance of #jindex copy
VALID_ADVANCE, VALIDADVANCE, ADVANCE_VALID, etc.: invokes SPAM filtering, advances of #jindex copy

arguments after the first and the second are considered strings you will be searching for to appear in your journal.

About SPAM filtering:

With the NONE option, the script will not filter the journal and will agree with any resulting match with the list your supply as arguments.  

With the VALID option, the script will compare several criterion to the text found within your journal.  These criteria are:
(Joe_Spammer is a fictional grief player trying to mess with your script)

1) Journal entry does not contain ":_" i.e. "Joe_Spammer:_you_heal_what" <will not trigger>
2) Journal entry does contain ":_", but is the first text <this will pass, example boat commands, taming>
3) Journal entry does contain "Your_Charname:_you_heal_what..." <this will pass, since YOU said it.>
4) Journal entry does contain "Joe_Spammer:_Your_Charname:_you_heal_what" <this will not pass because your character name did not come first>

Note there are combinations of the above examples, and may require you to play with it a bit.

With the ADVANCE option, the script will automatically sync the jindex copy when you do a search.  There are times however when you might want to search the same journal information again for another trigger word, so you can sync by hand by:


--- Code: ---gosub TM_AdvJournalScan heal VALID you_heal_what that_patient_is_not
if #RESULT = #TRUE
{
  gosub TM_AdvJournalSync heal
  .. do something about it..
}

--- End code ---

Finally, you notice that most of my scripts will call TM_AdvJournalSync at the beginning of the script execution for each journal scanner, but will include a number for the second argument:


--- Code: ---  gosub TM_AdvJournalSync heal 100
  gosub TM_AdvJournalSync CastSpell 100

--- End code ---

This is just setting the default #LPC for each scanner.  If you have time-critical needs, you may invoke faster scanning for subsequent TM_AdvJournalScan calls.

rana70:
Hi TM,

I look for a howto for your TrailMyx's Advanced Journal Scanner SUB.

I am not really sure how to use it ....
My Basic problems are ....
- What does this 1st Parameter mean ? Journal Name
- What exactly does the Sync do

I use a pathfind command and I would like to monitor the journal
to catch a "can't_get_there" Msg from the journal and
somehow I was to stupid to figure it out on my own

So I looked around on EUO and here but without to much luck as you can see

Thx
 

TrailMyx:
Hum, yeh, there's a bit of tribal knowledge there.  I need to impart it somehow.  I don't have time this afternoon, but perhaps I can whip up a little how-to this evening.

rana70:
Would be great ....

I will wait for it np

thx

TrailMyx:
Ok, so I don't have a lot of time this evening, but I said I'd give some information.  So hopefully this will help a bit.

By this example:


--- Code: ---gosub TM_AdvJournalScan heal VALID_ADVANCE you_heal_what that_patient_is_not

--- End code ---

The first argument "heal" what you are calling this particular journal scanner.  Since you can have different scanners looking for different things and behaving differently, then you can set this.  An example of multiple journal scanners is perhaps you are looking for journal information that's spell casting related, but another part of your script is looking for journal output that's healing related.  Now you can separate these.

The second argument can be the following values:

NONE: defaults to basic journal scan (no SPAM checking, no #jindex pointer copy advancing)
ADVANCE: no spam checking, advances #jindex copy
VALID: invokes SPAM filtering, no advance of #jindex copy
VALID_ADVANCE, VALIDADVANCE, ADVANCE_VALID, etc.: invokes SPAM filtering, advances of #jindex copy

arguments after the first and the second are considered strings you will be searching for to appear in your journal.

About SPAM filtering:

With the NONE option, the script will not filter the journal and will agree with any resulting match with the list your supply as arguments. 

With the VALID option, the script will compare several criterion to the text found within your journal.  These criteria are:
(Joe_Spammer is a fictional grief player trying to mess with your script)

1) Journal entry does not contain ":_" i.e. "Joe_Spammer:_you_heal_what" <will not trigger>
2) Journal entry does contain ":_", but is the first text <this will pass, example boat commands, taming>
3) Journal entry does contain "Your_Charname:_you_heal_what..." <this will pass, since YOU said it.>
4) Journal entry does contain "Joe_Spammer:_Your_Charname:_you_heal_what" <this will not pass because your character name did not come first>

Note there are combinations of the above examples, and may require you to play with it a bit.

With the ADVANCE option, the script will automatically sync the jindex copy when you do a search.  There are times however when you might want to search the same journal information again for another trigger word, so you can sync by hand by:


--- Code: ---gosub TM_AdvJournalScan heal VALID you_heal_what that_patient_is_not
if #RESULT = #TRUE
{
  gosub TM_AdvJournalSync heal
  .. do something about it..
}

--- End code ---

Finally, you notice that most of my scripts will call TM_AdvJournalSync at the beginning of the script execution for each journal scanner, but will include a number for the second argument:


--- Code: ---  gosub TM_AdvJournalSync heal 100
  gosub TM_AdvJournalSync CastSpell 100

--- End code ---

This is just setting the default #LPC for each scanner.  If you have time-critical needs, you may invoke faster scanning for subsequent TM_AdvJournalScan calls.

Navigation

[0] Message Index

[#] Next page

Go to full version