Advertisement
Maespark

Orion Self and Cross healing rewrite

Sep 16th, 2024 (edited)
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Set verbose to 1 to see expanded data regarding the running of this script for bug squashing purposes. Set to 0 for normal runtime.
  2. var verbose = 0;
  3.  
  4. //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.
  5. while(!Player.Dead() && Orion.Count("bandage")){
  6.     AutoHealBa(); //This function heals only yourself
  7.     CrossHeal(); //This function heals anybody on your friends list within 2 tiles
  8. }
  9.  
  10. //Begin self healing function
  11. function AutoHealBa(){
  12.     var Timer, Msg = "You finish|failed";
  13.    
  14.     //////////////////verbose error checking///////////////////////
  15.     if(verbose){Orion.Print("Entered AutoHealBa function");}
  16.     ///////////////////////////////////////////////////////////////////
  17.    
  18.     //Check if you are missing hit points
  19.     if(Player.Hits() < Player.MaxHits() - 1){
  20.         //////////////////verbose error checking///////////////////////
  21.         if(verbose){Orion.Print("Entered AutoHealBa Healing function");}
  22.         //////////////////////////////////////////////////////////////////
  23.         Orion.ClearJournal(Msg);
  24.         Orion.BandageSelf();
  25.         Timer = Orion.Now() + 4250;
  26.         while(!Orion.InJournal(Msg) && Orion.Now() < Timer) {
  27.             Orion.Wait(100);
  28.         }
  29.     }
  30.     else{
  31.         Orion.Wait(100);
  32.     }
  33. }
  34.  
  35. //Begin friend healing function
  36. function CrossHeal(){
  37.     var Timer, Msg = "You finish|failed";
  38.     var Buddy = Orion.FindObject(Orion.FindFriend('injured', 2));
  39.     if(Buddy == null){
  40.         Orion.Wait(50); //Increase this value if your computer is lagging.
  41.         return;
  42.     }
  43.    
  44.     //////////////////verbose error checking///////////////////////
  45.     if(verbose){Orion.Print("Entered CrossHeal function");}
  46.     //////////////////////////////////////////////////////////////////
  47.    
  48.     //Update friend's HP immediately before attempting to heal them.
  49.     Orion.GetStatus(Buddy);
  50.     if(Buddy.Hits() < Buddy.MaxHits() - 1){
  51.         //////////////////verbose error checking///////////////////////
  52.         if(verbose){Orion.Print("Entered CrossHeal Healing function. Healing time set to: ");}
  53.         //////////////////////////////////////////////////////////////////
  54.         Orion.ClearJournal(Msg);
  55.         Orion.BandageTarget(Buddy.Serial());
  56.         Timer = Orion.Now() + 4250;
  57.         while(!Orion.InJournal(Msg) && Orion.Now() < Timer) {
  58.             Orion.Wait(100);
  59.         }
  60.     }
  61.     else{
  62.         Orion.Wait(100);
  63.     }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement