Author Topic: Champ Support character  (Read 2293 times)

0 Members and 1 Guest are viewing this topic.

Offline camotbikTopic starter

  • Sr. Member
  • *
  • Posts: 349
  • Activity:
    0%
  • Reputation Power: 3
  • camotbik has no influence.
  • Gender: Male
  • Hello! I'm a UO addict.
  • Respect: +38
  • Referrals: 0
    • View Profile
Champ Support character
« on: December 25, 2009, 04:17:40 PM »
0
Code: [Select]
;==================================
; Script Name: Champ Supporter.
; Author: CAMOTbIK
; Version: 0.5 Beta
; Client Tested with: 6.0.14.3
; EUO version tested with: 1.58
; Revision Date: 29.12.2009
; Public Release:
; Purpose: As a support character you ressurect and heal your friends.
; Pick up droped power scrolls and pick up gold wich will be stored in your beetle.
;==================================
set %ghost JS_KS_ZU_KV  ; JS-HUMAN_WOMAN,KS-HUMAN_MALE,ZU-ELF_MAN,KV-ELF_WOMAN
set %alive HS_IS_XU_AV  ; HS-HUMAN_WOMAN,IS-HUMAN_MALE,XU-ELF_MAN,AV-ELF_WOMAN
set %friends XXXX_XXXX_XXXX_XXXX ; Friends
set %ps EWH
set %bandages ZLF
set %beetletype ZGB
set %timer_hiding #sCnt
set %timer_healing #sCnt
set %timer_ressurecting #sCnt
ignoreitem #CHARID

repeat
gosub check_alive
gosub check_dead
gosub grab_gold
gosub grab_ps
gosub grab_bandages
gosub hide
  while #charghost = yes
     wait 0
until #charghost = yes

sub check_alive
 finditem %alive G_1
  if #FINDCNT > 0 && #FINDID in %friends
   {
    if #sCnt < %timer_already_healed && #FINDID in %already_healed
    return
    set #LTARGETID #FINDID
     finditem %bandages C_ , #BACKPACKID ; bandages
      if #FINDCNT > 0
       {
       set #LTARGETKIND 1
        set #lobjectid #findid
         event macro 17 0
         target 5s
          event macro 22 0
           gosub hide
            set %timer_healing ( #sCnt + 10 )
             set %_jindex #jindex
              set %return #false
     repeat
      if #sCnt > %timer_healing
       {
        set %timer_healing ( #sCnt + 10 )
         set %return #true
       }
      if #jindex >= %_jindex
       {
        scanjournal %_jindex
         if barely in #journal || finish in #journal || reach in #journal
          {
          set %return #true
           set %timer_healing ( #sCnt + 10 )
          }
          if being in #journal
          {
          set %already_healed #ltargetid
          set %timer_already_healed ( #sCnt + 40 )
          }
       set %_jindex %_jindex + 1
       }
      wait 0
     until %return #true
       }
      else
      {
       msg $
        msg /support character is out of bandages!!!$
         msg /drop some bandages near #charname who is standing #CHARPOSX #CHARPOSY $
          wait 1s
      }
     }
return

sub check_dead
 finditem %ghost G_1
  if #FINDCNT > 0 && #FINDID in %friends
   {
    if #sCnt < %timer_already_ressurected && #FINDID in %already_ressurected
    return
    set #LTARGETID #FINDID
     finditem %bandages C_ , #BACKPACKID ; bandages
      if #FINDCNT > 0
       {
        set #LTARGETKIND 1
         set #lobjectid #findid
          event macro 17 0
           target 5s
            event macro 22 0
             gosub hide
           set %timer_ressurect ( #sCnt + 10 )
           set %_jindex #jindex
           set %return #false
           repeat
           if #sCnt > %timer_ressurect
           {
            set %timer_ressurect ( #sCnt + 10 )
             set %return #true
             }
             if #jindex >= %_jindex
              {
               scanjournal %_jindex
                if unable in #journal || reach in #journal || being in #journal
                 {
                   set %return #true
                 }
                 if able in #journal
                 {
                 set %already_ressurected #ltargetid
                 set %timer_already_ressurected ( #sCnt + 30 )
                 }
              set %_jindex %_jindex + 1
              }
              wait 0
            until %return #true
        }
      else
      {
       msg $
        msg /support character is out of bandages!!!$
         msg /drop some bandages near #charname who is standing #CHARPOSX #CHARPOSY $
          wait 1s
      }
     }
return

sub grab_gold
 finditem POF G_2
  if #FINDCNT > 0
   {
    set %gold #FINDID
     set %stack #findstack
      set #lobjectid #CHARID
       event macro 17
        wait 10
        finditem %beetletype G_1
         if #FINDCNT > 0
          {
           set %beetle #FINDID
            exevent drag %gold %stack
             wait 10
              exevent dropc %beetle
               wait 20
                set #lobjectid %beetle
                 event macro 17
          }
    }
return

sub grab_ps
  finditem %ps G_2
   if #FINDCNT > 0
    {
     exevent drag #FINDID #FINDSTACK
      wait 10
       exevent dropc #BACKPACKID
        wait 10
    }
return

sub grab_bandages
  finditem %bandages G_2
   if #FINDCNT > 0
    {
     exevent drag #FINDID #FINDSTACK
      wait 10
       exevent dropc #BACKPACKID
        wait 10
    }
return

sub hide
 if H in #charStatus
   return
 if #sCnt > %timer_hiding
  {
   event macro 13 21
    set  %timer_hiding ( #sCnt + 10 )
  }
return
« Last Edit: December 28, 2009, 06:51:16 PM by camotbik »
What you witness -- is whatver..
uogamers hybrid.

Offline camotbikTopic starter

  • Sr. Member
  • *
  • Posts: 349
  • Activity:
    0%
  • Reputation Power: 3
  • camotbik has no influence.
  • Gender: Male
  • Hello! I'm a UO addict.
  • Respect: +38
  • Referrals: 0
    • View Profile
Re: Champ Support character
« Reply #1 on: December 26, 2009, 08:27:49 AM »
0
If you want to look for more than one friend, change this line:
Code: [Select]
 if #FINDCNT > 0 && #FINDID = %friends ; <--

To this:

Code: [Select]
 if #FINDCNT > 0 && #FINDID in %friends ; <--

For hit points, you have to do pixel scanning of their gump or setup a method of communication between scripts (i.e. guild chat/party chat).  There's no direct way to ready hit points otherwise.
« Last Edit: December 26, 2009, 10:42:07 AM by TrailMyx »
What you witness -- is whatver..
uogamers hybrid.

Offline camotbikTopic starter

  • Sr. Member
  • *
  • Posts: 349
  • Activity:
    0%
  • Reputation Power: 3
  • camotbik has no influence.
  • Gender: Male
  • Hello! I'm a UO addict.
  • Respect: +38
  • Referrals: 0
    • View Profile
Re: Champ Support character
« Reply #2 on: December 28, 2009, 05:21:59 PM »
0
v 0.4 beta
* Aded Hiding Timer
* Aded some journal scaning with time outs.

V 0.5 beta
* Aded Ressurected/Fully healed characters timers.
* Cleaned the code.

Looking for some testers.
What you witness -- is whatver..
uogamers hybrid.

Tags: