SRL Archive - S.M.A.R.T. Questions and Answers.

2 Scars = 2 Smart but can you..


Camaro'

2008-03-24 20:31:19

Instead of making to scars why couldnt you clone that Smart.Scar to Smart1.scar

and {.include srl/srl/misc/smart1.scar}

And open to scar orinigals and have one say Smart1 and other say smart..


Im curious if this will work.. And why not if it cant.

Harry

2008-03-24 20:32:46

Will not work, AFAIK. SMART.scar will try to use the same SMART.dll, and will give errors.

Your best bed is 2 SCAR folders.

Hobbit

2008-03-24 20:45:23

What about if you dupe the dll and change the second smart include the use the duplicated dll (diff name of course)

Would that work?

Camaro'

2008-03-24 20:53:46

From: Hy71194
Will not work, AFAIK. SMART.scar will try to use the same SMART.dll, and will give errors.

Your best bed is 2 SCAR folders.


My Best bed is at sleepys silly :p

I was thinking what hobbit was thinking.. Will that work?

Harry

2008-03-24 20:55:58

bet :rolleyes:

I don't think it is possible because SCAR loads all the DLLs upon loading the EXE. So it doesn't know what one to specify as "#1" and "#2".

Hobbit

2008-03-24 20:58:07

Well completely rename it then.
Like
trams.dll
and trams.scar
:p

Camaro'

2008-03-24 21:00:40

From: Hobbit
Well completely rename it then.
Like
trams.dll
and trams.scar
:p




Im not getting this hold on …

Why couldnt we tell Smart.scar to load Smart.dll and smart1.scar to load smart1.dll?

Hobbit

2008-03-24 21:08:28

Because it's the same dll so they'd be trying to use the same window.

Hy71194 explained it to my and my way doesn't work because it is still trying to load the same thing twice. So then it essentially says "WTH WHY AM I LOADING IT TWICE" and gives you a nasty error. ;)

Camaro'

2008-03-24 21:10:42

From: Hobbit
Because it's the same dll so they'd be trying to use the same window.

Hy71194 explained it to my and my way doesn't work because it is still trying to load the same thing twice. So then it essentially says "WTH WHY AM I LOADING IT TWICE" and gives you a nasty error. ;)


Lol thanks for clarifying =] Didnt no dlls can speak hehe

mixster

2008-03-25 12:14:23

Actually, what will happen is the functions/procedures will just re-written over and the same .dll just like when you make your own procedure called 'High' or 'KeyDown', so instead of calling the original 'High;, it will call your custom one no matter how times you call it. The dll can then only handle one request at a time, so the only feesable way would be to beg Benland etc. for the code then change the procedure/function names and saving it as a different dll, though I personally would just clone it or even have an older version of Scar installed, especially as there will always be some things better and some things worse with each version (though usually more better).

Wizzup?

2008-03-25 12:37:05

From: Hobbit
What about if you dupe the dll and change the second smart include the use the duplicated dll (diff name of course)

Would that work?


Won't work- the function names stay the same, and SCAR includes all .dll's.

n3ss3s

2008-03-25 12:51:25

From: Killerdou
First of all, you will need multiple plugins, so for example smart.dll and smart1.dll(you can just copy your current one.
Then you need to allow api calls(script>>>allow api calls). Now, you need to do an api call(why else would we allow them). Here is what you need to do:

procedure SmartSetup( w : string; d, s : boolean); external '_setup@12@smart.dll stdcall';
Now, in the next script you want to run, you need to use

procedure SmartSetup( w : string; d, si : boolean); external '_setup@12@smart1.dll stdcall';
Obviously if your .dlls are called differently, you have to change the filename after the second @. I am not sure if scar api calls can handle spaces in the name, but you can try it. This should make using multiple smarts a whole lot easier:).

If there are any objections against this post, please tell me and i'll remove it.

Have fun autoing,


Killerdou


:)

But having two scar's is a lot easier.

mixster

2008-03-25 12:53:05

How has that snippet managed to hide for so long :(

PvH

2008-03-25 12:59:25

you should just use 2 scars.
is easier to understand and will work 100% ^^
but if you want to do it the complicated way.. go ahead :p

mixster

2008-03-26 03:22:26

That way will work 100% and all you have to do is add a few extra lines of code and you're set for life/until next scar update ;)