Author Topic: ScriptUO Healing Commander  (Read 47339 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
ScriptUO Healing Commander
« on: June 09, 2008, 12:20:32 PM »
+2
Code: [Select]
;=================================================================
; Script Name: ScriptUO Healing Commander
; Author: TrailMyx/Cerveza
; Version: 2.94
; Shard OSI / FS: OSI / FS OK
; Revision Date: 9/29/2007
; Purpose: Manages your healing needs by using journal scanning.
; Globals:
;   *TM_HEAL = #TRUE if healing targeting in progress.
; Namespaces:
;   TM_heal(local)
;   TM_AdvJS_*
;
; Special Thanks:
;   Cerveza for all his input and prompting me to get off my butt and finish this
;   This is a showcase for the new journal handling subs.
;=================================================================

Probably a little explanation is in order for this script.  It will maintain your health using the following methods:

* Bandages
* Magery
* Chivalry
* Necromancy

(yes, no potions, sorry)

Other features of this allow you:
* Heal when low on health
* Cure when poisoned
* Aware of mortal strike attack and bleeding attacks
* Motion sensing to be sure you don't try and cast when you are on the run.
* Configurable thresholds for healing levels
* Stores setup for each character in persistent memory
* Integrates seamlessly with the CLAw autolooter
* Doesn't require OCR; everything is handled with the journal.

There are 1 attachment(s) in this post. You must register and post an acceptable introduction to download
tool_newbandage295.txt
« Last Edit: November 08, 2008, 08:26:16 PM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: ScriptUO Healing Commander
« Reply #1 on: October 25, 2008, 07:39:18 PM »
+1
There's a couple flaws with Necromancy healing.

1 - It tries twice and you get the "you must wait"

2 - It's not setting !TM_HEAL to true.

I'm running this little snip script to test times:

Code: [Select]
TM:
repeat
namespace copy TM_HEAL from global TM_HEAL
event sysmessage #sCnt2

gosub Check_Status
if #RESULT = #TRUE
  event sysmessage *** TRUE TRUE TRUE TRUE ***

until #CharGhost = YES
while #CharGhost = YES
  wait 0
GoTo TM

sub Check_Status
if #targCurs = 1 || #lLiftedKind = 1 || !TM_HEAL = #TRUE
  return #TRUE
return

It works for Chiv heals, but I never see *** TRUE when I use Necro heals.

*Actually, it must be something slowing down the recognition.... The bandage status is accurately displayed on both the Commander and the Bandage Status menus, but not making it to my script above.
« Last Edit: October 25, 2008, 07:44:11 PM by Cerveza »
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

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: ScriptUO Healing Commander
« Reply #2 on: October 25, 2008, 07:42:10 PM »
+1
There's a couple flaws with Necromancy healing.

1 - It tries twice and you get the "you must wait"

2 - It's not setting !TM_HEAL to true.

I'm running this little snip script to test times:

*snip*

It works for Chiv heals, but I never see *** TRUE when I use Necro heals.

Heh, well I think I never even tested it.  I'd fall over dead in shock if it worked actually... :)
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: ScriptUO Healing Commander
« Reply #3 on: October 25, 2008, 07:47:24 PM »
+1
I see something....

Code: [Select]
sub TM_GetHealStatus
  namespace push
  namespace global TM_healer
  set #RESULT !TM_HEAL
  namespace pop
return #RESULT
But searching I didn't see a gosub for it?

OH and is it

namespace copy TM_HEAL from global TM_HEAL
or
namespace copy TM_HEAL from global TM_Healer

I use the first, but I noticed the Bushido trainer uses "TM_Healer". The Healing Commander says TM_HEAL in the header, but all the globals in the script are Healer?
« Last Edit: October 25, 2008, 07:55:15 PM by Cerveza »
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: ScriptUO Healing Commander
« Reply #4 on: October 25, 2008, 07:56:40 PM »
+1
It's TM_Healer, working fine. Please to notify the author to correct his header in his script  :P
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

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: ScriptUO Healing Commander
« Reply #5 on: October 25, 2008, 08:09:38 PM »
+1
lool, nerd.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: ScriptUO Healing Commander
« Reply #6 on: October 25, 2008, 08:13:24 PM »
+1
still having issues.

It's not releasing after !TM_HEAL goes true. Should the Healing Commander release it back to !TM_HEAL = #FALSE?
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

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: ScriptUO Healing Commander
« Reply #7 on: October 25, 2008, 08:39:22 PM »
+1
Not for Necro, the healing busy was mainly for bandages.
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: ScriptUO Healing Commander
« Reply #8 on: October 25, 2008, 08:40:20 PM »
+1
However, if I read your question correctly, I don't think the Necromancy sub should be setting !TM_HEAL to #FALSE.....
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: ScriptUO Healing Commander
« Reply #9 on: October 25, 2008, 11:23:18 PM »
+1
And yes that's a bug.  :)

What the heck are you doing healing with Necro anyway?
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: ScriptUO Healing Commander
« Reply #10 on: October 26, 2008, 06:24:41 AM »
+1
It's not so much healing with a necro as ensuring the !TM_Healer is working correctly with other scripts. I was using my Whammy to test it and tried SS to heal.

I found something else that is very serious, not with the commander, but EUO in general. I'll put it up for your evaluation later today.

In a nutshell....

Loop checks for !TM_Healer, has a Journal scan in the loop, loop runs at #sCnt2 of 2 per loop.
Once !TM_Healer goes #TRUE the loop detects it.
Once !TM_Healer goes back to #FALSE, that SAME Journal scan is slowing the loop time to over 20.
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: ScriptUO Healing Commander
« Reply #11 on: October 26, 2008, 07:17:13 AM »
+1
It's the LPC with the journal scanner.

Why doesn't it return to whatever the LPC of the script is?

gosub TM_AdvJournalSync paralyzed 100

That works great until the script recognizes a !TM_Healer = #TRUE, after that it slows way down.

gosub TM_AdvJournalSync paralyzed 1000

Works the whole time?

Run the healing commander and this test script. Then hurt yourself with a trapped box. You'll see that the time between counters BEFORE a !TM_Healer is really fast, but *AFTER* it slows waaaaay down. It's the JournalScanner thats doing it.

Code: [Select]
gosub TM_AdvJournalSync paralyzed 100

TM:
repeat
event sysmessage #sCnt2 1
namespace copy TM_HEAL from global TM_Healer
wait 10 ; just so it doesn't spam-a-lot

gosub Check_Status
if #RESULT = #TRUE
{
  event sysmessage *** TRUE TRUE TRUE TRUE ***
  goto TM
}

; ***** rem out this section and test again *****

gosub TM_AdvJournalScan paralyzed VALID you_cannot_move the_attack_has_temporarily
if #result = #TRUE
  gosub ParaCrate

; ***** rem out the above section and test again *****

event sysmessage #sCnt2 2

until #CharGhost = YES
while #CharGhost = YES
  wait 0
GoTo TM

sub Check_Status
if #targCurs = 1 || #lLiftedKind = 1 || !TM_HEAL = #TRUE
  return #TRUE
return

;**************************************
; This sub doesn't matter, it shouldn't
; get called because the text shouldn't
; ever be recognized
;**************************************

sub ParaCrate
  set #lobjectid %crateID
  event macro 17
  wait 5
return

;=================================================================
; Script Name: TrailMyx's Advanced Journal Scanner
; Author: TrailMyx
; Version: 1.0
; Shard OSI / FS: OSI / FS?
; Revision Date: 10/20/2007
; Purpose:
;   Use these subs to quickly find text in your #journal entries.  These subs
; use #jindex for flawless journal scanning and is much more reliable than using
; standard indexing of #journal and #SYSMSG.
;
;   Now it is possible to manage separate journals based on unrelated text.  It's now possible
; to monitor spellcasting, bandaging, stealing, or anything else without a TM_AdvJournalSync
; potentially removing text needed for another UO funciton.
;
;   New is the ability to either gosub or call these functions without the need to change the
; header!  When calling, a limit of 10 arguments is allowed, but more can be added by editing the
; call interface section.
;
;  Examples:
;     gosub TM_AdvJournalSync speech 100 ; sync "speech" journal space, set #LPC to 100 from default of 1000
;     gosub TM_AdvJournalScan speech VALID Find_this_text and_find_this_too ; will not advance copy of #jindex
;     gosub TM_AdvJournalScan heal VALID_ADVANCE you_heal_what that_patient_is_not ; advances pointer after scan
;     gosub TM_AdvJournalScan spellcast NONE fizzle ; no spam checking and doesn't advance #jindex copy automatically
;
;  Subs included:
;     TM_AdvJournalSync - Must call this in initialzation
;     TM_AdvJournalScan - see header for details....
;
;  Release history:
;    v1.0 - Initial release.
;
;  Requirements:
;    Nothing special
;
;  Credit:
;    If you use these subs, please leave credit for me somewhere in your script header.
;=================================================================
;------------------------  Call interface  -----------------------
;=================================================================
set !TM_FunctionCalled #FALSE
if %0 = 1
  gosub %1
if %0 = 2
  gosub %1 %2
if %0 = 3
  gosub %1 %2 %3
if %0 = 4
  gosub %1 %2 %3 %4
if %0 = 5
  gosub %1 %2 %3 %4 %5
if %0 = 6
  gosub %1 %2 %3 %4 %5 %6
if %0 = 7
  gosub %1 %2 %3 %4 %5 %6 %7
if %0 = 8
  gosub %1 %2 %3 %4 %5 %6 %7 %8
if %0 = 9
  gosub %1 %2 %3 %4 %5 %6 %7 %8 %9
if %0 = 10
  gosub %1 %2 %3 %4 %5 %6 %7 %8 %9 %10
if %0 = 11
  gosub %1 %2 %3 %4 %5 %6 %7 %8 %9 %10 %11
if %0 > 11
{
  display ok Too many arguments for "call", edit file.
  stop
}

if !TM_FunctionCalled = #TRUE
  exit
if %0 = N/A
  display ok You may not run this script directly.
else
  display ok Function " , %1 , " not found.
stop
;-------------------------------------------------------------------------------
;-------------------------------------------------------------------------------
; %1 - Journal Name
; %2 - #LPC setting (optional)
; Brings !_jindex up to the most recent #journal entry
sub TM_AdvJournalSync
  namespace push
  namespace local TM_AdvJS_ , %1
  set !_jindex #jindex + 1
  if %0 > 1
    set !lpc_set %2
  namespace pop
  set !TM_FunctionCalled #TRUE
return
;-------------------------------------------------------------------------------
; %1 - Journal Name
; %2 - NONE, ADVANCE , ( _VALID ) - advances jindex pointer, anything else
; %3, %4, %5, etc strings to match
; returns #TRUE for match, #FALSE for no match
;  Will not advance !_jindex pointer to allow for scanning journal history for more than one search.
;  Also searches for : , #SPC in journal entry to be sure someone isn't spamming the text
;  About %2 arguments:
;    NONE: defaults to basic journal scan (no SPAM checking, no #jindex pointer copy advancing)
;    ADVANCE: no spam checking, advances #jindex copy
;    VALID: invokes SPAM filtering, no advance of #jindex copy
;    VALID_ADVANCE, VALIDADVANCE, ADVANCE_VALID, etc.: invokes SPAM filtering, advances of #jindex copy
sub TM_AdvJournalScan
  namespace push
  namespace local TM_AdvJS_ , %1
  set !args %2
  set !temp_lpc #LPC
  if !lpc_set = N/A
    set #LPC 1000
  else
    set #LPC !lpc_set
  set !num_args %0
  set !first_arg 3
  if !_jindex = N/A
    set !_jindex #jindex
  if !charname = N/A
  {
    set !charname #CHARNAME
AdvJournalScan_loop1:
    str pos !charname #SPC
    if #STRRES <> 0
    {
      set !val #STRRES - 1
      str left !charname !val
      set !left #STRRES
      set !val !val + 1
      str del !charname 1 !val
      set !charname !left , _ , #STRRES
      goto AdvJournalScan_loop1
    }
  }
  set !index !first_arg
  repeat
    set !temp_jindex !_jindex
    set !text % . !index
    while !temp_jindex <= #jindex
    {
      scanjournal !temp_jindex
      str pos #JOURNAL !charname 1
      set !namepos #STRRES
      str count #JOURNAL !charname
      set !namecnt #STRRES
      str pos #JOURNAL :_ 1
      set !smcpos #STRRES
      str pos #JOURNAL !text 1
      set !textpos #STRRES
      if !textpos < !smcpos && !smcpos <> 0 || !smcpos = 1 || :_ notin #JOURNAL || VALID notin !args
        set !pass #TRUE
      else
        set !pass #FALSE
      if ( !text in #journal && ( ( !namepos = 1 && !namecnt <= 1 ) || !pass ) )
      {
        set !temp_jindex !temp_jindex + 1
        if ADVANCE in !args
          set !_jindex !temp_jindex
        set #LPC !temp_lpc
        namespace pop
        set !TM_FunctionCalled #TRUE
        return #TRUE
      }
      set !temp_jindex !temp_jindex + 1
    }
    set !index !index + 1
  until !index - !first_arg > !num_args - !first_arg
  set #LPC !temp_lpc
  namespace pop
  set !TM_FunctionCalled #TRUE
  return #FALSE
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

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: ScriptUO Healing Commander
« Reply #12 on: October 26, 2008, 12:05:28 PM »
+1
Ok, the problem you are having isn't with the journal scanner, but how you are using it.  Remember, you are in control of the ADVANCE pointer with the way you have coded it.  So at the end of your loop (your UNTIL), you need to put a:

Code: [Select]
gosub TM_AdvJournalSync paralyzed

The version you posted lets the pointer run away in the journal scanner, so every time you spam your debug information, you start filling up the journal and since you aren't synchronizing the pointer to text you have already scanned, you are scanning the entire journal again.

If you plan to not have another journal search for that information, you can just do:

Code: [Select]
gosub TM_AdvJournalScan paralyzed VALID_ADVANCE you_cannot_move the_attack_has_temporarily


Your test code was helpful, because even just sitting there, I could watch the number start to print out slower and slower.  EasyUO is a VERY slow interpreter so large loops get obvious rather quickly.

To convince yourself that the journal scanner is keeping the pointers under control, use this version of TM_AdvJournalScan:

Code: [Select]
sub TM_AdvJournalScan
  namespace push
  namespace local TM_AdvJS_ , %1
  set !args %2
  set !temp_lpc #LPC
  if !lpc_set = N/A
    set #LPC 1000
  else
    set #LPC !lpc_set
  set !num_args %0
  set !first_arg 3
  if !_jindex = N/A
    set !_jindex #jindex
  if !charname = N/A
  {
    set !charname #CHARNAME
    AdvJournalScan_loop1:
      str pos !charname #SPC
      if #STRRES <> 0
      {
        set !val #STRRES - 1
        str left !charname !val
        set !left #STRRES
        set !val !val + 1
        str del !charname 1 !val
        set !charname !left , _ , #STRRES
        goto AdvJournalScan_loop1
      }
  }
  set !index !first_arg
  repeat
    set !temp_jindex !_jindex
    set !text % . !index
    while !temp_jindex <= #jindex
    {
      scanjournal !temp_jindex
      str pos #JOURNAL !charname 1
      set !namepos #STRRES
      str count #JOURNAL !charname
      set !namecnt #STRRES
      str pos #JOURNAL :_ 1
      set !smcpos #STRRES
      str pos #JOURNAL !text 1
      set !textpos #STRRES
      if !textpos < !smcpos && !smcpos <> 0 || !smcpos = 1 || :_ notin #JOURNAL || VALID notin !args
        set !pass #TRUE
      else
        set !pass #FALSE
      if ( !text in #journal && ( ( !namepos = 1 && !namecnt <= 1 ) || !pass ) )
      {
        set !temp_jindex !temp_jindex + 1
        if ADVANCE in !args
          set !_jindex !temp_jindex
        set #LPC !temp_lpc
        namespace pop
        return #TRUE
      }
      set !temp_jindex !temp_jindex + 1
    }
    set !index !index + 1
  until !index - !first_arg > !num_args - !first_arg
  if ADVANCE in !args
    set !_jindex !temp_jindex
  set #LPC !temp_lpc
  set %10 #JINDEX - !_jindex
  set %10 %1 , _ , %10
  namespace pop
return #FALSE

If you monitor the %10 variable, you should see the journal name followed by a small number, i.e. paralyzed_0.

Now there was a bug like this a long time ago in the journal scanner back on uocoders, but that was fixed.  You made me think that some older code crept back in....
« Last Edit: October 26, 2008, 12:37:05 PM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: ScriptUO Healing Commander
« Reply #13 on: October 26, 2008, 01:33:32 PM »
+1
Thats exactly it. I had updated the journal scanner from an earlier version that worked great. I got the syntax wrong on it this time.


XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

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: ScriptUO Healing Commander
« Reply #14 on: October 26, 2008, 09:43:34 PM »
+1
Then all is good in scripting land.  :)
Please read the ScriptUO site RULES
Come play RIFT with me!