Yoko

All sides of Injection
It is currently 2024-03-28 10:01:03

All times are UTC+02:00




Post new topic  Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Guild ress
PostPosted: 2013-02-01 02:11:22 
Offline

Joined: 2013-02-01 02:04:58
Posts: 9
Hello, I'm trying to make a script that would check journal for constant messages of "DEAD: Guild Player Name was killed in" and then would try to auto res the player(by ID) and if succeded, write the name of the player and that he is ressurected in guild chat.

I want this to be used in all guild so closest people would ressurect.

But I seem to get problems.

Here is my script so far.

Code:
Sub ResGuild()

UO.Print("Guild Ress - ON")
repeat
UO.DeleteJournal()
wait(1000)
if UO.InJournal('DEAD: Player Name was killed in') then
   repeat
      UO.Exec('usetype 0x0E21')
      UO.waittargetobject('Player ID')
      UO.DeleteJournal()
      uo.getstatus('Player ID')
         if uo.gethp('laststatus') == 0 then         
            wait(500) 
         else
            UO.Say(".gsay "+ uo.getname('laststatus') +" ressurected")
         endif
   until UO.InJournal("Player Name ressurected")
endif
until false
end sub


Top
   
 Post subject: Re: Guild ress
PostPosted: 2013-02-01 10:34:11 
Offline
Expert!
User avatar

Joined: 2005-09-14 15:31:58
Posts: 2152
Location: Latvia
This needs testing whether the journal returns player serial or not, im not sure.

First of all show us the printout of [,showjournal 10] when the message appears

And

Code:
uo.print(UO.JournalSerial(UO.InJournal("DEAD: ")-1))
uo.deletejournal()

_________________
Уроки языка Injection
Основные команды языка Injection
Yoko Injection Code Sweeper
Drw (2009) скрипты
2017 Начал играть на Uorpg.net


Top
   
 Post subject: Re: Guild ress
PostPosted: 2013-02-01 12:31:28 
Offline

Joined: 2013-02-01 02:04:58
Posts: 9
Nmy wrote:
This needs testing whether the journal returns player serial or not, im not sure.

First of all show us the printout of [,showjournal 10] when the message appears

And

Code:
uo.print(UO.JournalSerial(UO.InJournal("DEAD: ")-1))
uo.deletejournal()



It detects the player, and resses, but it doesn't stop healing even when the person is full HP.

Edit:
Now I used this:
Code:
Sub ResGuild()

UO.Print("Guild Ress - ON")
repeat
UO.DeleteJournal()
wait(1000)
if UO.InJournal('DEAD: Ryza Lenke was killed in') then
   repeat
      UO.Exec('usetype 0x0E21')
      UO.waittargetobject('0x0001F906')
      uo.getstatus('0x0001F906')
         if uo.gethp('laststatus') == 0 then         
            wait(500)
         else
            UO.Say(".gsay "+ uo.getname('laststatus') +" ressurected")
           wait(1000)
          endif
   until UO.InJournal("Ryza Lenke")
endif
until false
end sub


Got this(first time I was next to the dead player, it ressed, but no .gsay. Second time I was far away. It didn't repeat itself) :
Image


Top
   
 Post subject: Re: Guild ress
PostPosted: 2013-02-01 16:18:17 
Offline
Expert!
User avatar

Joined: 2005-09-14 15:31:58
Posts: 2152
Location: Latvia
I would not recommend using such autoscript.

it's better if you run to your teammate, drag his hp bar and execute:
Code:
   uo.waittargetobject('laststatus')
   uo.usetype('0x0E21')

_________________
Уроки языка Injection
Основные команды языка Injection
Yoko Injection Code Sweeper
Drw (2009) скрипты
2017 Начал играть на Uorpg.net


Top
   
 Post subject: Re: Guild ress
PostPosted: 2013-02-01 16:31:06 
Offline

Joined: 2013-02-01 02:04:58
Posts: 9
We were using your recommended method for a while, I thought I could improve our ressing with this auto script.

The problem is that it just doesn't read the status bar properly, maybye I should add variables of min/max hp? I really want to make this work


Top
   
 Post subject: Re: Guild ress
PostPosted: 2013-02-01 16:57:54 
Offline
Expert!
User avatar

Joined: 2005-09-14 15:31:58
Posts: 2152
Location: Latvia
Code:
uo.print(str(uo.GetHp('0x0001F906')))

_________________
Уроки языка Injection
Основные команды языка Injection
Yoko Injection Code Sweeper
Drw (2009) скрипты
2017 Начал играть на Uorpg.net


Top
   
 Post subject: Re: Guild ress
PostPosted: 2013-02-03 11:51:18 
Offline
Expert!
User avatar

Joined: 2005-09-14 15:31:58
Posts: 2152
Location: Latvia
or you can just use bandage count as a true/false flag before/after resurrection

_________________
Уроки языка Injection
Основные команды языка Injection
Yoko Injection Code Sweeper
Drw (2009) скрипты
2017 Начал играть на Uorpg.net


Top
   
 Post subject: Re: Guild ress
PostPosted: 2013-02-03 12:01:43 
Offline

Joined: 2013-02-01 02:04:58
Posts: 9
I found a script here:

viewtopic.php?f=20&t=7187&start=160#p89847

but don't understand why this
Code:
If Char<>0 Then
      UO.SetArm('CWeapon')
      UO.WaitTargetObject(Char)
      UO.UseType('0x0E21')
      UO.Print("?anno?aeo!!!")
      wait(500)
         UO.Exec("bandageself")
      wait(500)
      UO.Arm('CWeapon')
   Else
      UO.Print("A?iaa ana ?eau!!!")
   EndIf


in the comment

viewtopic.php?f=20&t=7187&start=160#p89848

was changed to

Code:
 If Char<>0 Then
      UO.SetArm('CWeapon')
      uo.cast('название каста',Char)
      wait(5000) ; пауза для каста заклинания
      UO.WaitTargetObject(Char)
      UO.UseType('0x0E21')
      UO.Print("?anno?aeo!!!")
      wait(500)
      uo.cast('название каста','self')
      wait(500)
      UO.Arm('CWeapon')
   Else


Why would there be a cast for both char and self? And bandage use for self. This is a friend ress script ^^


Top
   
 Post subject: Re: Guild ress
PostPosted: 2013-02-03 15:07:20 
Offline
Expert!
User avatar

Joined: 2005-09-14 15:31:58
Posts: 2152
Location: Latvia
Code:
 If Char<>0 Then
      UO.SetArm('CWeapon')
      uo.cast('название каста',Char)
      wait(5000) ; пауза для каста заклинания
      UO.WaitTargetObject(Char)
      UO.UseType('0x0E21')
      UO.Print("?anno?aeo!!!")
      wait(500)
      uo.cast('название каста','self')
      wait(500)
      UO.Arm('CWeapon')
   Else


That doesn't look right. Maybe it's resurrection magic and bandages, both at the same time. or resurrection and heal. the second cast might be self buff

_________________
Уроки языка Injection
Основные команды языка Injection
Yoko Injection Code Sweeper
Drw (2009) скрипты
2017 Начал играть на Uorpg.net


Top
   
 Post subject: Re: Guild ress
PostPosted: 2013-04-01 15:42:14 
Offline

Joined: 2012-09-10 20:18:54
Posts: 14
Why are you using 'laststatus' when you can use bandage on the player's id!

I would go for:

Code:
While UO.GetHP('Player ID')<UO.GetMaxHP('PlayerID') And UO.Count('0x0E21')>0 And UO.GetDistance('Player ID')<=??? ; change ??? for the maximum healing distance! And to stop healing, just get away from the player ;) ;
UO.WaitTargetObject('Player ID)
UO.UseType('0x0E21')
Wait(1000) ; Or as much as you think is better ;
WEnd


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 10 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited