Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Using external modules (luasockets!)
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Tsyal
How do I cheat?
Reputation: 0

Joined: 10 Nov 2019
Posts: 8

PostPosted: Tue Nov 12, 2019 4:05 am    Post subject: Reply with quote

I want to use TCP functions, which does not seem possible with getInternet().
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Tue Nov 12, 2019 2:19 pm    Post subject: Reply with quote

Check LuaSockets info page here:
http://w3.impa.br/~diego/software/luasocket/introduction.html

It includes info on how to use the other aspects of it.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Tsyal
How do I cheat?
Reputation: 0

Joined: 10 Nov 2019
Posts: 8

PostPosted: Tue Nov 12, 2019 2:51 pm    Post subject: Reply with quote

Yes that's exactly where I look.
But my problem appears in the first line :
Code:
local socket = require("socket")

My problem is to install the package.
Back to top
View user's profile Send private message
descatal
Newbie cheater
Reputation: 0

Joined: 28 Jul 2019
Posts: 18

PostPosted: Sun Nov 17, 2019 3:19 am    Post subject: Reply with quote

Any updates to this? I am trying to make a p2p server using the Luasocker UDP function.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 472

Joined: 09 May 2003
Posts: 25875
Location: The netherlands

PostPosted: Mon Nov 18, 2019 5:00 am    Post subject: Reply with quote

compile luasocket with the lua 5.3 sourcecode in the ce git repository (or at least the .lib files)
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
descatal
Newbie cheater
Reputation: 0

Joined: 28 Jul 2019
Posts: 18

PostPosted: Sat Nov 23, 2019 10:03 am    Post subject: Reply with quote

Thanks for the reply, DB. Before I continue, I must apologize if my compiling methods listed here are unorthodox, but here I go:
I tried your advice by compiling the luasockets dll with CE's Lua53 library. However, it still returns an error same way as the old version.

Error:error loading module 'socket.core' from file 'C:\Program Files\Cheat Engine 7.0\clibs64\socket\core.dll':
The specified module could not be found.

Since this is my first time messing around with all these compilations, my knowledge is limited and I probably made a lot of mistakes along the way. Let me know if I did anything wrong with these steps:

1. Compiled .dll and .lib files using the Lua53 src and include files from git repo. However I had problems with lua.c and wmain.c files while compiling (unresolved external symbol _main), so I removed them.

2. Linked the luasocket project downloaded from github with the self made CE dll and the lib files from step 1, and compiled the dll.

3. Moved mime and socket dll into cslib64 folders and ran the "require socket" script, got the error.

I am using VS2019.

Any help would be greatly appreciated. Thank you for your time
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 472

Joined: 09 May 2003
Posts: 25875
Location: The netherlands

PostPosted: Sat Nov 23, 2019 4:51 pm    Post subject: Reply with quote

are you compiling for the proper cpu architecture? (e.g 64 bit x86)
The lua searchpaths are set correct? (LUA_PATH and LUA_CPATH)

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
descatal
Newbie cheater
Reputation: 0

Joined: 28 Jul 2019
Posts: 18

PostPosted: Sat Nov 23, 2019 8:49 pm    Post subject: Reply with quote

Thanks for the quick reply, DB.

I compiled it in x64 release for both the CE Lua53 dll and the Luasocket core dll.

As for the LUA_PATH and LUA_CPATH, I just left it at default while compiling. The path I got from using this command is listed below:
print(package.path..'\n\n'..package.cpath)

;C:\Program Files\Cheat Engine 7.0\lua\?.lua;C:\Program Files\Cheat Engine 7.0\lua\?\init.lua;C:\Program Files\Cheat Engine 7.0\?.lua;C:\Program Files\Cheat Engine 7.0\?\init.lua;C:\Program Files\Cheat Engine 7.0\..\share\lua\5.3\?.lua;C:\Program Files\Cheat Engine 7.0\..\share\lua\5.3\?\init.lua;.\?.lua;.\?\init.lua;C:\Program Files (x86)\Lua\5.1\lua\?.luac;?.lua;C:\Users\username\Documents\My Cheat Tables\?.lua

C:\Program Files\Cheat Engine 7.0\?.dll;C:\Program Files\Cheat Engine 7.0\..\lib\lua\5.3\?.dll;C:\Program Files\Cheat Engine 7.0\loadall.dll;.\?.dllC:\Program Files\Cheat Engine 7.0\?53.dll;.\?53.dll;C:\Program Files\Cheat Engine 7.0\clibs64\?.dll;.\clibs64\?.dll

The core.dll is placed in clibs64, which is present in the cpath.

I would like to apologize if I misunderstood the path/cpath question
Back to top
View user's profile Send private message
Tsyal
How do I cheat?
Reputation: 0

Joined: 10 Nov 2019
Posts: 8

PostPosted: Wed Nov 27, 2019 10:37 am    Post subject: Reply with quote

I think I managed to compile lua 5.3.
But I can not compile luasocket. I got an error C1083 'lua.h' : No such file or directory.
I think this is related to the Lua.props file and the UserMacros part of it. Which files should I put to which path ?
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Wed Nov 27, 2019 3:52 pm    Post subject: Reply with quote

Tsyal wrote:
I think I managed to compile lua 5.3.
But I can not compile luasocket. I got an error C1083 'lua.h' : No such file or directory.
I think this is related to the Lua.props file and the UserMacros part of it. Which files should I put to which path ?


Make sure you have the proper path to Lua setup for luasocket to find Lua 5.3's code/headers properly. Getting 'lua.h' not found means that it cannot find the Lua src to reference while compiling. Depending on the compiler you use, this is done usually as an include file reference path.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
descatal
Newbie cheater
Reputation: 0

Joined: 28 Jul 2019
Posts: 18

PostPosted: Wed Nov 27, 2019 5:48 pm    Post subject: Reply with quote

[quote="atom0s"][quote="Tsyal"]I think I managed to compile lua 5.3.
But I can not compile luasocket. I got an error C1083 'lua.h' : No such file or directory.
I think this is related to the Lua.props file and the UserMacros part of it. Which files should I put to which path ?[/quote]

Make sure you have the proper path to Lua setup for luasocket to find Lua 5.3's code/headers properly. Getting 'lua.h' not found means that it cannot find the Lua src to reference while compiling. Depending on the compiler you use, this is done usually as an include file reference path.[/quote]

I am using VS2019, and I linked the luasocket source code with the LUA53 header files by following the steps in this video.
https://www.youtube.com/watch?v=TALXtup2CjI
The LUA53 dll and libs are the files that I had compiled from the LUA53 source code that was found inside CE's git repo.
But the dll I compiled is not working, so I hope someone could correct me on my compiling methods.

Thanks for your time.
Back to top
View user's profile Send private message
Tsyal
How do I cheat?
Reputation: 0

Joined: 10 Nov 2019
Posts: 8

PostPosted: Thu Nov 28, 2019 11:09 am    Post subject: Reply with quote

I finally managed to compile luasocket. But it does not work.

I have the same error as descatal. I noticed that my .ddl are much smaller than those compiling for the previous version on the previous page.
I keep digging Confused
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites