SRL Archive - OSR Help

Importing delphi functions into scar?


Xtensity

2010-08-04 02:53:34

I would be asking this at Freddy's site, but it's down right now =\

There's many valuable delphi functions missing from scar, many of which I need to use for my advanced clicking algorithm I'm putting together.

I know how to import only 2 functions, based off how I saw Freddy do it in another script.



function PostMessage(Wnd: HWND; Msg: Cardinal; LParam, WParam: Integer): LongBool; external 'PostMessageW@user32.dll stdcall';
function SendMessage(Wnd: HWND; Msg: Cardinal; LParam, WParam: Integer): LongBool; external 'SendMessageW@user32.dll stdcall';

I've been trying to import a few functions, but have no luck getting them to work.
Function Erf(x: Extended): Extended;
Function Ln(x: Extended): Extended;

I will more than likely be trying to important various other functions, so I need to know how to do this, and not just what the answer would be.


Ever since more information on the Macro Detection system got leaked, I've been trying to put together a more algorithmic click generation function. That uses a Special Gaussian Distribution function with probability density click accuracy based on my clicks in various areas on the screen after a day of playing… This will be much better(and way more human like) than simply having clicks randomly generated within a certain box-range like Mouse and MMouse do.

So any clues?

Wanted

2010-08-04 03:36:44

http://villavu.com/forum/showthread.php?t=41311

let me know if you need any additional help MSN: [email]IceFire908@NetScape.Net[/email]

Xtensity

2010-08-04 04:10:16

er, that's not what I mean.

I just need to know how to format the code which I have to put at the top of my script.

Besides, I'm not making functions like that, I don't know the contents of the function, which is why I need to import it from the Delphi Library.

function PostMessage(Wnd: HWND; Msg: Cardinal; LParam, WParam: Integer): LongBool; external 'PostMessageW@user32.dll stdcall';
function SendMessage(Wnd: HWND; Msg: Cardinal; LParam, WParam: Integer): LongBool; external 'SendMessageW@user32.dll stdcall';

Those are Delphi functions, and all freddy did was put them at the top of the script which allows for their use in scar. I just need to know the format for this so I can do it with any function already in the Delphi Library.

If you don't know how to do this, I could play around with the tutorial there, and made an additional function which calls the function I need…. but it just seems unnecessary if functions can be called from the Delphi library with 1 line at the top of my script.

Anyways, I'm going to bed, I'll have to try it out tomarrow, tired.

Wizzup?

2010-08-04 04:48:58

You could also write a plugin, or add them directly to Simba. (See signature)

Xtensity

2010-08-04 05:13:23

From: Wizzup?
You could also write a plugin, or add them directly to Simba. (See signature)


Can I ask 'how' I would add a function(which I don't know the inside contents of) to simba?

The one reason I don't use simba for my coding is because it lacks various maths functions that scar has.

Daniel

2010-08-04 05:42:39

From: Xtensity
Those are Delphi functions, and all freddy did was put them at the top of the script which allows for their use in scar.


That's because those methods are located in one of the many Windows API system DLLs. The ones you request aren't…

So, the only way to add such functionality to Simba/SCAR is to create your own plugin importing those methods or directly modify the Simba executable (as Wizzup suggested above). (The latter is unavailable to SCAR)

Wizzup?

2010-08-04 05:49:52

From: Xtensity
Can I ask 'how' I would add a function(which I don't know the inside contents of) to simba?


External way: by creating a plugin
Internal way: Get the tools you need to compile simba, download the simba source, and modify the source to add the functions you want. If you have set up the first two parts, then I can help with the latter.

The one reason I don't use simba for my coding is because it lacks various maths functions that scar has.


Such as?

Xtensity

2010-08-04 16:24:43

Alright. All this is good information.

Though, i still do not know what I would have to put to IMPORT a function from the delphi library, in the external plugin or the simba code.

I can figure out how to make my own codes, but I don't know the contents of the codes I need… that's why I need to import them

I could create a function that could call a Delphi function, the scar could call the function which calls the delphi function.

Yet I'm not sure how i would do that in simba(add it directly to simba without external plugin)

Unless there's a guide or instructions somewhere that I missed.

Sex

2010-08-05 05:54:54

Tell me what functions you want and I'll make them for you.

Xtensity

2010-08-05 13:55:57

From: Sex
Tell me what functions you want and I'll make them for you.


I already wrote it up there. You don't need to do it, I was asking for method lol. If I need to make a plugin I will. For the last day I've been at my cousins house unable to code.

I'll do it when I get home.

nielsie95

2010-08-05 13:58:54

You can't import functions from Delphi without using a plugin. If you want to add them directly to Simba's default functions, you'll have to adjust the source an recompile. A plugin would be your best option.

The example code that you have posted imports functions from an external library (user32.dll in this case). Those aren't Delphi functions (in fact, Delphi imports them in the same way).