SRL Archive - SRL Archives

{$Define SMART} and {$Define REFLECTION}


marpis

2009-06-11 21:03:07

I think these should be put into SRL.scar:

{$IfDef SMART}
{.include srl/srl/misc/smart.scar}
{$EndIf}

{$IfDef REFLECTION}
{.include SRL/SRL/reflection/reflection.scar}
{$EndIf}

var
World: integer;
Signed, Members, HighDetail: boolean;

I think this should be put into SetupSRL;

{$IfDef SMART}
SmartSetupEx(World, Members, Signed, HighDetail);
SetTargetDC(SmartGetDC);
repeat
wait(100);
until(SmartGetColor(253, 233)<>1118604);
{$EndIf}

Then just {.include srl/srl.scar} would be enough.
You could make script use SMART just by writing {$Define SMART} and reflection by writing {$Define REFLECTION}

edit: btw,
 tags don't recognize preprocessor commands, fix that immediately! ;)

Naike

2009-06-11 22:55:47

Good idea for the S.M.A.R.T part, don't think reflection will be added tho.

noidea

2009-06-11 23:21:55

From: N1ke!
Good idea for the S.M.A.R.T part, don't think reflection will be added tho.


+1
I don;t agree with adding reflection though.

marpis

2009-06-12 00:19:46

why not reflection?

noidea

2009-06-12 00:21:15

From: marpis
why not reflection?


Not every one appreciates Reflection. While ALMOST every one uses SMART.

marpis

2009-06-12 01:12:16

From: noidea
Not every one appreciates Reflection. While ALMOST every one uses SMART.


not every one appreciates olives and still they are sold in all stores? your argument has no logic.

Richard

2009-06-12 01:24:48

S.M.A.R.T is default with SRL so it would be a good idea, but some people aren't away of reflection straight away, and there may be a mass of posts asking why they get errors with SRL, so perhaps not the best idea.

rogue poser

2009-06-12 01:32:18

you could just do this…

setupsrl(true,false);

true for smart false for reflection, unless your script uses it them make both booleans true

noidea

2009-06-12 01:32:33

From: Richard
S.M.A.R.T is default with SRL so it would be a good idea, but some people aren't away of reflection straight away, and there may be a mass of posts asking why they get errors with SRL, so perhaps not the best idea.

Thats what I meant. I guess I worded it wrong -.-

Nadeem

2009-06-12 01:56:54

From: rogue poser
you could just do this…

setupsrl(true,false);

true for smart false for reflection, unless your script uses it them make both booleans true


Not possible, since SMART and Reflection are includes.

@noidea's topic: I think thats a pretty good idea… It can be like this:

Scripters Side:

{$DEFINE SMART}
{$DEFINE REFLECTION}
{.include SRL/SRL.scar}

SRL.scar:

{$IFDEF SMART}
{.include SRL/SRL/misc/Smart.scar}
{$ENDIF}

{... all of SRL's include files...}

// At the very end:
{$IFDEF REFLECTION}
{.include SRL/SRL/reflection/reflection.scar}
{$ENDIF}

So I don't see why not?



~NS

Nava2

2009-06-12 02:01:44

If you want to do {$DEFINE Reflection} Then I could probably add it into the reflection files. It will NOT go into SRL though.

I think the SMART one could though.

Nadeem

2009-06-12 02:05:03

Wait lol I just realized… There is not point really of using {$DEFINE Reflection} since it is simply just a one liner to include the reflection file itself? - Besides it looking better. SMART should be enough IMO.



~NS

rogue poser

2009-06-12 03:40:08

From: Nadeem
Not possible, since SMART and Reflection are includes.


how is it not possible, when you setup srl it loads a bunch of includes, you could use another file as a buffer to only load the includes specified… humor me for a second

lets pretend i made a new file setSRL.scar

i make this


procedure setSRLup(isSmart,isReflection:boolean)
begin

if(isSmart)
setupSmart

if(isReflection)
setupReflection

setupSrl


end;

and there were 2 more files, one setupReflection one setupSmart

it would be a bit more convenient, but then again, why waste cpu cycles

edit: then again that wouldnt really help as it would be the same as declaring smart or reflection and just not calling it

ZephyrsFury

2009-06-12 07:05:21

From: rogue poser
how is it not possible, when you setup srl it loads a bunch of includes, you could use another file as a buffer to only load the includes specified… humor me for a second

lets pretend i made a new file setSRL.scar

i make this


procedure setSRLup(isSmart,isReflection:boolean)
begin

if(isSmart)
setupSmart

if(isReflection)
setupReflection

setupSrl


end;

and there were 2 more files, one setupReflection one setupSmart

it would be a bit more convenient, but then again, why waste cpu cycles

edit: then again that wouldnt really help as it would be the same as declaring smart or reflection and just not calling it


It wouldn't work because SMART.scar overrides some of SCAR's mouse and keyboard functions when it compiles. It doesn't matter if SetupReflection or SetupSmart is called it will still be overridden.

Nadeem

2009-06-12 07:08:35

From: ZephyrsFury
It wouldn't work because SMART.scar overrides some of SCAR's mouse and keyboard functions when it compiles. It doesn't matter if SetupReflection or SetupSmart is called it will still be overridden.


Exactly, because either way, the SMART and Reflection file's would have to be included for that loading function to work. {$DEFINE} = much better.



~NS

Sir R. M8gic1an

2009-06-12 17:32:14

I have added {$DEFINE SMART} at the top of Smart.scar, so it is now easier to use in your scripts.

Just include smart, if people do not wish to use it they can just comment it out, and then in your scripts do something of the like:

{$IFDEF SMART}
Procedure SetupSmart;
begin

SmartSetupEx(100, False, True, False);
Wait(5000);
SetTargetDC(SmartGetDC);
repeat
wait(100);
until(RSReady);

end;
{$ENDIF}

~RM