SRL Archive - SRL Archives

[REJECTED] FindFastFight


Sir R. M8gic1an

2008-05-15 05:56:41

hey guys, this has been talked a lot about before, but i don't think anyone actually posted it here. it'll get the black color of Hp Missing from the top of the HP meter.


{*******************************************************************************
function FindFastFight: Boolean;
by: Rasta Magician
Description: Results True if in Fight, Gets HP from MiniMap
*******************************************************************************}
Function FindFastFight:boolean;
var xf, yf:integer;
begin
if (FindColor(xf, yf, 65280, 217, 129, 297, 209)) then
begin
if CheckHpFirst then
begin
if GetColor(706, 15) = 1911856 then
begin
Result := True;
WriteLn('******** FOUND FIGHTING RANDOM ********');
WriteFileString(TheFile, '******** FOUND FIGHTING RANDOM ********' +
Chr(13))
TakeScreen('Found Fight');
Fights := Fights + 1;
end;

end else
begin
WriteLn('******** FOUND FIGHTING RANDOM ********');
WriteFileString(TheFile, '******** FOUND FIGHTING RANDOM ********' +
Chr(13))
Result := True;
TakeScreen('Found Fight');
Fights := Fights + 1;
end;
end;
end;

edit: tested and changed the GetColor, only one small prob. only detects that you've lost hp after losing 2-4 hp depending on your level.

the best thing i can think of is making a combination of both. if FindFastFight returns true there's no need to check GameTabs. if it returns false but there is a fight around us, we could always use the tabs to make sure.


~RM

Harry

2008-05-15 06:46:39

GetMMLevels(); ;) Just do a check at the beginning of the script and if not GetMMLevels('hitpoints'..parameters) >= HPLevelOfChar then RunAway :D

Sir R. M8gic1an

2008-05-15 07:31:43

Just do a check at the beginning of the script: i'm not looking for a script, i'm looking for a faster FindFight function in srl ;)

oh and btw Devs:

Const
SRLVersionNumber = 15;

~RM

Wizzup?

2008-05-15 07:37:22

From: Rasta Magician
hey guys, this has been talked a lot about before, but i don't think anyone actually posted it here. it'll get the black color of Hp Missing from the top of the HP meter.


{*******************************************************************************
function FindFastFight: Boolean;
by: Rasta Magician
Description: Results True if in Fight, Gets HP from MiniMap
*******************************************************************************}
Function FindFastFight:boolean;
var xf, yf:integer;
begin
if (FindColor(xf, yf, 65280, 217, 129, 297, 209)) then
begin
if CheckHpFirst then
begin
if GetColor(706, 15) = 1911856 then
begin
Result := True;
WriteLn('******** FOUND FIGHTING RANDOM ********');
WriteFileString(TheFile, '******** FOUND FIGHTING RANDOM ********' +
Chr(13))
TakeScreen('Found Fight');
Fights := Fights + 1;
end;

end else
begin
WriteLn('******** FOUND FIGHTING RANDOM ********');
WriteFileString(TheFile, '******** FOUND FIGHTING RANDOM ********' +
Chr(13))
Result := True;
TakeScreen('Found Fight');
Fights := Fights + 1;
end;
end;
end;

edit: tested and changed the GetColor, only one small prob. only detects that you've lost hp after losing 2-4 hp depending on your level.

the best thing i can think of is making a combination of both. if FindFastFight returns true there's no need to check GameTabs. if it returns false but there is a fight around us, we could always use the tabs to make sure.


~RM


We only check gametab's once. (HPPercent does, and then set's the level value in the player array.) After that 'one Gametab check' FindFight uses the Minimap values, until a new player is found where the players[].levels[] is not set for hp. :)

Sir R. M8gic1an

2008-05-15 07:44:25

oh :$ didn't find CheckHpFirst in AntiRandoms.scar so i assumed it was just a constant >.>

oh well :p

what about this? :p
Const
SRLVersionNumber = 15;

Thanks for answering,
~RM

Bobarkinator

2008-05-15 08:17:37

From: Rasta Magician
oh :$ didn't find CheckHpFirst in AntiRandoms.scar so i assumed it was just a constant >.>

oh well :p

what about this? :p
Const
SRLVersionNumber = 15;

Thanks for answering,
~RM


I'm pretty sure that I told Wizzup that he would forget to change the number again :rolleyes:

Harry

2008-05-15 20:24:57

I already told him of the RevNumber a while ago ^^. http://www.villavu.com/forum/showthread.php?t=29362