Author Topic: scanjournal routine missing bandages?  (Read 3210 times)

0 Members and 1 Guest are viewing this topic.

Offline OMGBurgersTopic starter

  • Hero Member
  • *
  • Posts: 800
  • Activity:
    0%
  • Reputation Power: 7
  • OMGBurgers has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
scanjournal routine missing bandages?
« on: August 23, 2009, 09:55:38 AM »
0
This is just a little script I wrote to keep my character healing himself while running my ilshenar spawner.  It only heals w/ bandages and divine furys.  My problem is it will apply a bandage & then scan the journal for the message saying you finished healing yourself, but it occasionally misses it and will never badage self again so I die.

:*(

Can anyone see a loop hole anywhere that may be causing it?  I'd like to add a timeout value based on your dex & healing speed tables, but would be nice to figure out this problem first before working around what may be just a error in my code.


Code: [Select]
set %heal TRUE
set #lpc 500
set %timeout 999999
set %nextdf 0


loop:
   if %heal = FALSE
      gosub scan
   if #stamina < 84 && %nextdf < #SCNT2
      {
      event macro 15 205
      set %nextdf #SCNT2 + 40
      }
   if %heal = TRUE
      {
      if #hits < #maxhits
         {
         redobandage:
         finditem ZLF C_ , #backpackid
         if #findkind = -1
            sound
         set #lobjectid #findid
         event macro 17
         target 1s
         if #targcurs <> 1
            goto redobandage
         while #targcurs <> 0
            {
            event macro 23
            }
         set %heal FALSE
         set %lindex #jindex
         }
      }
goto loop

sub scan
   if #jindex = %lindex
      return
   set %temp #jindex
   for %a %lindex %temp
      {
      scanjournal %a
      if finish_applying_the_bandages in #journal || you_apply_the_bandages,_but in #journal || heal_what_little in #journal
         {
         set %heal TRUE
         set %lindex %temp
         return
         }
      }
   set %lindex %temp
return


Offline rana70

  • Elite
  • *
  • *
  • Posts: 294
  • Activity:
    0%
  • Reputation Power: 5
  • rana70 has no influence.
  • Gender: Male
  • Respect: +37
  • Referrals: 2
    • View Profile
    • MyScripts
Re: scanjournal routine missing bandages?
« Reply #1 on: August 23, 2009, 11:19:18 AM »
0
Hi,

Code: [Select]
      if finish_applying_the_bandages in #journal || you_apply_the_bandages,_but in #journal || heal_what_little in #journal
         {
         set %heal TRUE
         set %lindex %temp
         return
         }

When you find your journal statment .. you break your for loop
in this case yo set %lindex with %temp.

You scanned the lines from %Lindex to (%Lindex + %a)
but what about the lines between (%lindex + %a) and %temp.
You will loose them for your next scan ....

at least I think you will

Offline OMGBurgersTopic starter

  • Hero Member
  • *
  • Posts: 800
  • Activity:
    0%
  • Reputation Power: 7
  • OMGBurgers has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: scanjournal routine missing bandages?
« Reply #2 on: August 23, 2009, 11:58:20 AM »
0
The lines lost inbetween shouldn't matter since it just found the message for completing the bandage.  For the next scan it will reset the last scanned index as soon as it applies the bandage.  I'm not sure if I even really need to reset the last scanned index since it does set it each time it applies a bandage.  I suppose I can remove that line to make it a line shorter lol.

Maybe when it happens it's just a fluke of some sort.  I've been going about 40 minutes w/o the problem again.  I guess maybe I should just add in a failsafe timeout variable incase it happens again.

Offline UOMaddog

  • Maddog
  • Elite
  • *
  • *
  • Posts: 1625
  • Activity:
    0%
  • Reputation Power: 22
  • UOMaddog might someday be someone...UOMaddog might someday be someone...UOMaddog might someday be someone...UOMaddog might someday be someone...
  • Gender: Male
  • Biggest B@D@$$ of the Universe
  • Respect: +165
  • Referrals: 8
    • View Profile
    • Insane UO
Re: scanjournal routine missing bandages?
« Reply #3 on: August 23, 2009, 12:15:52 PM »
0
Double check that you have ALL possible messages. I remember with my script, I missed one message that occurred if you attempted to bandage while mortalled or something like that (maybe it was bleed, I don't remember) so if it's missing, it's probably because you don't have all the possible messages! Also, you can simply add a safety timer of 12 seconds since that is more than the maximum it would EVER take to bandage (which is 11 seconds)!
There are 10 kinds of people in this world: those that understand binary and those that don't!

Windows:  A 64-bit tweak of a 32-bit extension to a 16-bit user interface for an 8-bit operating system based on a 4-bit architecture from a 2-bit company that can't stand 1 bit of competition!

Offline OMGBurgersTopic starter

  • Hero Member
  • *
  • Posts: 800
  • Activity:
    0%
  • Reputation Power: 7
  • OMGBurgers has no influence.
  • Respect: +44
  • Referrals: 0
    • View Profile
Re: scanjournal routine missing bandages?
« Reply #4 on: August 23, 2009, 12:31:00 PM »
0
oh good idea.  I have 3 types of messages in it now, so i'll double check if there's any more i'm missing.  I know I don't have the mortal thing in it, but nothing at lord oaks will mortal you except guildmates lol.

I did go ahead and add a sub that sets a timeout based upon your dex just because it messed up again on me :*(

Offline TrailMyx

  • 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: scanjournal routine missing bandages?
« Reply #5 on: August 23, 2009, 01:10:36 PM »
0
More than once I've had typos in my journal search strings.  duh!
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline UOMaddog

  • Maddog
  • Elite
  • *
  • *
  • Posts: 1625
  • Activity:
    0%
  • Reputation Power: 22
  • UOMaddog might someday be someone...UOMaddog might someday be someone...UOMaddog might someday be someone...UOMaddog might someday be someone...
  • Gender: Male
  • Biggest B@D@$$ of the Universe
  • Respect: +165
  • Referrals: 8
    • View Profile
    • Insane UO
Re: scanjournal routine missing bandages?
« Reply #6 on: August 23, 2009, 03:02:04 PM »
0
Here's all the messages that i'm aware of:
if you_begin_applying_the_bandages in #journal
if you_must_use_a_stack_of_bandages_before_using_a_bandage_macro in #journal
if you_apply_the_bandages,_but_they_barely_help in #journal
if you_cannot_heal_that_target_in_their_current_state in #journal
if that_being_is_not_damaged in #journal
if you_finish_applying_the_bandages in #journal
if you_heal_what_little_damage_your_patient_had in #journal
if you_bind_the_wounds_and_stop_the_bleeding in #journal
There are 10 kinds of people in this world: those that understand binary and those that don't!

Windows:  A 64-bit tweak of a 32-bit extension to a 16-bit user interface for an 8-bit operating system based on a 4-bit architecture from a 2-bit company that can't stand 1 bit of competition!

Scrripty

  • Guest
Re: scanjournal routine missing bandages?
« Reply #7 on: September 03, 2009, 05:50:55 PM »
0
Here's all the messages that i'm aware of:
if you_begin_applying_the_bandages in #journal
if you_must_use_a_stack_of_bandages_before_using_a_bandage_macro in #journal
if you_apply_the_bandages,_but_they_barely_help in #journal
if you_cannot_heal_that_target_in_their_current_state in #journal
if that_being_is_not_damaged in #journal
if you_finish_applying_the_bandages in #journal
if you_heal_what_little_damage_your_patient_had in #journal
if you_bind_the_wounds_and_stop_the_bleeding in #journal

A long time ago I remember a write up someone did with nearly every message given in game for every skill...  Anyone have that somewhere? :)  If so I'd love to have that. :)

Offline UOMaddog

  • Maddog
  • Elite
  • *
  • *
  • Posts: 1625
  • Activity:
    0%
  • Reputation Power: 22
  • UOMaddog might someday be someone...UOMaddog might someday be someone...UOMaddog might someday be someone...UOMaddog might someday be someone...
  • Gender: Male
  • Biggest B@D@$$ of the Universe
  • Respect: +165
  • Referrals: 8
    • View Profile
    • Insane UO
Re: scanjournal routine missing bandages?
« Reply #8 on: September 04, 2009, 11:21:19 AM »
0
Wow, if someone could find that, that would be awesome! I use alot of journal scanning just to assure that things are happening and/or update other things, so I would find this amazingly helpful!!
There are 10 kinds of people in this world: those that understand binary and those that don't!

Windows:  A 64-bit tweak of a 32-bit extension to a 16-bit user interface for an 8-bit operating system based on a 4-bit architecture from a 2-bit company that can't stand 1 bit of competition!

Tags: