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

0 Members and 2 Guests are viewing this topic.

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • 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 #45 on: January 11, 2012, 07:34:29 PM »
0
I never had an actual release, but in my beetlejacker I had layed the ground work for that feature so it was easy to pull together.  Hope you can find some use for it; I don't believe I've tested it so I'd appreciate your feedback - good or bad.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline OMGBurgers

  • Hero Member
  • *
  • Posts: 800
  • Activity:
    0%
  • Reputation Power: 7
  • OMGBurgers has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: TrailMyx's Advanced Journal Handler
« Reply #46 on: January 12, 2012, 01:55:31 PM »
0
Perfect :)

I was able to compile all my triggers into the one gosub for that script.  I did modify it though because I forgot there's a few parts of the script that do time tracking based on journal text.  So what I did was copied the TM_AdvJournalGetTrigger, and renamed it TM_AdvJournalGetJournalTrigger, and just had it return the actual journal text.  I also edited the TM_AdvJournalScan sub to store !journaltrigger for returning of the added sub.  That way if it was one of the few triggers that needed to get the exact time out of the journal, or odd text that i can't include in the trigger, i could grab it quickly and easily.

Can't wait to add this into the other scripts.  I think it'll help them out, along with make them simplier because this really simplified the journal handling of the script.

Thank you!

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • 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 #47 on: January 12, 2012, 02:34:37 PM »
0
Beautiful, glad that was helpful.  It's amazing how daunting journal scanning can be until you get some good subs to work with.  I look back at my old code and shake my head at all the times in the same script I have the same basic lame code.  Yuck.

Anyhow, I have another version where I do the same thing you are talking about, but I store them in just a %var so it's visible in all namespaces and can be used for diagnostic purposes.  I should add that to the release soon, no?  :)
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: TrailMyx's Advanced Journal Handler
« Reply #48 on: July 10, 2013, 09:41:23 PM »
0
Hi TM
 Trying to use ur journal and just wondering if this is correct.   It seen like the journal is not working properly and not sure if I set ur variable correctly. 
Code: [Select]
sub setup
gosub TM_AdvJournalSync snake 100
retrun

 gosub TM_AdvJournalScan snake VALID You_don't_seem_to_be_able_to_persuade_that_to_move.
   if #RESULT = #TRUE
   {
   return UseFlute
   }
  gosub TM_AdvJournalScan snake VALID The_animal_walks_where_it_was_instructed_to.
  if #RESULT = #TRUE
   {
   ignoreitem %snake
   wait 5s
   return UseFlute
   }
  gosub TM_AdvJournalScan snake VALID the_nest_collapses
  if #RESULT = #TRUE
   {
   gosub ignore
   return targethole
   }

sub ignore
  deletejournal
  ignoreitem reset
return

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • 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 #49 on: July 10, 2013, 11:25:18 PM »
0
you should probably not use "deletejournal" since the subs will take care of that for you.

Also, when you get a "hit" on a journal scan, you need to "sync" so that you won't re-trigger on a journal event.  Under normal circumstances, you could use the VALID_ADVANCE flags, but the way you are using the subs, you probably should call "gosub TM_AdvJournalSync snake" when you have a valid "hit".  So perhaps you will have something like this (NOT TESTED!!!)

Code: [Select]
sub setup
gosub TM_AdvJournalSync snake 100
return  ; note the mispelling.....

 gosub TM_AdvJournalScan snake VALID You_don't_seem_to_be_able_to_persuade_that_to_move.
   if #RESULT = #TRUE
   {
   gosub TM_AdvJournalSync snake
   return UseFlute
   }
  gosub TM_AdvJournalScan snake VALID The_animal_walks_where_it_was_instructed_to.
  if #RESULT = #TRUE
   {
   gosub TM_AdvJournalSync snake
   ignoreitem %snake
   wait 5s
   return UseFlute
   }
  gosub TM_AdvJournalScan snake VALID the_nest_collapses
  if #RESULT = #TRUE
   {
   gosub TM_AdvJournalSync snake
   gosub ignore
   return targethole
   }

sub ignore
;  deletejournal  ; nope, don't do this....
  ignoreitem reset
return

Remember that the ADVANCE modifier automatically syncs the journal pointer.  Without that, the pointer will not advance unless you explicitly "sync" the pointer to the most current place.  If you play with some test code using the VALID vs. VALID_ADVANCE or using the "gosub TM_AdvJournalSync", you can see how this works for your purposes.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: TrailMyx's Advanced Journal Handler
« Reply #50 on: July 11, 2013, 03:47:40 PM »
0
Thx.
  I did try , but didn't seen to woking properly as well.   
Code: [Select]
gosub TM_AdvJournalScan snake VALID_ADVANCE You_don't_seem_to_be_able_to_persuade_that_to_move.
   if #RESULT = #TRUE
  {
   return UseFlute
   }

I notice that few thread below,  we are able to have multiple  search line. 
 1) how do I separate them
      the_snake_searches_the_nest_and_finds_nothing
         and
   The_animal_walks_where_it_was_instructed_to.
 2) can i use only a few work or the whole sentence


Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • 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 #51 on: July 11, 2013, 04:35:03 PM »
0
Perhaps the "VALID" flag is making it not work.  Try this:

Code: [Select]
   gosub TM_AdvJournalScan snake NONE persuade_that_to_move
   if #RESULT = #TRUE
  {
     gosub TM_AdvJournalSync snake
     return UseFlute
   }

I'd only use a snippet of the "You_don't_seem_to_be_able_to_persuade_that_to_move."  "persuade_that_to_move" will work.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: TrailMyx's Advanced Journal Handler
« Reply #52 on: July 13, 2013, 05:42:38 PM »
0
Good day TM 
It seen that I have a bit of problem and required your wisdom. The journal seen to work half time, and I'm sure it a question of located the right place for the gosub TM Adv.  the # 1 and 2 are working fine.  # 3,   I have try all 3 NONE, Valid & valid_advance  and 90%  of the time the script don't cycle.    I do have 4 to 10 lines before the  gosub TM have the time to scan.   could that be the problem.    And can you tell me if I coded correctly the sub TM to scan for two action in  1 & 2.   Thx

Code: [Select]
; 1
gosub TM_AdvJournalScan snake VALID_ADVANCE to_persuade_that_to_move it_to_recharge  ;   looking for two action here
   if #RESULT = #TRUE
   {
    gosub TM_AdvJournalSync snake
     wait 6s
   goto UseFlute
   }
; 2
  gosub TM_AdvJournalScan snake VALID_ADVANCE The_animal_walks already_taming where_it_was_instructed_to.    ;  looking for two action here
    if #RESULT = #TRUE
   {
        gosub TM_AdvJournalSync snake
   ignoreitem %snake
     wait 6s
    goto UseFlute
   }
; 3
  gosub TM_AdvJournalScan snake VALID_ADVANCE the_nest_collapses Target_cannot_be_seen
  if #RESULT = #TRUE
   {
   gosub TM_AdvJournalSync snake
    gosub ignore
   Return   ; go back to beginning to target a new hole
   }

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • 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 #53 on: July 13, 2013, 10:00:51 PM »
0
Since you are syncing by hand, you should change all your modifiers to just VALID.  What ADVANCE does when you call the journal scan, it scans for what you have requested and AUTOMATICALLY syncs at the end of a call.  But suppose one of your other triggers (2)  happens while you are looking for the original set (1) and you sync automatically, then you'll miss them.

Question:
Are you looking for different actions here?  Looks like there's taming in there as well as other things.  It would be best to split up your actions into their own individual journal scanner.  Have snake related items in "snake" and create another scanner for other non-related searches.

Another question:
What's UseFlute and why are you using "goto"?
« Last Edit: July 13, 2013, 10:06:20 PM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: TrailMyx's Advanced Journal Handler
« Reply #54 on: July 13, 2013, 11:04:19 PM »
0
TM
I'm trying to scan the journal so depending on the snake reaction,  I can target a new one, target the same one or target a new hole.  By having goto within the sub it allow me to moving inside it.    Trying to upgrade my this sub  with ur journal. 
Code: [Select]
sub HuntEgg
UseFlute:
gosub TM_AdvJournalScan snake VALID_ADVANCE the_nest_collapses Target_cannot_be_seen
  if #RESULT = #TRUE
   {
   gosub TM_AdvJournalSync snake
;    pause
    gosub ignore
   Return  ;  go back to beginning to target a new hole
   }
finditem %flute C_ , #BACKPACKID ; Charmer Flute
     event property #findid
  if Charmer in #property
     set %flute #findid   ; find only charmer flute
else
    {
    ignoreitem #findid
    event macro 8 7  ; Open main pack
    wait 15
    contpos 1050 320
    goto UseFlute
    }
    set #lobjectid %flute
    event macro 17 0
;======================================================
; S Goto Target Snake
;======================================================
FindSnake:
  finditem %snakes G_10
  set #ltargetid #findid
  set #ltargetkind 1
  set %snake #findid
 ; if %snakes <> #ltargetid
  ;   event exmsg %snakes 3 30 Pick
  target
  event macro 22    ;  Last Target
;   event exmsg %snakes 3 30 Pick
  wait 5
  click %lootx %looty d
  wait 1s
   gosub TM_AdvJournalScan snake VALID_ADVANCE to_persuade_that_to_move it_to_recharge
   if #RESULT = #TRUE
   {
    gosub TM_AdvJournalSync snake
;    pause
   wait 6s
   goto UseFlute
   }
  gosub TM_AdvJournalScan snake VALID_ADVANCE The_animal_walks already_taming where_it_was_instructed_to.
  if #RESULT = #TRUE
   {
    gosub TM_AdvJournalSync snake
   ignoreitem %snake
;   pause
   wait 6s
    goto UseFlute
   }
goto UseFlute
;======================================================
; Sub Ignor snake
;======================================================
sub ignore
  ignoreitem reset  ;Reset all snake
return
;============

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • 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 #55 on: July 13, 2013, 11:29:46 PM »
0
I would definitely start by removing the ADVANCE modifier from all your subroutine calls and see how that works.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Grandewd

  • Full Member
  • ***
  • Posts: 239
  • Activity:
    0%
  • Reputation Power: 3
  • Grandewd has no influence.
  • Respect: +24
  • Referrals: 0
    • View Profile
Re: TrailMyx's Advanced Journal Handler
« Reply #56 on: August 10, 2013, 07:48:02 PM »
0
I'm pullin my hair out...

I've successfully used your awesome TM_AdvJournalScan sub before and it always worked perfectly.  I'm currently looking for gains while training, but it wouldn't see what was clearly a journal entry.
So I decided to see what it was returning.  So I did this:

Code: [Select]
gosub TM_AdvJournalScan detect ADVANCED Detecting_Hidden
MSG #result $

It returns a 0.  What's up?

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • 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 #57 on: August 10, 2013, 07:59:28 PM »
0
Do you have some more code to post?  If not, then try changing "ADVANCED" to "ADVANCE"
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Grandewd

  • Full Member
  • ***
  • Posts: 239
  • Activity:
    0%
  • Reputation Power: 3
  • Grandewd has no influence.
  • Respect: +24
  • Referrals: 0
    • View Profile
Re: TrailMyx's Advanced Journal Handler
« Reply #58 on: August 11, 2013, 08:48:57 AM »
0
Hi TM,

Sorry for not adding the script.  Here's what I'm using to see what #RESULT is when using the (always in the past, perfect) TM_AdvJournalScan

Code: [Select]
finditem IS G_5 ;friend's char type IS
if #findkind <> -1
set #lobjectid #findID
event macro 17 ;last object
wait 25
set #lobjectid UYNKSND ; friend's backpak id
Event Macro 17 0
wait 1s
gosub TM_AdvJournalScan snoop ADVANCE Snooping
wait 10
if #RESULT = #FALSE
msg #result $
if #RESULT = #TRUE
msg #result $
halt

No matter if I've gained or not, it always returns a 0.

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • 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 #59 on: August 11, 2013, 10:05:16 AM »
0
I'm assuming you're including the subroutines at the end of your code?  Also, what is the trigger text values you're looking for?  I see you're looking for "snooping", but what's the full text?

Finally, you should initialize the routine at the beginning of your script.  Include this line:

Code: [Select]
gosub TM_AdvJournalSync snoop 100
Please read the ScriptUO site RULES
Come play RIFT with me!