Forum in READ ONLY mode! All questions and discussions on Discord official server, invite link: https://discord.gg/VxsGzJ7
MaxHits sometimes is incorrect
MaxHits sometimes is incorrect
Debugging a healing script that sometimes doesn't heal when it should, or heals when it shouldn't. At those times, MaxHits returns something really low like 25 when it should be returning 137 (example.)
1 in 100
1 in 100
Re: MaxHits sometimes is incorrect
maxhits of your char or another?
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
Re: MaxHits sometimes is incorrect
Must be another, it's a pretty common issue due to ultima protocol.Vizit0r wrote:maxhits of your char or another?
Re: MaxHits sometimes is incorrect
for another chars HP comes at % from 100% (maxhp).
For self - thats real hp from real maxhp.
Maybe thats your problem?
For self - thats real hp from real maxhp.
Maybe thats your problem?
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
Re: MaxHits sometimes is incorrect
It's always for another character, not self.
Re: MaxHits sometimes is incorrect
was using this formula for getting % for both self and other
Code: Select all
var _maxhits = MaxHits;
var _hits = Hits;
if (_maxhits > 0 && _hits > 0)
return (_hits * 100 / _maxhits);
else
return 0;
Re: MaxHits sometimes is incorrect
MaxHits = 100 (%)
return (_hits * 100 / _maxhits); = hits * 100 / 100 = hits.
looks strange.
return (_hits * 100 / _maxhits); = hits * 100 / 100 = hits.
looks strange.
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
Re: MaxHits sometimes is incorrect
strange. but i dont know, why server send you 25 as 100%.
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
Re: MaxHits sometimes is incorrect
Gone post my script to see if anyone wants to try and reproduce.
Getting incorrect health readings from pets.
Script: http://pastebin.com/Y0NKNHnC
Using: http://sourceforge.net/projects/scriptsdk/files
EDIT: NEW INFORMATION!
I disconnected the profile, reconnected, and script is working!!!
Getting correct readings now!
Stopped script, restarted script. Still working.
It seems reconnect fixed it, but why =(
Getting incorrect health readings from pets.
Script: http://pastebin.com/Y0NKNHnC
Using: http://sourceforge.net/projects/scriptsdk/files
EDIT: NEW INFORMATION!
I disconnected the profile, reconnected, and script is working!!!
Getting correct readings now!
Stopped script, restarted script. Still working.
It seems reconnect fixed it, but why =(
Re: MaxHits sometimes is incorrect
hard to reproduce?
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".