SRL Archive - Reflection Help

Memory leak ?


Jakkle

2011-08-13 08:31:13

I'm using this
Function FindYewTreeOffScreen: Boolean;
Var
YewID: Integer;
YewTree: TRSObject;
Begin
R_FindRandoms;
If (Not (LoggedIn)) Then
Exit;
Result := FALSE;
YewID := 1309;
YewTree := R_GetObject(YewID, 1, 30);
If (R_TileOnMM(YewTree.Tile)) Then
Begin
R_WindWalk(YewTree.Tile);
Result := TRUE;
End;
YewTree := NULL_RSOBJECT;
End;

It seems when this function is called upon the cpu usage goes up alot.
Is it a memory leak or is my coding wrong ?

Drakan

2011-08-13 08:33:51

CPU <> Memory. It's probably because of the R_WindWalk. I've gotten a few reports about that causing a lot of CPU usage.

Jakkle

2011-08-13 09:08:03

It happenns with R_walktotile aswell. It seems to be when it can't find the yewtree.tile and even if I add yewtree.tile := null_tile it does it.

Edit: Not sure but I THINK it MIGHT be to do with getting animation. I am using Flights monkfisher and while the player is fishing there is quite high cpu usage

Yago

2011-08-15 13:55:14

From: Jakkle
It happenns with R_walktotile aswell. It seems to be when it can't find the yewtree.tile and even if I add yewtree.tile := null_tile it does it.

Edit: Not sure but I THINK it MIGHT be to do with getting animation. I am using Flights monkfisher and while the player is fishing there is quite high cpu usage


It could also be how the script is coded… I rewrote my smelter recently to be more cpu friendly, and also commited a fix to ref2 where cpu would boost like crazy….

Home

2011-08-15 13:59:21

From: Yago
It could also be how the script is coded… I rewrote my smelter recently to be more cpu friendly, and also commited a fix to ref2 where cpu would boost like crazy….


Please give us some hints about how to make some performance boostings.

~Home

Yago

2011-08-15 15:00:47

From: Home
Please give us some hints about how to make some performance boostings.

~Home


lol not performance boosting, I wish (i do use/recommend a program called game booster)

but I took into consideration loops and wait times and junk. I was calling certain functions like 100x per second unneccesarly… (not literally) Also, I made my script pure reflection(to not use color), therefore you could slide the smart fps bar all the way down to save cpu run more bot/computer…..

I calculated new wait times based on Runescape Ticks which you can find info on in runescape.wikia.com. Therefore calling functions less often without any decline in script performance.

SO instead of checking for animations/changes to your inv every certain amount of time, you can look up how long it takes according to runescape ticks and then check for the changes accordingly

Shuttleu

2011-08-15 15:33:20

From: Yago
lol not performance boosting, I wish (i do use/recommend a program called game booster)

but I took into consideration loops and wait times and junk. I was calling certain functions like 100x per second unneccesarly… (not literally) Also, I made my script pure reflection(to not use color), therefore you could slide the smart fps bar all the way down to save cpu run more bot/computer…..

I calculated new wait times based on Runescape Ticks which you can find info on in runescape.wikia.com. Therefore calling functions less often without any decline in script performance.

SO instead of checking for animations/changes to your inv every certain amount of time, you can look up how long it takes according to runescape ticks and then check for the changes accordingly

i didnt realise the animation times were posted there :confused:

~shut

TomTuff

2011-08-15 15:35:41

From: Shuttleu
i didnt realise the animation times were posted there :confused:

~shut


Not all animation times, but for things like hits while fighting, time taken to cast a spell, and other more common things they have the number of ticks (Time (in seconds) = Ticks * 0.6).