SRL Archive - SRL Archives

[Magic] New RuneTek 5 functions


Bad Processor

2009-09-02 22:42:22

Hey all, just thaught I'd contribute since RT5 has been released.

1st procedure: SpellbookMode. You can now choose what areas of magic to show. Use all true in the parameters to set to default.

{*******************************************************************************
procedure SpellbookMode(Combat, Teleport, Misc, Skill: Boolean);
By: Bad Processor
Description: Makes the spellbook show only specified spells.
*******************************************************************************}

procedure SpellbookMode(Combat, Teleport, Misc, Skill: Boolean);
var OldGT: Integer;
begin
OldGT := GetCurrentTab;
if(not GetCurrentTab = 8) then GameTab(8);
if(Combat = not (GetColor(591, 441) = 16777215)) then begin
MouseBox(584, 442, 600, 457, 1);
end;
if(Teleport = not (GetColor(611, 441) = 16777215)) then begin
MouseBox(606, 443, 621, 457, 1);
end;
if(Misc = not (GetColor(634, 441) = 16777215)) then begin
MouseBox(627, 443, 642, 457, 1);
end;
if(Skill = not (GetColor(655, 441) = 16777215)) then begin
MouseBox(649, 442, 662, 457, 1);
end;
if(not Combat) and (not Skill) and (not Misc) and (not Teleport) then
WriteLn('Warning: Script set all spell modes to off, no spells visible.');
GameTab(OldGT);
end;

2nd function: AllSpellsVisible. Returns whether all spells are visible or not.


{*******************************************************************************
procedure SpellbookMode(Combat, Teleport, Misc, Skill: Boolean);
By: Bad Processor
Description: Makes the spellbook show only specified spells.
*******************************************************************************}

function AllSpellsVisible: Boolean;
var
OldGT: Integer;
Temp: Boolean;
begin
OldGT := GetCurrentTab;
if(not GetCurrentTab = 8) then GameTab(8);
Temp:= GetColor(730, 212) = 1712423;
GameTab(OldGT);
Result := Temp;
end;

Enjoy.

– Bad Processor

Rich

2009-09-02 22:56:02

These and more posted here. The first could be made much simpler. Look at mine in the thread I linked to.

Richard

Bad Processor

2009-09-02 23:07:31

Oh noes, darn it. :(
– Bad Processor