SRL Archive - General

Adding Extras


Sir R. M8gic1an

2010-12-02 15:43:30

How to add an extra


//RM Auto reponder
Procedure RM_Auto_Responder;
begin
{$IFDEF ALPHA_RM_RESPONDER}
RM_AutoRespond;
{$ENDIF}
end;

{$IFDEF ALPHA_RM_RESPONDER}

long file

{$ENDIF}


//Extras.Simba

//Responders
{$DEFINFE RM_AUTO_RESPONDER}


This is a great way to add extras: why?

We can create as many of these as we want:

Procedure RM_Auto_Responder;
begin
{$IFDEF ALPHA_RM_RESPONDER}
RM_AutoRespond;
{$ENDIF}
end;

therefore in our code, we could just have this:

function MSI_AutoRespond: boolean;
var
i: integer;
begin
for i:= 0 to 3 do
begin
case i of
0: Result := RM_AutoResponder;
1: Result := MK_AutoResponder;
2: Result := Nava_AutoResponder;
3: Result := Fawki_AutoResponder;
end;

if Result then break;
end;
end;

Why is this so great? There is no cluster / messiness at all in the code.

And we can create as many wrappers as we need, so the 'extra' can have as many functions as we wish.

This does require tho than an extra is an extra. Meaning that if it is not used that it won't break MSI functionality.

I think this would work out. Feedback? :)

~RM

Coh3n

2010-12-03 00:55:49

Looks perfect. :) Nice and neat, just the way I like it. ;)

NCDS

2010-12-03 20:43:01

I like it :)

Gu3st...

2010-12-03 20:52:54

Seems like a relatively good way to do this :)