Shard is currently offline.



Take the Tour | Site Map

It is currently Tue Mar 19, 2019 8:41 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: easyuo count dmg
PostPosted: Sat Aug 04, 2018 6:43 am 
Offline
Script Kiddie
Script Kiddie

Joined: 04/14/2017 10:34
Posts: 9
Hi guys, I posted as well on section "Debugging Scripts" however no one answer there;) I hope here will be more visible

I need your help as I'm thinking about write a script which count hp damage which we gave to monster.
The main reason of script will be just own analize to check which weapon is better to train a skill.
However I had faced a problem.
Sometimes when we kill a monster damage given by us is bigger than his hp and it isn't counted.
Second issue shows when monster is far from us, I guess then system use old #enemyhits. It look as follow:
in fact we still didn't touch the monster (it still has all hp bar full) but script already take out old #enemyhit from new one so it looks like 800dmg from 4000.

Code:
  1.  
  2. set %showenemyhealth #true
  3. set %resultinTotal 0
  4. set %color 80
  5. set %color2 50
  6. set %hour ( #scnt + 3600 )
  7.  
  8. set %fullhpEnemy 4000
  9. set %tempHPmob
  10. set #lpc 100
  11. set %valueDMG 0
  12.  
  13.  
  14. if ( #enemyhits <> N/A && #enemyhits <> %tempHPmob ) && ( %showenemyhealth && #EnemyID = %ISITsameMonster )
  15.   {
  16.     if %tempHPmob <= #enemyhits
  17.      set %valueDMG %tempHPmob
  18.    else
  19.    {
  20.     set %valueDMG %tempHPmob - #enemyhits
  21.    }
  22.   set %resultinTotal ( %resultinTotal + %valueDMG )
  23.   event ExMsg #charid 3 %color %valueDMG                                   ; show us DMG what we give to enemy
  24.   event ExMsg #enemyid 3 %color2 #enemyhits / %fullHPenemy         ; show us HP of monster like for e.g. 400 / 4000
  25.  
  26.   set %tempHPmob #enemyhits                                                    ; save health point of monster to compare it later
  27.   }
  28. if #enemyid <> %ISITsameMonster                                               ; well i'm not sure about it but i try to be sure than i still cheked same monster if not change him...
  29.    set %ISITsameMonster #enemyid
  30. until ( %hour <= #scnt )                                                             ; after one hour should finish measurement
  31. display %resultinTotal
  32.  


Top
  Profile 
 Post subject: Re: easyuo count dmg
PostPosted: Sat Aug 04, 2018 2:09 pm 
Offline
Legendary Scripter
Legendary Scripter
User avatar

Joined: 07/10/2004 17:11
Posts: 2304

Isn't #enemyHits based on 100% of it's health. So if you do 20% damage to it, it says 80% health left right? So you'd need to calculate the percentage of the monsters real health that is... It's pretty easy to calculate the health of a monster, so you'd set the #findtype of the monster to a variable, and set that to the hit points of that monster, then figure it out based on the percentage of it's health that is left. Which should be a very easy equation. You can quickly get monster #enemyHits also for the monster that you're fighting, so you can have a near real time amount of damage you're doing to the monster. Calculating it per hit will be a bit more difficult, unless you're the only person fighting the monster. Just check the monsters health every 1 second or so, or split in halt, twice a second, and you'll always be checking it's health between hits, because the fastest you can hit a monster is every 1.25 seconds. That might be a fun script to have. Interesting to see the real time damage you're doing to a monster. But it's always going to be a tiny bit off, because you'll lose a bit in the conversion from the percentage. But it'll be close. Interesting to see. Good idea. I could probly easily add this to my pvm dexer for a bit of fun info to have during fighting monsters without increasing the amount of time the script takes to do other tasks. ;)

_________________
Image


Top
  ProfileShow poster's scripts in the public script library 
 Post subject: Re: easyuo count dmg
PostPosted: Sat Aug 04, 2018 10:11 pm 
Offline
Administrator
Administrator
User avatar

Joined: 08/12/2003 07:28
Posts: 19006
Location: Switzerland

Only keep in mind that there are monsters with a large HP pool. So a hit may yield a change less than 1% and therefore by this calculation 0 dmg.
But if you hit a high hp monster on 81% which is in reality on 80.50001% with a weapon and it drops to 80.49999 and therefore 80% this single hit may be calculated to a huuuge DMG even if it was only 1 dmg.
Basically the higher the factor from damage to HP the less accurate it will be.

_________________
EUO Member and postwhore since: 19th Dezember, 2002; Loosing on freeshard Alexandria since: 5th January, 2005
Searches cure for cancer since: 17th November, 2003 on GRID.org & Worldcommunitygrid.org
Made scripts for Project 'Programmers for Alexandria' worth 50$
Image
Quote "mmorning": Where would theses boards be if Orn didn't miss all the sarcasm. Man its great having him here :)
Quote "author-unknown": Good idea. I gotta start doing that too. You're a trendsetter Orn. :)
Quote "dreyfus": #true is always #true


Top
  ProfileShow poster's scripts in the public script library 
 Post subject: Re: easyuo count dmg
PostPosted: Mon Aug 06, 2018 9:12 am 
Offline
Adept Scripter
Adept Scripter

Joined: 04/14/2007 16:18
Posts: 144

Groups:
To get the damage done by your weapon hits, you would need to cycle on DamageNumbers_Gump (which is ignored by default, so there is extra setup in a script to access these gumps).
See this post for more information on how to get to this gump:
http://209.128.220.2/forum/viewtopic.php?f=2&t=51112&start=90#p420610

There is also the healing rate (natural HP regen, cast spells to heal, pet-eating-refresh by Paroxysmus, etc.) to consider if you are trying to calculate how many hit points a creature has. Paragon creatures and many named ML creatures will take a lot of damage when showing 1 HP in the animal lore display before finally dying.
Gaderian


Top
  ProfileShow poster's scripts in the public script library 
 Post subject: Re: easyuo count dmg
PostPosted: Mon Aug 06, 2018 8:33 pm 
Offline
Legendary Scripter
Legendary Scripter
User avatar

Joined: 07/10/2004 17:11
Posts: 2304

The only reason technically I can see for wanting to see monster damage, is to use Word of Death on them. So a percentage would work fine. And you could easily calculate how much damage you've done per hit on a monster, by using a calculation that calcs the percent, and uses the monsters hits, and takes into account your average damage per hit. Then you calc out the damage you've done based on the damage you have done total off the %, and the monsters hits and current hit %. Shouldn't be that difficult. And once the creature hits 20% of it's hits, or whatever it is for Word of Death, off you go with that. Word of Death until dead, rinse repeat. It won't ever be 100% accurate, but it will be "close enough." And give you a good idea of how much damage you're doing per hit.

_________________
Image


Top
  ProfileShow poster's scripts in the public script library 
 Post subject: Re: easyuo count dmg
PostPosted: Wed Aug 08, 2018 12:23 am 
Offline
Script Kiddie
Script Kiddie

Joined: 04/14/2017 10:34
Posts: 9
Well Gaderian I didn't find something what can help me, maybe this:
Code:
  1. IgnoreCont target_status_gump
  2. IgnoreCont DamageNumbers_Gump

it could help me but still i don't know how to use it to be sure that it's working.

When i updated my easyuo to 1.6.0.330
i found #CONTHP which give me hp of monster propably in %. I don't know yet, just start to test it however
if I use
Code:

it won't give me any result all the time i must grab status bar of monster to get some information about monster in #CONTHP
However thank you everyone for answer


Top
  Profile 
 Post subject: Re: easyuo count dmg
PostPosted: Thu Aug 09, 2018 12:50 pm 
Offline
Adept Scripter
Adept Scripter

Joined: 04/14/2007 16:18
Posts: 144

Groups:
Dexu89,
In order to use the link above you need a statement ignorecont reset, then you may issue a series of statements to ignore select gumps you do not want to see. Issuing the ignorecont damagenumbers_gump makes those gumps invisible to your script. The opposite of what you want.

Later I I’ll try a short functional example.
To get a creature’s percent health you would want to use the event macro for bringing up the health bar for that creature. I have an example of that I can share later when I am home.

Gaderian


Top
  ProfileShow poster's scripts in the public script library 
 Post subject: Re: easyuo count dmg
PostPosted: Thu Aug 09, 2018 5:18 pm 
Offline
Legendary Scripter
Legendary Scripter
User avatar

Joined: 07/10/2004 17:11
Posts: 2304

The damage numbers were ignored by default for a very specific reason. Taking them off ignore will make anything you do while fighting spawn that requires interaction with gumps difficult. That's why they were ignored. The way I described is probly your best option. Unless ALL you are doing is trying to find damage by the damage numbers. Then by all means. But if you plan to make this some kind of script that does that, removing the damage numbers gump from ignore is not going to work well for you at all.

_________________
Image


Top
  ProfileShow poster's scripts in the public script library 
 Post subject: Re: easyuo count dmg
PostPosted: Thu Aug 23, 2018 2:36 pm 
Offline
Script Kiddie
Script Kiddie

Joined: 04/14/2017 10:34
Posts: 9
yea guys you have right i think about reset this two gumps however i write about ignore them - wrong. My mistake sorry, Anyway still dont know how to use it.
@Gaderian if you have your example i will be really appreciate.
@scripty do you have any idea how to solve my problem of this script on older easyuo without this gumps? or anyone else?


Top
  Profile 
 Post subject: Re: easyuo count dmg
PostPosted: Fri Aug 31, 2018 11:14 am 
Offline
Script Kiddie
Script Kiddie

Joined: 04/14/2017 10:34
Posts: 9
one more question about something else
is it any chance to send by sub parametr operation ?
mean something like this

Code:
  1.  
  2. set %var1 #charposx - 16
  3. set %var2 50
  4. gosub dosomething %var1 => %var2
  5.  
  6. sub dosomething
  7.                   ;here can it be sended by %2 ?
  8.                   ;mean operation like < , > , <= , => or =
  9.    {
  10.    dosomething...
  11.    ....
  12.    ....
  13.    }
  14.  


i need some good sub to boat control my is litte poor


Top
  Profile 
 Post subject: Re: easyuo count dmg
PostPosted: Sat Sep 01, 2018 8:01 am 
Offline
Adept Scripter
Adept Scripter

Joined: 04/14/2007 16:18
Posts: 144

Groups:
Yes, you can send operators in place of parameters.

Here is an example from the PSL demonstrating how it can be accomplished. (This is Quintok/Raziel's code - not mine.) You can find it at this link:
http://www.easyuo.com/forum/viewtopic.php?p=38078#38078

Gaderian


Top
  ProfileShow poster's scripts in the public script library 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: Google [Bot] and 12 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 Group
Hosted by CalWeb Internet Services, Inc.