SRL Archive - MSI Bugs

MSI Alcher counting off


Coh3n

2011-06-03 23:44:26

Just noticed now that the counting for amount of spells is off for the alcher. I think it's because it's clicking a little too fast, and it's counting each click as an alch rather than the alchs themselves. I think the animation needs to be redone (I still have to properly make a tutorial on the new animation system, but in the meantime you can look at the chopping animation as an example).

I'll get to it eventually, but if someone would like to have a go at it that would be great. :)

Cheers,
Cohen

LolL

2011-06-04 00:35:31

Why even use clicks or animations to count off? Just store the number of nature runes when the script begins. natureRunesOnStart - natureRunesNow = howManyAlchs??

Coh3n

2011-06-04 00:42:25

Good point. :p I'd hate to decrease the speed of the alcher anyway. Right now its really fast. We already calculate how many spells can be cast based on the runes found, so passing the variable shouldn't be difficult.

Can't believe I didn't think of that!

footballjds

2011-06-04 00:46:28

From: Coh3n
Good point. :p I'd hate to decrease the speed of the alcher anyway. Right now its really fast. We already calculate how many spells can be cast based on the runes found, so passing the variable shouldn't be difficult.

Can't believe I didn't think of that!


or:

CurrentEXP-StartEXP/65 := alchs
:p

Coh3n

2011-06-04 08:45:21

Yeah. :p

I wrote a new function for this, and so far it's working perfectly. I'm alching well over 1k/hour (I checked the actual amount with the script amount), which is quite a bit of magic experience. I'm working on fixing the random detection issue with the alcher, so once I solve that I'll commit both fixes. Here's the function if anyone is curious:

(*
MSI_CastsDone
~~~~~~~~~~~~~

.. code-block:: pascal

procedure MSI_CastsDone();

Calculates the amount of casts the player has done for each spell and adds the
difference from the previous amount to the progress report/stats variables.

.. note::

| Author: Coh3n
| Last Updated: 04 June 2011 by Coh3n

Example:

.. code-block:: pascal

MSI_CastsDone();
*)
procedure MSI_CastsDone();
var
i, j, castsDone, castsDiff: integer;
castsLeft: TIntegerArray;
begin
if (not loggedIn) then
exit;

castsLeft := MSI_CalculateCasts();
for i := 0 to high(castsLeft) do
with MSI_Players[currentPlayer].Scripts[currentScript] do
begin
if (castsLeft[i] <= 0) then
continue;

castsDone := (maxCasts[i] - castsLeft[i]);
MSI_SubDebug('Number of casts[' + intToStr(i) + ']: ' + intToStr(castsDone));

with MSI_Players[currentPlayer].ReportInfo do
begin
castsDiff := (castsDone - Casts[currentScript][MSI_CurrentSpell]);
incEx(Casts[currentScript][MSI_CurrentSpell], castsDiff);
MSI_AddToProggy(PROG_ADD_CASTS, -1, -1, castsDiff);
stats_IncVariable(MSI_Spells[Spells[MSI_CurrentSpell]].StatsName, castsDiff);
end;

MSI_AddToProggy(PROG_ADD_EXP, -1, -1, (Round(MSI_Spells[Spells[MSI_CurrentSpell]].Experience * castsDiff)));
MSI_SubDebug('Casts left[' + intToStr(i) + ']: ' + intToStr(castsLeft[i]));
end;
end;