Author Topic: Trailmyx's Advanced Journal scanner for OEUO - v1.0  (Read 11528 times)

0 Members and 1 Guest are viewing this topic.

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13310
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +3089
  • Referrals: 34
    • View Profile
    • ScriptUO
Trailmyx's Advanced Journal scanner for OEUO - v1.0
« on: August 19, 2010, 10:58:34 PM »
0
Code: [Select]
---------------------------------------------------------------
-- 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:

Code: [Select]
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:

Code: [Select]
  print(string.format("I stopped because of the %s trigger.", watcher.match))

There are 1 attachment(s) in this post. You must register and post an acceptable introduction to download
tm_oeuo_advjournalscan10.lua
« Last Edit: August 20, 2010, 08:00:14 AM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13310
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +3089
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: Trailmyx's Advanced Journal scanner for OEUO - v1.0
« Reply #1 on: August 19, 2010, 11:00:11 PM »
0
reserved
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Superslayer

  • Elite
  • *
  • *
  • Posts: 1006
  • Activity:
    0%
  • Reputation Power: 14
  • Superslayer barely matters.Superslayer barely matters.
  • Gender: Male
  • Well what do you drink? Not tea.
  • Respect: +100
  • Referrals: 0
    • View Profile
Re: Trailmyx's Advanced Journal scanner for OEUO - v1.0
« Reply #2 on: November 09, 2010, 05:38:12 PM »
0
This is nice so far. I do notice that the trigger words are case sensitive, and compound sentence fragments do NOT require an underscore to extend the phrase. Very nice!

Offline smokinjoe26

  • Jr. Member
  • **
  • Posts: 25
  • Activity:
    0%
  • Reputation Power: 1
  • smokinjoe26 has no influence.
  • Respect: +2
  • Referrals: 0
    • View Profile
Re: Trailmyx's Advanced Journal scanner for OEUO - v1.0
« Reply #3 on: February 22, 2012, 09:40:02 AM »
0
This is nice so far. I do notice that the trigger words are case sensitive, and compound sentence fragments do NOT require an underscore to extend the phrase. Very nice!

Correct me if i am wrong, but I think that the second (boolean) option changes case sensitivity. 

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13310
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +3089
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: Trailmyx's Advanced Journal scanner for OEUO - v1.0
« Reply #4 on: February 22, 2012, 09:46:47 AM »
0
You are correct.  That's the idea anyhow.  ;)
Please read the ScriptUO site RULES
Come play RIFT with me!

Tags: TrailMyx  OEUO