SRL Archive - RS Scripts

Hit Predictor!


weequ

2010-05-10 08:16:59

program HitPredictor;

Const
CombatLevel = 99;//Your combat level(Only matters in pvp)
PvpMode = True;//Pvp? True=Yes, False=No
TextX = 400;//X coordinate for hit text
TextY = 360;//Y coordinate for hit text
PaintTime = 2000;//How long to display hit [milliseconds]


var
XpChars: Integer;
XP1, XP2, Hit, TimeMark: Integer;
a: Extended;
CA: TCanvas;
PA, PB: TPointArray;

procedure PaintText(S: String);
var
Imag, W, H: Integer;
C1: TCanvas;
begin
Imag := CreateBitmapFromText(S, BigChars, 255);
GetBitmapSize(Imag, W, H);
C1 := GetBitmapCanvas(Imag);
CopyCanvas(C1, CA, 0, 0, W, H, TextX, TextY, TextX+W, TextY+H);
FreeBitmap(Imag);
end;


function XpAmouth: Integer;
var
X: Integer;
P: TPointArray;
begin
FindColors(P, 16777215, 460, 58, 505, 66);
X := GetTPABounds(P).X1;
Result := StrToInt(GetNumbers(GetTextAtEx(X, 57, 0, XpChars, False, False, 0, 0, 16777215, 10, True, tr_Digits)));
end;


begin
ClearDebug;
CA := GetClientCanvas;
XpChars := LoadChars2(AppPath + 'Fonts\XpChars\');
WriteLn('Chars Loaded');
if not PvpMode then a := 0.133*4
else
case CombatLevel of
3..19: a := 0.133*4;
20..39: a := 0.136*4;
40..59: a := 0.140*4;
60..79: a := 0.143*4;
80..99: a := 0.146*4;
100..119: a := 0.150*4;
120..138: a := 0.153*4;
end;
WriteLn('We hit '+FloatToStr(1/a)+' * Gained xp');
repeat
repeat
FindColors(PA, 16777215, 470, 60, 509, 65);
until(Length(PA) > 5);
XP1 := XPAmouth;
repeat
FindColors(PB, 16777215, 470, 60, 509, 65);
if GetSystemTime - TimeMark < PaintTime then PaintText(IntToStr(Hit));
Wait(20);
if (Length(PA) > 0) and (Length(PB) > 0) then
if (not TPAInTPA(PA, PB)) then Break;
until(False);
TimeMark := GetSystemTime;
XP2 := XPAmouth;
Hit := Round((XP2-XP1)/a);
if (XP1 > 0) and (XP2 > 0) then WriteLn('We hit: '+IntToStr(Hit));
PaintText(IntToStr(Hit));
until(false);
end.

You also have to download the attachment and extract it to your Fonts folder in scar

Awkwardsaw

2010-05-10 09:11:22

you didnt block out your name in the second picture :p

weequ

2010-05-10 09:15:42

From: Awkwardsaw
you didnt block out your name in the second picture :p
Didn't I? If you mean that urho then I'm not him :P

Kave

2010-05-10 11:58:55

Nice ;)

ShowerThoughts

2010-05-10 12:53:10

Does it works or is it just random?
edit:
nvm, does it gives any advantage?

weequ

2010-05-10 17:27:42

From: Hermen
Does it works or is it just random?
edit:
nvm, does it gives any advantage?

Yes it could be usefull for pking.

Awkwardsaw

2010-05-10 17:51:28

it would be better if you could know how much damage would be hit on you :)

MylesMadness

2010-05-10 18:00:26

How could knowing what your going to hit after its to late to stop the hit help?

Awkwardsaw

2010-05-10 18:41:10

because it would give an aproximate of what the next hit is, so you can eat before he actually hits

ZaSz

2010-05-10 19:12:05

He was saying what YOUR going to hit. Not what your going to get hit.

Awkwardsaw

2010-05-10 19:43:07

From: ZaSz
He was saying what YOUR going to hit. Not what your going to get hit.


oh. just for fun then i guess :p

its still pretty neat

ZaSz

2010-05-10 19:46:21

Actually, you might have been right. His phrasing is really weird.

YoHoJo

2010-05-10 21:13:19

You guys, it's a script that predicts what YOU are going to hit based on the XP counter on runescape. Use it for whatever you want! In fact, it may be useless, but who cares, it's cool, and it works!

g0tp0t

2010-05-10 21:33:51

i remembeer either kbot or rsbot has this. lol. nice. not only for pking but boss killing too ^.^

Awkwardsaw

2010-05-10 22:10:20

From: YoHoJo
You guys, it's a script that predicts what YOU are going to hit based on the XP counter on runescape. Use it for whatever you want! In fact, it may be useless, but who cares, it's cool, and it works!


we all know that, i was just stating that it would be epic if you can predict the oponents hit :D

mormonman

2010-05-10 22:40:08

Predicting what you hit is helpful to pkers because then if they get a good hit with their normal weapon, they can switch really fast to their spec weapon for the k0. In theory at least.

weequ

2010-05-11 00:45:42

From: mormonman
Predicting what you hit is helpful to pkers because then if they get a good hit with their normal weapon, they can switch really fast to their spec weapon for the k0. In theory at least.
Yes

Nose Smasher

2010-05-12 12:46:34

Love it! I remember back in the day if you looked at your str exp in the skill tab (or w/e skill you were training) it would show the exp before the hit and I always wanted to make this script for pking lol.. guess I forgot about it lol.. Great job though, got me a few kills already :p

weequ

2010-05-13 06:22:29

Thanks for feedback (:

Main

2010-05-17 09:56:36

Where does it paint the hits? (I am at school so I can't really try it out).

i luffs yeww

2010-05-17 16:46:30

^ It shows on the picture. :)

ShowerThoughts

2010-05-18 12:32:36

When someone hits you, you also get hitpoints right? couldn't you calculate what the opponent hits by this exp difference?

i luffs yeww

2010-05-18 23:17:16

No, you don't get experience for being hurt.