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

0 Members and 1 Guest are viewing this topic.

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 #60 on: August 11, 2013, 03:11:37 PM »
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

Oops, forgot to do that... Txh TM   :-[

Offline Tommy Boy

  • Jr. Member
  • **
  • Posts: 79
  • Activity:
    0%
  • Reputation Power: 2
  • Tommy Boy has no influence.
  • Respect: +14
  • Referrals: 0
    • View Profile
Re: TrailMyx's Advanced Journal Handler
« Reply #61 on: January 06, 2020, 01:30:15 AM »
0

I just can't get this to work

I want to add this to Raziel's BOD gathering script.

I added these two lines at the beginning of the script;

Code: easyuo
  1. gosub TM_AdvJournalSync travel 100
  2. gosub TM_AdvJournalSync bod 100


Then this in the BOD collecting subroutine;

Code: easyuo
  1. gosub TM_AdvJournalScan bod VALID_ADVANCE An_offer_may be_available
  2. if #result = #true
  3. {
  4.   namespace pop
  5.   return #true
  6. }

I want it to move on to the next !bodType if too early to get another same type of BOD.  I have it set to gather three BODs at a time currently.

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 #62 on: January 06, 2020, 08:24:23 AM »
0

I just can't get this to work

I want to add this to Raziel's BOD gathering script.

I added these two lines at the beginning of the script;

Code: easyuo
  1. gosub TM_AdvJournalSync travel 100
  2. gosub TM_AdvJournalSync bod 100


Then this in the BOD collecting subroutine;

Code: easyuo
  1. gosub TM_AdvJournalScan bod VALID_ADVANCE An_offer_may be_available
  2. if #result = #true
  3. {
  4.   namespace pop
  5.   return #true
  6. }

I want it to move on to the next !bodType if too early to get another same type of BOD.  I have it set to gather three BODs at a time currently.

Instead of "VALID_ADVANCE" just try "ADVANCE"
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Tommy Boy

  • Jr. Member
  • **
  • Posts: 79
  • Activity:
    0%
  • Reputation Power: 2
  • Tommy Boy has no influence.
  • Respect: +14
  • Referrals: 0
    • View Profile
Re: TrailMyx's Advanced Journal Handler
« Reply #63 on: January 06, 2020, 09:48:21 AM »
0

I just can't get this to work

I want to add this to Raziel's BOD gathering script.

I added these two lines at the beginning of the script;

Code: easyuo
  1. gosub TM_AdvJournalSync travel 100
  2. gosub TM_AdvJournalSync bod 100


Then this in the BOD collecting subroutine;

Code: easyuo
  1. gosub TM_AdvJournalScan bod VALID_ADVANCE An_offer_may be_available
  2. if #result = #true
  3. {
  4.   namespace pop
  5.   return #true
  6. }

I want it to move on to the next !bodType if too early to get another same type of BOD.  I have it set to gather three BODs at a time currently.

Instead of "VALID_ADVANCE" just try "ADVANCE"

Thanks for the quick response TM unfortunately it still doesn't return #true.

Just FYI, the old style scanJournal 1/2 isn't working either.  The NPC speaks these words and they are definitely in the journal.  I'm baffled.

Offline Tommy Boy

  • Jr. Member
  • **
  • Posts: 79
  • Activity:
    0%
  • Reputation Power: 2
  • Tommy Boy has no influence.
  • Respect: +14
  • Referrals: 0
    • View Profile
Re: TrailMyx's Advanced Journal Handler
« Reply #64 on: January 06, 2020, 10:03:18 AM »
0
This is the original code;

Code: easyuo
  1. sub bod
  2. namespace push
  3. namespace local bod
  4. set !NPC %1
  5. BOD:
  6. finditem !npc
  7. if #findkind = -1
  8. {
  9.         namespace pop
  10.         return #false
  11. }
  12. gosub useVendor !npc %option
  13. if ! #result
  14. {
  15.         namespace pop
  16.         return #false
  17. }
  18. set !timeOut #scnt + 30
  19. _acceptBodLoop:
  20. scanjournal 1
  21. if an_offer_may in #journal
  22.         {
  23.         deletejournal
  24.         wait 60s
  25.         goto BOD
  26.         }
  27. if #scnt > !timeOut
  28.         goto BOD
  29. if #contname <> generic_gump
  30.         goto _acceptBodLoop
  31. str pos #contsize _
  32. str del #contsize 1 #strres
  33. set !y 20 + #strres
  34. _bodRetry:
  35. click 165 !y
  36. wait 10
  37. if #contname = generic_gump
  38.         goto _bodRetry
  39. namespace pop
  40. return #true


This is my modified subroutine;

Code: easyuo
  1. sub bod
  2. namespace push
  3. namespace local bod
  4. set %bodCount 0
  5. set !NPC %1
  6. BOD:
  7. finditem !npc
  8. if #findCnt = 0
  9. {
  10.         namespace pop
  11.         return #false
  12. }
  13. gosub useVendor !npc %option
  14. if ! #result
  15. {
  16.         namespace pop
  17.         return #false
  18. }
  19. set !timeOut #scnt + 30
  20. _acceptBodLoop:
  21. gosub TM_AdvJournalScan bod ADVANCE An_offer_may be_available
  22. if #result = #true
  23. {
  24.   namespace pop
  25.   return #true
  26. }
  27. if #scnt > !timeOut
  28.         goto BOD
  29. if #contname <> generic_gump
  30.         goto _acceptBodLoop
  31. str pos #contsize _
  32. str del #contsize 1 #strres
  33. set !y 20 + #strres
  34. _bodRetry:
  35. click 165 !y
  36. wait 10
  37. if #contname = generic_gump
  38.         goto _bodRetry
  39. set %bodCount %bodCount + 1
  40. scanjournal 2
  41. if %bodCount < 3 && an_offer_may notin #journal
  42.   goto BOD
  43. namespace pop
  44. return #true


This also doesn't work;

Code: easyuo
  1. sub bod
  2. namespace push
  3. namespace local bod
  4. set %bodCount 0
  5. set !NPC %1
  6. BOD:
  7. finditem !npc
  8. if #findCnt = 0
  9. {
  10.         namespace pop
  11.         return #false
  12. }
  13. gosub useVendor !npc %option
  14. if ! #result
  15. {
  16.         namespace pop
  17.         return #false
  18. }
  19. set !timeOut #scnt + 30
  20. _acceptBodLoop:
  21. set %jrnl #jindex
  22. while #true
  23. {
  24.   if #jindex > %jrnl
  25.   {
  26.     set %jrnl %jrnl + 1
  27.     scanjournal %jrnl
  28.     if An_offer_may in #journal
  29.     {
  30.       namespace pop
  31.       return #true
  32.     }
  33.   }
  34. }
  35. if #scnt > !timeOut
  36.         goto BOD
  37. if #contname <> generic_gump
  38.         goto _acceptBodLoop
  39. str pos #contsize _
  40. str del #contsize 1 #strres
  41. set !y 20 + #strres
  42. _bodRetry:
  43. click 165 !y
  44. wait 10
  45. if #contname = generic_gump
  46.         goto _bodRetry
  47. set %bodCount %bodCount + 1
  48. scanjournal 2
  49. if %bodCount < 3 && an_offer_may notin #journal
  50.   goto BOD
  51. namespace pop
  52. return #true

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 #65 on: January 06, 2020, 11:52:53 AM »
0
Obvious question....  Have you tacked the two subs of mine to the end of your code somewhere?
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Tommy Boy

  • Jr. Member
  • **
  • Posts: 79
  • Activity:
    0%
  • Reputation Power: 2
  • Tommy Boy has no influence.
  • Respect: +14
  • Referrals: 0
    • View Profile
Re: TrailMyx's Advanced Journal Handler
« Reply #66 on: January 06, 2020, 11:55:54 AM »
0
Obvious question....  Have you tacked the two subs of mine to the end of your code somewhere?

Yep

Hehe.  I know.  You had to ask. 

Offline Tommy Boy

  • Jr. Member
  • **
  • Posts: 79
  • Activity:
    0%
  • Reputation Power: 2
  • Tommy Boy has no influence.
  • Respect: +14
  • Referrals: 0
    • View Profile
Re: TrailMyx's Advanced Journal Handler
« Reply #67 on: January 06, 2020, 11:56:40 AM »
0
And I downloaded them fresh too. 

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 #68 on: January 06, 2020, 11:57:57 AM »
0
Yep

Hehe.  I know.  You had to ask.

Heh, yes.  One never knows.

You'll probably need to put a "pause" somewhere and start single stepping through the code and investigate what's in #JOURNAL as you loop through your code.  Something is odd just not sure where.
Please read the ScriptUO site RULES
Come play RIFT with me!

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 #69 on: January 06, 2020, 12:05:27 PM »
0
Did you mean for this:
Code: easyuo
  1. gosub TM_AdvJournalScan bod ADVANCE An_offer_may be_available
  2.  

to be 2 entires?  An_off_may and be_available

Did you mean:
Code: easyuo
  1. gosub TM_AdvJournalScan bod ADVANCE An_offer_may_be_available
  2.  
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Tommy Boy

  • Jr. Member
  • **
  • Posts: 79
  • Activity:
    0%
  • Reputation Power: 2
  • Tommy Boy has no influence.
  • Respect: +14
  • Referrals: 0
    • View Profile
Re: TrailMyx's Advanced Journal Handler
« Reply #70 on: January 06, 2020, 12:06:31 PM »
0
Did you mean for this:
Code: easyuo
  1. gosub TM_AdvJournalScan bod ADVANCE An_offer_may be_available
  2.  

to be 2 entires?  An_off_may and be_available

Did you mean:
Code: easyuo
  1. gosub TM_AdvJournalScan bod ADVANCE An_offer_may_be_available
  2.  

Offline Tommy Boy

  • Jr. Member
  • **
  • Posts: 79
  • Activity:
    0%
  • Reputation Power: 2
  • Tommy Boy has no influence.
  • Respect: +14
  • Referrals: 0
    • View Profile
Re: TrailMyx's Advanced Journal Handler
« Reply #71 on: January 06, 2020, 12:07:23 PM »
0
Did you mean for this:
Code: easyuo
  1. gosub TM_AdvJournalScan bod ADVANCE An_offer_may be_available
  2.  

to be 2 entires?  An_off_may and be_available

Did you mean:
Code: easyuo
  1. gosub TM_AdvJournalScan bod ADVANCE An_offer_may_be_available
  2.  

I've tried it both ways.  As all one statement or as two and also as just An_offer_may by itself

Offline Tommy Boy

  • Jr. Member
  • **
  • Posts: 79
  • Activity:
    0%
  • Reputation Power: 2
  • Tommy Boy has no influence.
  • Respect: +14
  • Referrals: 0
    • View Profile
Re: TrailMyx's Advanced Journal Handler
« Reply #72 on: January 06, 2020, 12:08:35 PM »
0
Yeah I've been doing that since last night and all morning.   Here's what I've got so far.

Code: easyuo
  1. AdvJournalScan_loop1:
  2.     str pos !charname #SPC
  3.     if #STRRES <> 0
  4.     {
  5.       set !val #STRRES - 1
  6.       str left !charname !val
  7.       set !left #STRRES
  8.       set !val !val + 1
  9.       str del !charname 1 !val
  10.       set !charname !left , _ , #STRRES
  11.       goto AdvJournalScan_loop1
  12.     }
  13.   }
  14.   set !index !first_arg
  15.   repeat
  16.     set !temp_jindex !_jindex
  17.     set !text % . !index
  18.     while !temp_jindex <= !sampled_jindex
  19.     {
  20.       scanjournal !temp_jindex
  21.       str pos #JOURNAL !charname 1
  22.       set !namepos #STRRES
  23.       str count #JOURNAL !charname
  24.       set !namecnt #STRRES
  25.       str pos #JOURNAL :_ 1
  26.       set !smcpos #STRRES
  27.       str pos #JOURNAL !text 1
  28.       set !textpos #STRRES
  29.       if !textpos < !smcpos && !smcpos <> 0 || !smcpos = 1 || :_ notin #JOURNAL || VALID notin !args
  30.         set !pass #TRUE
  31.       else
  32.         set !pass #FALSE
  33.       if ( !text in #journal && ( ( !namepos = 1 && !namecnt <= 1 ) || !pass ) )
  34.       {
  35.         set !temp_jindex !temp_jindex + 1
  36.         if ADVANCE in !args
  37.           set !_jindex !temp_jindex
  38.         set !trigger !text
  39.         set #LPC !temp_lpc
  40.         namespace pop
  41.         set !TM_FunctionCalled #TRUE
  42.         return #TRUE
  43.       }
  44.       set !temp_jindex !temp_jindex + 1
  45.     }
  46.     set !index !index + 1
  47.   until !index - !first_arg > !num_args - !first_arg
  48.   set %10 !sampled_jindex - !_jindex
  49.   set %10 %1 , _ , %10 ; for debugging purposes
  50.   set #LPC !temp_lpc
  51.   set TM_AdvJournalGetTrigger #FALSE
  52.   namespace pop
  53.   set !TM_FunctionCalled #TRUE
  54. return #FALSE

It loops thru lines 18 - 47 numerous times.  I noticed that it never executes line 37 after the "if ADVANCE".  It should shouldn't it?  I have that in the !args
Then it eventually returns and when it gets to what is line 22 of my modified subroutine, it doesn't execute it.

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 #73 on: January 06, 2020, 12:11:05 PM »
0
Are you seeing the value of #JOURNAL change as it loops?
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Tommy Boy

  • Jr. Member
  • **
  • Posts: 79
  • Activity:
    0%
  • Reputation Power: 2
  • Tommy Boy has no influence.
  • Respect: +14
  • Referrals: 0
    • View Profile
Re: TrailMyx's Advanced Journal Handler
« Reply #74 on: January 06, 2020, 12:13:19 PM »
0
I've watched it some.

But no not that I've noticed.  I'll go thru it and pay close attention to it.