SRL Archive - OSR Help

How to find Experience Gained


astoria1112000

2011-12-03 22:42:20

I want to know how much exp my script gained

Flight

2011-12-03 22:58:27

Math. Calculate how much exp you get from each…whatever you're doing, then multiple that by how many of them you've...made/gained/killed.

astoria1112000

2011-12-03 23:10:02

Ok i am training combat, How to know I have killed a NPC

DeSnob

2011-12-04 11:05:42

From: astoria1112000
Ok i am training combat, How to know I have killed a NPC


This may seem a but it's not! :) Use PixelShift like this.
Function PixelCheck: Integer;
var
Player: TBox;
begin
Player.X1 := MSCX-10;//this sets the coordinates for the box around the player
Player.X2 := MSCX+10;//
Player.Y1 := MSCY-10;//
Player.Y2 := MSCY+10;//
Result := PixelShift(Player , RandomRange(100, 200)); //This waits a random amount of time and results the amount of pixels that have changed in that time
end;

Function IsFighting: Boolean;
begin
if (PixelCheck > 150) then //this checks if the amount of pixels changed were higher than 150
MarkTime(FightTime) //this resets the fighting watch, FightTime. If pixelcheck is lower than 150, it is never refreshed
else
begin
if (Check = 0) then //Check is a global variable
begin
IncEx(Wait1, 150); //this increases Wait1 by 150
IncEx(Wait2, 200); //this increased Wait 2 by 200
end; //both waits are global variables. they are reset after each fight. these variables are used as double checks.
Inc(Check); //this increases Chance, so it doesn't make a mistake with its detection
end;
Result := (TimeFromMark(FightTime) < RandomRange(Wait1, Wait2)); //this is basically saying "If the amount of time FightTime has been watching is higher than the amount of time we are waiting (wait1 and Wait2), then we are NOT fighting
end;

It's simply used as:
while (InFight) do
Antiban;
Hope that helps a bit. If you need any help understanding, just ask.

Flight

2011-12-04 11:15:48

Your pixelshift is gonna rely heavily on what equipment & weapon you're using as well as what attack animation you're using.

DeSnob

2011-12-04 11:33:13

From: Flight
Your pixelshift is gonna rely heavily on what equipment & weapon you're using as well as what attack animation you're using.


It's mainly for melee, unfortunately. I never made able it compatible with range/mage. Astoria, you can also use SRL's InFight. However, you'll have to include the Fighting.scar file yourself.

legoace

2011-12-05 15:29:39

Combat xp is a bit harder to deal with because you don't want to have to read all your hitsplats and the xp dealt for hits is split into tenths which you can't even see..

Unfortunately GetXP currently does not work (it should find xp values for a skill and return as an integer). I wrote a fix but it has not yet been committed.