Log in

View Full Version : a UseSMART option would be smart...



PhantomCode
07-06-2008, 10:32 AM
Hmm... after confusing myself with that title I have to get my thoughts back in order...

Right!

I think that in the next SRL rev we should make it so that you can have an option in your script (ie: in the consts) about whether or not to use SMART.
This would be really easy to do by adding a UseSMART constant in all scripts and then in the SRL functions that SMART replaces have
if UseSMART then {Insert SMART version of the function here} else {Insert non-SMART version of the function here};

Do you see what I mean?
Anyway, I think it would be good so waddaya think, devs?

~PhantomCode

PS: Heck, I'll do it myself if you don't have time or whatever. It'll be easy!
PPS: Sorry if this is in the wrong place... I didn't know where to put it.

PvH
07-06-2008, 10:37 AM
Yes, have a boolean for that in the const, and add it in the mainloop/setup.
Some scripts already have it, but you can also upload 2 versions of a script, 1 with smart and one without:p
And there is no need for the devs to update it, because IF you use smart, it will automatically overwrite the functions;)
And else, it simply won't:)

PvH

PhantomCode
07-06-2008, 10:45 AM
Wait, what, pvh?

If u just have
if UseSMART then SetupSMART... {blah}
wont it screw up because you will still have {.include ...smart.scar} at the top and that overwrites some SRL functions?

wouldn't you need something that effectively did: if UseSMART then {.include ...SMART.scar}
^btw i know that wouldn't work it's just an example

PvH
07-06-2008, 10:47 AM
You could have // for the things:p

PhantomCode
07-06-2008, 10:54 AM
yeah, pvh, i know u can do that but i just want a nice neat option for n00by users :p

EDIT: Aah! WTF is with all those posts? SRL is screwin up!
EDIT: Ok i got rid of em:duh:

mixster
07-06-2008, 11:07 AM
The only way to do that would be to add something like {$DEFINE USESMART} at the top of the main script under program. You then edit Smart.scar to {IFDEF USESMART} at the top and {$ENDIF} at the bottom, though to disable it they would still have to modify the {$DEFINE USESMART} either with comments or just changing the definition name. I find it would be much easier just to tell them to put // before the include if they don't want to use Smart; If they can't do that, then they need to GTFO and learn how to.

PhantomCode
07-06-2008, 11:14 AM
Yeah, i guess i could just tell em to // in the instructions... <sigh>...
Still, I think it would be handy to have it included in SRL.