Vurv78 / Autorun-rs

Modern scripthook with lua execution and filesteal. Replacement for gluasteal and most lua executors
Apache License 2.0
103 stars 11 forks source link

require dll module #32

Closed YohSambre closed 2 years ago

YohSambre commented 2 years ago

I want to load external modules which are located in my lua/bin folder but I don't understand how to do it with autorun.

yet in my lua file I indicate :

require("enginepred")

but the external console spits me "RunString:1: Module not found!

What to do ? I missed a step ? mhummmm

Vurv78 commented 2 years ago

Make sure they are properly named: e.g. gmcl_enginepred_win32.dll

Autorun just runs in an environment that inherits from _G, so there's nothing changed with require. Unless you mean sautorun.require, which is not meant to be used for binary modules

https://wiki.facepunch.com/gmod/Creating_Binary_Modules

YohSambre commented 2 years ago

Make sure they are properly named: e.g. gmcl_enginepred_win32.dll

Autorun just runs in an environment that inherits from _G, so there's nothing changed with require. Unless you mean sautorun.require, which is not meant to be used for binary modules

https://wiki.facepunch.com/gmod/Creating_Binary_Modules

I'm afraid that's not enough, I still get the error that the module cannot be found

Vurv78 commented 2 years ago

IIRC this also happens if the module you are trying to load has missing dependencies / that gmod can't access. Like in the case of my https://github.com/Vurv78/gfluid, you need to include Nvidia Flex's .dll's in your Garrysmod/Bin folder.