SRL Archive - RS3 Outdated / Broken Scripts

xp calculator


jhildy

2007-07-05 22:29:29

//this will calculate how many of something you will need to do
//to reach a certain level
//level is the level you want to reach
//xp is your current xp
//xpfrom is how much xp you get from doing something
//for example chopping a yew tree gives 175 xp so xpfrom would be 175
//this returns as an extended value not an integer(eg 69.5)
function calculatelevel(level,xp: integer; xpfrom: extended): extended;
var l: array [1..99] of integer;
begin
l[1]:=0;
l[2]:=83;
l[3]:=174;
l[4]:=276;
l[5]:=388;
l[6]:=512;
l[7]:=650;
l[8]:=801;
l[9]:=969;
l[10]:=1154;
l[11]:=1358;
l[12]:=1584;
l[13]:=1833;
l[14]:=2107;
l[15]:=2411;
l[16]:=2746;
l[17]:=3115;
l[18]:=3523;
l[19]:=3973;
l[20]:=4470;
l[21]:=5018;
l[22]:=5624;
l[23]:=6291;
l[24]:=7208;
l[25]:=7842;
l[26]:=8740;
l[27]:=9730;
l[28]:=10824;
l[29]:=12031;
l[30]:=13363;
l[31]:=14833;
l[32]:=16456;
l[33]:=18247;
l[34]:=20224;
l[35]:=22406;
l[36]:=24815;
l[37]:=27473;
l[38]:=30408;
l[39]:=33648;
l[40]:=37224;
l[41]:=41171;
l[42]:=45529;
l[43]:=50339;
l[44]:=55649;
l[45]:=61512;
l[46]:=67983;
l[47]:=75127;
l[48]:=83014;
l[49]:=91721;
l[50]:=101333;
l[51]:=111945;
l[52]:=123660;
l[53]:=136594;
l[54]:=150872;
l[55]:=166636;
l[56]:=184040;
l[57]:=203254;
l[58]:=224466;
l[59]:=247886;
l[60]:=273742;
l[61]:=302288;
l[62]:=333804;
l[63]:=368500;
l[64]:=407015;
l[65]:=449428;
l[66]:=496254;
l[67]:=547953;
l[68]:=605032;
l[69]:=668051;
l[70]:=737627;
l[71]:=814445;
l[72]:=899257;
l[73]:=992895;
l[74]:=1096278;
l[75]:=1210421;
l[76]:=1336443;
l[77]:=1475581;
l[78]:=1629200;
l[79]:=1798808;
l[80]:=1986068;
l[81]:=2192818;
l[82]:=2421087;
l[83]:=2673114;
l[84]:=2951373;
l[85]:=3258594;
l[86]:=3597792;
l[87]:=3972294;
l[88]:=4385776;
l[89]:=4842295;
l[90]:=5346332;
l[91]:=5902831;
l[92]:=6517253;
l[93]:=7195629;
l[94]:=7944614;
l[95]:=8771558;
l[96]:=9684577;
l[97]:=10692629;
l[98]:=11805606;
l[99]:=13034431;
result:= ((l[level] - xp) / xpfrom)
end;

explanation is in there. i know its simple but who else has posted one? this could be useful for proggies or something.

Santa_Clause

2007-07-06 05:53:30

l[80]:=11986068;


There's an extra number. Not sure which one though.

jhildy

2007-07-06 09:17:27

oh whoops thanks and santa check out my new form. i kinda took your idea for background changing but i use the actual colors.

j-g

2007-07-07 00:53:51

Failed when compiling
[Error] (112:1): Unexpected end of file

jhildy

2007-07-07 12:53:50

lol u have to use it u cant just paste this into scar.


use it like i explainied like put this in scar and then in yopur main loop put like
writeln(floattostr(calculatelevel(40,6000,20))+'more');

Santa_Clause

2007-07-07 21:03:42

I saw your Thieving form and it looks pretty good. I realised that you took my idea ;) Widget did something like that as well with preset colours. Added on MSN.