Author Topic: TrailMyx's Advanced Journal Handler  (Read 66649 times)

0 Members and 1 Guest are viewing this topic.

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • 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: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: TrailMyx's Advanced Journal Handler
« Reply #15 on: August 20, 2008, 12:17:39 AM »
+1
For not having much time this is a tremendous help for me too! You should consider moving this to the Journal Scanning thread, perhaps as part of the initial post so it isn't overlooked. For some reason I have always had difficulty grasping the concept of the "journal name" or the first argument and what it is used for and these subs have already made their way into any script I've needed journal scanning for.

XII

BTW, I did move this to the journal scanner thread.  Good suggestion.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Pearls

  • Hero Member
  • *
  • Posts: 557
  • Activity:
    0%
  • Reputation Power: 13
  • Pearls barely matters.Pearls barely matters.
  • Respect: +65
  • Referrals: 1
    • View Profile
Re: TrailMyx's Advanced Journal Handler
« Reply #16 on: August 20, 2008, 01:41:51 AM »
+1
When i didnt know much about easyuo and was a contra scripter, i used to lumberjack a lot manually. There was one guy farming all the frostwood trees i had. At first i basically just killed him and took over. After a while i smartened up, marked all the spots he recalls into, dropped a few logs there, and he would basically chop for me and drop all the frostwood to the floor. I only had to go and pick it up.
XII : "My happiness as a married man is directly related to the amount of sex I have which, in turn, requires that I pretend I like these movies every now and then and that it really doesn't bother me when she tells me about her problems but doesn't want me to give her a solution ;) "

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • 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: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: TrailMyx's Advanced Journal Handler
« Reply #17 on: August 20, 2008, 10:22:51 AM »
+1
What did you say to get him to drop?
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline rana70

  • Elite
  • *
  • *
  • Posts: 294
  • Activity:
    0%
  • Reputation Power: 5
  • rana70 has no influence.
  • Gender: Male
  • Respect: +37
  • Referrals: 2
    • View Profile
    • MyScripts
Re: TrailMyx's Advanced Journal Handler
« Reply #18 on: August 22, 2008, 11:21:10 AM »
+1
Just runnin UOA with the stack option on would be enough
the char will drop the wood as soon as uoa finds some wood on the ground

Offline KilroyIsDead

  • Full Member
  • ***
  • Posts: 155
  • Activity:
    0%
  • Reputation Power: 2
  • KilroyIsDead has no influence.
  • Respect: +13
  • Referrals: 0
    • View Profile
Re: TrailMyx's Advanced Journal Handler
« Reply #19 on: June 27, 2009, 12:33:57 PM »
+1
This may have been previously noted, but

If the journal gets substantially bigger since the last time you called it.  You can get unpredictable results.

example:
I use the scanner when I recall, then I mine the spot and teh digging spams the journal, then the next time I recall it has to wade through all that journalling, So now I sync the journal before I recall moreover care to scan the journal
Give a man a fire, he'll be warm the rest of the night;
Set a man afire, he'll be warm the rest of his life.

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • 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: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: TrailMyx's Advanced Journal Handler
« Reply #20 on: June 27, 2009, 01:07:40 PM »
+1
You need to be proactive when using the journal and using the Sync function.  Best thing is to resync before you cause an action that might cause a journal entry.  Most things you do can function this way.  That way your journal scans will remain small. Example:

Sync
last last object
last target
Check journal

With my subs, you can monitor "%10" to make sure you don't have a problem with a run-away journal scan.  Under control, you should have a relatively small number in this.  This variable also has the particular journal tag in question just in case you might now know what journal scanner is "bugged".  

Some might not know the debugging value of the "%10" variable, so there you go!

But yes, that's good information for people who might have problems with journal scanning, KilroyIsDead.  Thanks for that!
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Paulonius

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +162
  • Referrals: 1
    • View Profile
Re: TrailMyx's Advanced Journal Handler
« Reply #21 on: February 11, 2010, 08:08:05 AM »
+1
So I have been reading this and trying to figure out how to use the subs to replace the crap journal scanning I have been doing.  Maybe its because I don't get to sleep anymore, but I thought that the following should work and it doesn't.  Can anyone tell me what I am doing wrong with it?

I wrote this as a test script to teach myself how to use TM's Journal subs. It is supposed to fire up, initiate the subs, drop into a loop that says "Test Message", check the journal for Test_Message, and then drop out of the loop and report "SUCCESS!!"... but it doesn't...


Code: [Select]
gosub TM_AdvJournalSync Testor 100
gosub TM_AdvJournalSync Testor

REPEAT
event macro 1 0 Test Message
wait 30
gosub TM_AdvJournalScan Testor ADVANCE Test_Message
wait 20
UNTIL #Result = True
Display SUCCESS!!!!
halt
« Last Edit: February 11, 2010, 08:12:17 AM by Paulonius »
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • 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: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: TrailMyx's Advanced Journal Handler
« Reply #22 on: February 11, 2010, 09:49:49 AM »
+1
"True" must mean something else in your universe.  ;)

Try #TRUE.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Paulonius

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +162
  • Referrals: 1
    • View Profile
Re: TrailMyx's Advanced Journal Handler
« Reply #23 on: February 11, 2010, 10:00:52 AM »
+1
I am just tired I think.
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • 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: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: TrailMyx's Advanced Journal Handler
« Reply #24 on: February 11, 2010, 10:07:06 AM »
+1
I am just tired I think.

Heh, sometimes it's the simple things that can be hard.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Paulonius

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +162
  • Referrals: 1
    • View Profile
Re: TrailMyx's Advanced Journal Handler
« Reply #25 on: February 11, 2010, 11:09:39 AM »
+1
TM,

Couple of questions as I work through introducing the sub into a script.

1. I am guessing that when you put in multiple items to search for they are searched for in the alternative as in A || B . Is this correct?  Is there a limit on the number you can use? (I am hoping its three or more...)

2. Where I am using consecutive checks as in a loop, I am presuming that I don't want to ADVANCE until I am finished with the loop. I am thinking something like this:

Code: [Select]
gosub TM_AdvJournalSync
Repeat
      {
      Code that Does what I need done and produces a journal entry
      gosub TM_AdvJournalScan NAME NONE JOURNAL_TEXT_SOUGHT
      }
Until #Result = #True

 3. Will the Sync will take the place of the advance the next time it enters this loop?

This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • 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: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: TrailMyx's Advanced Journal Handler
« Reply #26 on: February 11, 2010, 11:46:38 AM »
+1
Yes, if you have multiple arguments searched for in each TM_AdvJournalSync, then they act as *OR*.

If you don't use the automatic "ADVANCE" function, then you have to sync by hand:

Code: [Select]
gosub TM_AdvJournalSync NAME 100
Repeat
      gosub TM_AdvJournalScan NAME NONE JOURNAL_TEXT_SOUGHT
      if #RESULT = #TRUE
      {
         ; handle JOURNAL_TEXT_SOUGHT
         gosub TM_AdvJournalSync NAME
      }
      gosub TM_AdvJournalScan NAME NONE SOMETHING_ELSE
      if #RESULT = #TRUE
      {
         ; handle SOMETHING_ELSE
         gosub TM_AdvJournalSync NAME
      }
Until #FALSE

Now it's up to your code to determine if you need to keep searching without SYNCing.  If you have things you want to search for, but are different types of searches, you can create another journal scanner:

Code: [Select]
gosub TM_AdvJournalSync SCANNER1 100
gosub TM_AdvJournalSync SCANNER2 100 
Repeat
      gosub TM_AdvJournalScan SCANNER1 NONE JOURNAL_TEXT_SOUGHT
      if #RESULT = #TRUE
      {
         ; handle JOURNAL_TEXT_SOUGHT
         gosub TM_AdvJournalSync SCANNER1
      }
      gosub TM_AdvJournalScan SCANNER2 NONE SOMETHING_ELSE
      if #RESULT = #TRUE
      {
         ; handle SOMETHING_ELSE
         gosub TM_AdvJournalSync SCANNER2
      }
Until #FALSE

This way, you will not sync and possibily miss something from the other scanner.  A good example is if you are looking for journal entries pertaining to HEALING and other entries for SPELLCASTING, or FISHING.  You don't want one sync to make you miss other entries.  With my advanced journal scanner, I give you n-number of possible scanners.
Please read the ScriptUO site RULES
Come play RIFT with me!

Scrripty

  • Guest
Re: TrailMyx's Advanced Journal Handler
« Reply #27 on: February 12, 2010, 02:18:31 PM »
+1
I *highly* suggest going to easyuo and following their very basic journal scanning tutorial to get a firm grasp on the very basics of how it works, so you fully understand better how this works. :)  It's a HUGE help guys.  I even made a post here somewhere to read up on... the link below has my interpretation of the basic journal tutorial on easyuo.

http://www.scriptuo.com/index.php?topic=4001.0;highlight=journal+scanning

Offline Katu

  • Jr. Member
  • **
  • Posts: 43
  • Activity:
    0%
  • Reputation Power: 2
  • Katu has no influence.
  • Respect: +5
  • Referrals: 0
    • View Profile
Re: TrailMyx's Advanced Journal Handler
« Reply #28 on: April 05, 2010, 12:06:49 PM »
+1
Hello,
I Use your this and i love it. However, i had to mod it just a little bit. I think the mod is very handy and has lots of uses. When you use VALID, it checks if your char said it. I modded it so, that you give a name for the sub. I changed so that %3 is !charname.
This way you can wait for text sayd by someone else and be 100% sure its that character saying it. In situations, where multiple characters can issue commands for script, but you want to restrict it to just to those, who you know.

I changed THIS:
Code: [Select]
  set !first_arg 3
To THIS:
Code: [Select]
  ;Katu ADD
  if VALID in !args
  {
     set !charname %3
     set !first_arg 4
  }
  else
      set !first_arg 3
And now, if using VALID arg, you call sub like this:
Code: [Select]
gosub TM_AdvJournalScan network VALID_ADVANCE Friend_Char_Name You_are_invited_to_join_the_party.

Im not saying that you should change this, im just pointing out the possibilities :)

-Katu

PS: I always modify other ppl code to suit my needs, but i always give em credit.

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • 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: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: TrailMyx's Advanced Journal Handler
« Reply #29 on: April 05, 2010, 12:51:59 PM »
+1
Well that's what the code is there for.  Tools to help you do your thing, but generally generic code doesn't do EXACTLY what you might want.  For your bot-code, that makes much sense.
Please read the ScriptUO site RULES
Come play RIFT with me!