Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Set verbose to 1 to see expanded data regarding the running of this script for bug squashing purposes. Set to 0 for normal runtime.
- var verbose = 0;
- //This while loop controls which healing functions are active. You could probably automate this in a party, or based on whether you're near a friend.
- while(!Player.Dead() && Orion.Count("bandage")){
- AutoHealBa(); //This function heals only yourself
- CrossHeal(); //This function heals anybody on your friends list within 2 tiles
- }
- //Begin self healing function
- function AutoHealBa(){
- var Timer, Msg = "You finish|failed";
- //////////////////verbose error checking///////////////////////
- if(verbose){Orion.Print("Entered AutoHealBa function");}
- ///////////////////////////////////////////////////////////////////
- //Check if you are missing hit points
- if(Player.Hits() < Player.MaxHits() - 1){
- //////////////////verbose error checking///////////////////////
- if(verbose){Orion.Print("Entered AutoHealBa Healing function");}
- //////////////////////////////////////////////////////////////////
- Orion.ClearJournal(Msg);
- Orion.BandageSelf();
- Timer = Orion.Now() + 4250;
- while(!Orion.InJournal(Msg) && Orion.Now() < Timer) {
- Orion.Wait(100);
- }
- }
- else{
- Orion.Wait(100);
- }
- }
- //Begin friend healing function
- function CrossHeal(){
- var Timer, Msg = "You finish|failed";
- var Buddy = Orion.FindObject(Orion.FindFriend('injured', 2));
- if(Buddy == null){
- Orion.Wait(50); //Increase this value if your computer is lagging.
- return;
- }
- //////////////////verbose error checking///////////////////////
- if(verbose){Orion.Print("Entered CrossHeal function");}
- //////////////////////////////////////////////////////////////////
- //Update friend's HP immediately before attempting to heal them.
- Orion.GetStatus(Buddy);
- if(Buddy.Hits() < Buddy.MaxHits() - 1){
- //////////////////verbose error checking///////////////////////
- if(verbose){Orion.Print("Entered CrossHeal Healing function. Healing time set to: ");}
- //////////////////////////////////////////////////////////////////
- Orion.ClearJournal(Msg);
- Orion.BandageTarget(Buddy.Serial());
- Timer = Orion.Now() + 4250;
- while(!Orion.InJournal(Msg) && Orion.Now() < Timer) {
- Orion.Wait(100);
- }
- }
- else{
- Orion.Wait(100);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement