---------------------------------------------------------------
-- Script Name: TrailMyx's Advanced Journal Scanner for OEUO
-- Author: TrailMyx
-- Version: v1.0
-- Shard OSI / FS: unk
-- Revision Date: 9/29/2007
-- Purpose: Collection of routines, including:
-- Use these subs to quickly find text in your journal entries.
--
-- Examples:
-- speech = TM_AdvJournalInfo:New() -- creates a new scanner object
-- heal = TM_AdvJournalInfo:New() -- creates a new scanner object
-- spellcast = TM_AdvJournalInfo:New() -- creates a new scanner object
-- speech:TM_AdvJournalSync() -- sync "speech" journal space
-- speech:TM_AdvJournalScan("VALID", false, "Find this text", "and find this too") -- will not advance copy of #jindex, applies spam checking
-- heal:TM_AdvJournalScan("VALID_ADVANCE", false, "you heal what", "that patient is not" -- advances pointer after scan, applies spam checking
-- spellcast:TM_AdvJournalScan("NONE", false, "fizzle") ; no spam checking and doesn't advance #jindex copy automatically
--
-- Special Thanks:
--
-- Beta testers:
-- Bug testers:
--
---------------------------------------------------------------
--
-- Example code
-- dofile("tm_oeuo_advjournalscan10.lua")
-- watcher = TM_AdvJournalInfo:New()
-- watcher:TM_AdvJournalSync()
--
-- while true do
-- if watcher:TM_AdvJournalScan("none", true , "hello", "test") == true then
-- print(string.format("I stopped because of the %s trigger.", watcher.match))
-- watcher:TM_AdvJournalSync()
-- end
-- end
-- Obj.Exit()
---------------------------------------------------------------
This is a direct port of my popular advanced journal handling routings from EUO. All the features you came to know from those routines are present in this new version for OEUO.
Here's some example code to get you started. Notice these subs look much like my EUO subs and function exactly the same as you would expect.
This example will print a message when you hit the trigger words of "hello" or "test". Adjusting the first argument of T_AdvJournalScan to "none", "valid", "advance" or "valid_advance" will change the trigger behavior. For example, change this to "valid" and then use another account to spam the trigger words. Notice how it won't trigger unless it's the character running the script? Cool, huh?
Sample:
dofile("tm_oeuo_advjournalscan10.lua") -- required so the code below will be aware of the journal scanner.
watcher = TM_AdvJournalInfo:New()
watcher:TM_AdvJournalSync()
while true do
if watcher:TM_AdvJournalScan("none", true , "hello", "test") == true then
print(string.format("I stopped because of the %s trigger.", watcher.match))
watcher:TM_AdvJournalSync()
end
end
Obj.Exit()
Note!
Notice I've added a new feature <object>.match where you can see what actually triggered the matching condition. From the above example:
print(string.format("I stopped because of the %s trigger.", watcher.match))