ScriptUO

Scripting Resources & Utilities => Stealth Client => Stealth scripts => Topic started by: Crome969 on March 10, 2012, 01:30:17 AM

Title: [Support] Simple Bandage Healer
Post by: Crome969 on March 10, 2012, 01:30:17 AM
Simple Bandage Healer

Header
Spoiler: show

[code]

=================================================================
 Script Name: Crome's Simple Bandage Healer
 Author: Crome696 AKA Jan Siems
 Version: 2
 Shard OSI / FS: OSI
 Revision Dates: 01\07\2013
 Public Release: 01\07\2013
 Purpose: Simple Bandage Healer for Dexxer
 Credits: Endless Night & Trailmyx for Licence

=================================================================
 (c) 2005-2013 Crome696 - All Rights Reserved
  Please respect my property rights.. :)
=================================================================
 Disclaimer:  By downloading, copying, running or otherwise using
 this script, you accept the contents of this limited personal use
 licence agreement.
 This script is only authorized to be distributed on www.Scriptuo.com.
 If you purchase this script, or acquire it from any other source, it
 is not considered an authorized copy and should be deleted immediately.
 Crome969 AKA Jan Siems(Author) provides no warranty for use, function,
 or safe interaction with any software or hardware. User downloads and
 runs this script at his-her own risk. User shall hold Author and the
 distribution site www.scriptuo.com harmless for any loss of items,
 accounts, money, virtual currency or items associated with the use of
 this script. User shall hold the author harmless for any consequences
 that may result from the use of this script as intended.  Furthermore,
 you promise not to distribute or sell this script to anyone without
 the express permission of the author, Crome696 AKA Jan Siems.
 Violation of this agreement will result in one or more of the following:
 litigation, www.scriptuo.com account termination, bad karma for your
 next life, and most definitely causing a black mark placed on your soul.

 This Script will never become by any definition of the words "Abandon ware",
 this script will always remain the property of the author unless
 rights are transfered by auther in writing (not email Writing).

 I worked very hard to bring this script to you, so please use it
 responisibily and respectfully.  If you have any questions, please
 reach me at jsiems87@googlemail.com

 (c) 2005-2013 Crome696 - All Rights Reserved
 Please respect my property rights.. :)
===================================================================
 Additional Licence to Use Agreement: You are free to use this script for not
 for profit personal UO gameplay. You are *NOT* free to repost,
 modify and repost, post on other websites, post as part of a script
 or work you yourself have created, email or transfer to another
 person by any method, or otherwise distribute without written
 permision from the author. This Applies to the script as a whole and
 any given part of the script.
 This license to use can be changed at any time for any reason.
 If in doubt dont do it contact the author.

 Commercial usage of any kind requires written permission from the author.

 (c) 2005-2013 Crome696 - All Rights Reserved
 Please respect my property rights.. :)
===================================================================
===================================================================
 NOTE: My scripts or any derivative of them are *not* for use in other players script!
===================================================================
===================================================================
[/code]

Instruction & Requirements
Spoiler: show


1) Download Attachment [b]SimpleBandageHealer.sc[/b]  and save into "Stealth Folder\Scripts"
3) Load Script into Stealth and Press Play
4) Enjoy



Notes
Spoiler: show


This Script will only work on OSI or Freeshards where Server sending http://docs.polserver.com/packets/index.php?Packet=0xDF to Client.
Script checks at Bandage Apply if you getting the Buff 1069 ( Apply Bandage ) and then doing Journalscan until you finished. If you failed to Apply it will reply the same action after 0,5s.



Update Version 2
- Add Precheckup with BuffSystem before Scan Journal to avoid timeouts due issue with apply Bandages
- Removed old Intro for Code..
Title:
Post by: gimlet on March 10, 2012, 09:03:38 AM
Wait 1000 ?
Title:
Post by: Crome969 on March 10, 2012, 09:17:21 AM
Wait 1000 ?
It isnt a must but i added it because i think everything have a timeoutdelay:) you could remove it.
Title:
Post by: gimlet on March 10, 2012, 10:32:27 AM
Believe me I agree! Just is it 1 sec?
Title:
Post by: Crome969 on March 10, 2012, 10:52:09 AM
Believe me I agree! Just is it 1 sec?
This Delay doesnt really matter i think. The Scan is Journal based even when journal is closed , stealth have its own. The Scanner will scan thousands of time per second. I just inserted the 1s to avoid the issue,that stealth will read the latest line faster then the message "You begin to apply your bandage" appeared.
Maybe i will make a real bandage Healer with potions etc soon. I just wanted throw something simple in, that peoplehave an working example.
Title:
Post by: Boydon on March 12, 2012, 11:17:57 AM
Why don't you use the WaitJournalLine method instead? You can also have different alternative lines in one command using the "|" separator.

I'dont remember exactly how time is handled in Pascal (I'm a Python guy ;) ) but the pseudo-code would look like this:

Code: [Select]
time : TDateTime;
begin
time = Now
UseType(Bandage,$FFFF);
WaitTargetSelf;
WaitJournalLine(time, 'You finish applying the bandages|You apply the bandages, but they barely help|You heal what little damage your patient had', 60000)
end;
Title:
Post by: Crome969 on December 25, 2012, 03:45:27 PM
Update :

Here is a newer Version of Code tested and working good :
Code: [Select]
Program SimpleBandage;
begin
  WHILE ( Connected() = True ) DO
  BEGIN
    IF (( ( Poisoned() = True ) OR ( HP < MaxHP ) ) AND ( Hidden() = False ) ) THEN
    BEGIN
      IF ( FindTypeEx($0E21,$FFFF,Backpack(),True) > 0 ) THEN
      BEGIN
        UseType($0E21,$FFFF);
        WaitTargetSelf();
        WaitJournalLine(Now,'0007A4E8|0007A4D4|0007A4E9|0007ADDC|0007A4E8|0007ADDB|0007A4B4|0007A4E7|0007ADDA',8000);
      END;
    END;
    Wait(50);
  END;
end.
Title:
Post by: Alpha on December 25, 2012, 04:29:13 PM
Heh...   Need to check for yellow status (Mortal) also.
Title:
Post by: Crome969 on December 25, 2012, 11:13:07 PM
Heh...   Need to check for yellow status (Mortal) also.
yeah iam digging into it
Title:
Post by: Alpha on December 26, 2012, 08:47:26 AM
Hey Chrome, 2 questions.   Is there any reason that in this specific application a STEALTH bandage healer will out perform EUO ??   (I know STEALTH has a huge leg up in gump handling, but wasn't sure for a Bandage healer).

I've also wanted to to attempt to write a Mage Dueling PvP script which would be hugely based on journal scanning / timing etc & I'm just wondering if STEALTH is superior to EUO in these areas as I haven't really done my research on that yet.

Thx.
Title:
Post by: Crome969 on December 26, 2012, 12:44:14 PM
Title:
Post by: Alpha on December 26, 2012, 02:02:51 PM
Hmm..  thanks for the answers.  The ability to add other languages is nice but not a consideration for me.  In 15 Years I've never played UO with anyone that couldn't at least speak enough english to communicate with me.  It's a nice though if your going to be writing scripts for the masses though.
Title:
Post by: Crome969 on December 26, 2012, 03:11:34 PM
i always only can say -> Never forget that packets are faster communicated then saved in memory;)
Btw my 1000th post .. yey
Title:
Post by: gimlet on December 26, 2012, 04:19:38 PM
Congrats Crome!
Title:
Post by: Boydon on December 31, 2012, 12:52:35 AM
Heh...   Need to check for yellow status (Mortal) also.
yeah iam digging into it

It should be:

Code: [Select]
function IsYellowHits(ObjID:Cardinal):Boolean
Title:
Post by: camotbik on January 01, 2013, 12:07:29 PM
Code: [Select]
Procedure WatchStatus;
begin
  while not dead do
  begin
    if IsPoisoned(self) and not IsYellowHits(self) then DrinkCure;
    if (GetHP(Self) < DrinkHealPotionAt) and (GetHP(Self) > 0) and not Poisoned and not IsYellowHits(self) then DrinkHeal;
    if (Stam < DrinkStamPotionAt) then DrinkStam;
    if IsYellowHits(self) then EatApple;
    if (GetSkillValue('Healing') > 20.0) and (GetHP(Self) < (GetMaxHP(Self))) and (GetHP(Self) > 0) then Bandageself;
    wait(50);
  end;
end;
An example
Title:
Post by: Crome969 on January 03, 2013, 12:48:20 AM
Currently Developing an Event Buff_Debuff Catcher so even states, that not showed directly on Character could be detected.
List of yet supported Buffs\Debuffs can be found here : http://docs.polserver.com/packets/index.php?Packet=0xDF

While those informations popping up i filling an internal Custom Variable (Custom Type ) with the Stats
Code: [Select]
1011 : PlayerBuff.Buff_EnemyOfOne := state; so this or other scripts can read this and handling their ways they want..
Title:
Post by: Crome969 on January 07, 2013, 09:50:21 AM
Updated Entry Post and released latest Version..
Title: Re: [Support] Simple Bandage Healer
Post by: uofreak on November 16, 2018, 07:16:32 AM
Hi all,

I am thinking of using this on a freeshard running RunUO -- also they have a very custom healing system, not sure they even have bandages at this point... will try to replace the then portion with [aid and target self.

Do you think it'd work fine on RunUO and not POL? I guess I'll find out, thanks for the template!
Title: Re: [Support] Simple Bandage Healer
Post by: zchosen on October 09, 2020, 06:43:57 AM
Hello, this is my 1st post, i would like to download this script.

Thank you
Title: Re: [Support] Simple Bandage Healer
Post by: Crisis on October 09, 2020, 02:29:44 PM
Hello, this is my 1st post, i would like to download this script.

Thank you

It has been a very long time since it was post once to be able to download. You need to go to the new member section and post a good intro and your restricted status will be removed allowing you to download scripts.