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 


Error when compiling the trainer.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
dan013
Cheater
Reputation: 0

Joined: 30 Dec 2023
Posts: 28

PostPosted: Thu Jan 04, 2024 4:31 pm    Post subject: Error when compiling the trainer. Reply with quote

So I have a trainer I want to compile to exe. So when I tried to open the compiled exe there was an error popping up. I knew this was working fine when not compiled.

Code:
Error:[string "require 'Ifs'
module 'Ifs' not found:
no field package.preload['lfs']
no file 'C:\Users\xxxxx\AppData\Local\Temp\cetrainers\CET12D.tmp\extracted\lua\lfs.lua'
no file 'C:\Users\xxxxx\AppData\Local\Temp\cetrainers\CET12D.tmp\extracted\lua\lfs\init.lua'
no file 'C:\Users\xxxxx\AppData\Local\Temp\cetrainers\CET12D.tmp\extracted\lfs.lua'
no file 'C:\Users\xxxxx\AppData\Local\Temp\cetrainers\CET12D.tmp\extracted\lfs\init.lua'
no file 'C:\Users\xxxxx\AppData\Local\Temp\cetrainers\CET12D.tmp\extracted\..\share\lua\5.3\lfs.lua'
no file 'C:\Users\xxxxx\AppData\Local\Temp\cetrainers\CET12D.tmp\extracted\..\share\lua\5.3\lfs\init.lua'
no file '.\lfs.lua'
no file '.\lfs\init.lua'
no file 'Ifs.lua'
no file 'C:\Users\xxxxx\Documents\My Cheat TablesMfs.lua'
no file 'C:\Users\xxxxx\AppData\Local\Temp\cetrainers\CET12D.tmp\extracted\lfs.lua'
no file 'C:\Users\xxxxx\AppData\Local\Temp\cetrainers\CET12D.tmp\extracted\lfs.dll'
no file 'C:\Users\xxxxx\AppData\Local\Temp\cetrainers\CET12D.tmp\extracted\..\lib\lua\5.3\lfs.dll'
no file 'C:\Users\xxxxx\AppData\Local\Temp\cetrainers\CET12D.tmp\extracted\loadall.dll'
no file '.\lfs.dllC:\Users\xxxxx\AppData\Local\Temp\cetrainers\CET12D.tmp\extracted\lfs53.dll'
no file'.\lfs53.dll'
no file 'C:\Users\xxxxx\AppData\Local\Temp\cetrainers\CET12D.tmp\extracted\clibs64\lfs.dll'
no file '.\clibs64\lfs.dll'


i've already put require 'lfs' on the very top of the but no luck. Can someone please help?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Thu Jan 04, 2024 4:56 pm    Post subject: Reply with quote

it's lfs, not ifs


also, include the lfs.lua file and related modules inside the trainer package

_________________
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
dan013
Cheater
Reputation: 0

Joined: 30 Dec 2023
Posts: 28

PostPosted: Thu Jan 04, 2024 5:09 pm    Post subject: Reply with quote

Dark Byte wrote:
it's lfs, not ifs


also, include the lfs.lua file and related modules inside the trainer package


I've put lfs. It's the font that why looks like that. I've already put it all on the tablefile and its working but when I compiled it to exe that's the error im getting.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Thu Jan 04, 2024 5:50 pm    Post subject: Reply with quote

also the dll file in clibs64 and in the same subfolder ?
_________________
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
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4702

PostPosted: Thu Jan 04, 2024 5:53 pm    Post subject: Reply with quote

dan013 wrote:
Code:
Error:[string "require 'Ifs'
That's clearly an I (uppercase i), not an l (lowercase L)

Press Ctrl+F in your browser and see for yourself

If they look the same, consider changing the font you code with

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 37

Joined: 16 Feb 2017
Posts: 1522

PostPosted: Thu Jan 04, 2024 6:46 pm    Post subject: Reply with quote

Dark Byte wrote:
first of, LFS is already part of CE's installation so you can just do lfs.currentdir()

(the lfs dll is in <cheatenginedir>\clib*\lfs.dll)

as for why the lfs.dll from the package doesn't work is because it's not compiled for ce's lua implementation. It expects to find a lua53.dll, which isn't there. There's only lua53-32.dll and lua53-64.dll

you need to compile lfs yourself and make it link against these dll's


It looks like "lfs" is already defined in CE.

Code:
function lfsAttr(aa)
attr=lfs.attributes(aa)
if attr then
  --file/folder exists
  if attr.mode=='directory' then
    print("folder exists")
  else
    print("It exists, but is no folder")
  end
else
  --file/folder does not exist
  print("Does not exist")
end
end

scriptFile = getCheatEngineDir() --..'autorun'

local a1=(scriptFile..'myFolder')
local a2=(scriptFile..'languages')

print("********* a1 **********")
lfsAttr(a1)
print("********* a2 **********")
lfsAttr(a2)


or

Code:
local path
  if getTempFolder then
    path=getTempFolder()
  else
    path=getCheatEngineDir()
  end
  lfs.mkdir(path.."editing-ceaascripts") --assume it works, or it already exists
  path=path.."editing-ceaascripts\\"

  --printf("initial path=%s", path)

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
dan013
Cheater
Reputation: 0

Joined: 30 Dec 2023
Posts: 28

PostPosted: Fri Jan 05, 2024 12:12 am    Post subject: Reply with quote

Dark Byte wrote:
also the dll file in clibs64 and in the same subfolder ?

I dont know about that clibs64? How does it work?

ParkourPenguin wrote:
dan013 wrote:
Code:
Error:[string "require 'Ifs'
That's clearly an I (uppercase i), not an l (lowercase L)

Press Ctrl+F in your browser and see for yourself

If they look the same, consider changing the font you code with


Hmm weird. I knew i type lfs. I will check again

quote="AylinCE"]
Dark Byte wrote:
first of, LFS is already part of CE's installation so you can just do lfs.currentdir()

(the lfs dll is in <cheatenginedir>\clib*\lfs.dll)

as for why the lfs.dll from the package doesn't work is because it's not compiled for ce's lua implementation. It expects to find a lua53.dll, which isn't there. There's only lua53-32.dll and lua53-64.dll

you need to compile lfs yourself and make it link against these dll's


It looks like "lfs" is already defined in CE.

Code:
function lfsAttr(aa)
attr=lfs.attributes(aa)
if attr then
  --file/folder exists
  if attr.mode=='directory' then
    print("folder exists")
  else
    print("It exists, but is no folder")
  end
else
  --file/folder does not exist
  print("Does not exist")
end
end

scriptFile = getCheatEngineDir() --..'autorun'

local a1=(scriptFile..'myFolder')
local a2=(scriptFile..'languages')

print("********* a1 **********")
lfsAttr(a1)
print("********* a2 **********")
lfsAttr(a2)


or

Code:
local path
  if getTempFolder then
    path=getTempFolder()
  else
    path=getCheatEngineDir()
  end
  lfs.mkdir(path.."editing-ceaascripts") --assume it works, or it already exists
  path=path.."editing-ceaascripts\\"

  --printf("initial path=%s", path)
[/quote]
Still the same When compiling it to exe theres errors aame as above
Back to top
View user's profile Send private message
dan013
Cheater
Reputation: 0

Joined: 30 Dec 2023
Posts: 28

PostPosted: Fri Jan 05, 2024 2:55 pm    Post subject: Reply with quote

AylinCE wrote:
Dark Byte wrote:
first of, LFS is already part of CE's installation so you can just do lfs.currentdir()

(the lfs dll is in <cheatenginedir>\clib*\lfs.dll)

as for why the lfs.dll from the package doesn't work is because it's not compiled for ce's lua implementation. It expects to find a lua53.dll, which isn't there. There's only lua53-32.dll and lua53-64.dll

you need to compile lfs yourself and make it link against these dll's


It looks like "lfs" is already defined in CE.

Code:
function lfsAttr(aa)
attr=lfs.attributes(aa)
if attr then
  --file/folder exists
  if attr.mode=='directory' then
    print("folder exists")
  else
    print("It exists, but is no folder")
  end
else
  --file/folder does not exist
  print("Does not exist")
end
end

scriptFile = getCheatEngineDir() --..'autorun'

local a1=(scriptFile..'myFolder')
local a2=(scriptFile..'languages')

print("********* a1 **********")
lfsAttr(a1)
print("********* a2 **********")
lfsAttr(a2)


or

Code:
local path
  if getTempFolder then
    path=getTempFolder()
  else
    path=getCheatEngineDir()
  end
  lfs.mkdir(path.."editing-ceaascripts") --assume it works, or it already exists
  path=path.."editing-ceaascripts\\"

  --printf("initial path=%s", path)


Is this correct?
Code:
local path
  if getTempFolder then
    path=getTempFolder()
  else
    path=getCheatEngineDir()
  end
  lfs.mkdir(path.."clibs64") --assume it works, or it already exists
  path=path.."clibs64\\"

  printf("initial path=%s", path)


Cause when I compiled it and ran the program it said this
Code:
Error:[string "PROCESS_NAME = 'xxxx.exe'.,."]:244: attempt to index a nil value (global 'lfs')


its different from the last time
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Fri Jan 05, 2024 3:01 pm    Post subject: Reply with quote

when you compile the .exe you can add files to the package and assign what subfolder they should be in. Do that there

clibs64 is already in the searchpath

_________________
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
dan013
Cheater
Reputation: 0

Joined: 30 Dec 2023
Posts: 28

PostPosted: Fri Jan 05, 2024 4:51 pm    Post subject: Reply with quote

Dark Byte wrote:
when you compile the .exe you can add files to the package and assign what subfolder they should be in. Do that there

clibs64 is already in the searchpath


That's why i always got errors. I disregarding adding files when compiling. I always call it from the tablefile or straight from the file path but anyways now it works. Thanks.
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 37

Joined: 16 Feb 2017
Posts: 1522

PostPosted: Sat Jan 06, 2024 6:50 am    Post subject: Reply with quote

dan013 wrote:

That's why i always got errors. I disregarding adding files when compiling. I always call it from the tablefile or straight from the file path but anyways now it works. Thanks.


@DarkByte tests many bugs you encounter and if it doesn't say "This is a feature that needs to be fixed", it means that only you encountered it and gives you ideas to try different solutions.

My suggestion is; Try your code (.exe or whatever) on a different PC with a clean CE installed.

Also, the folder creation code I gave you in your previous question does not use "lfs". Have you tried it? (See your previous questionnaire.)

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
dan013
Cheater
Reputation: 0

Joined: 30 Dec 2023
Posts: 28

PostPosted: Mon Jan 08, 2024 1:28 am    Post subject: Reply with quote

AylinCE wrote:
dan013 wrote:

That's why i always got errors. I disregarding adding files when compiling. I always call it from the tablefile or straight from the file path but anyways now it works. Thanks.


@DarkByte tests many bugs you encounter and if it doesn't say "This is a feature that needs to be fixed", it means that only you encountered it and gives you ideas to try different solutions.

My suggestion is; Try your code (.exe or whatever) on a different PC with a clean CE installed.

Also, the folder creation code I gave you in your previous question does not use "lfs". Have you tried it? (See your previous questionnaire.)


Yes still the same. there's an error. It just need to load the file to package in order to work .

Yeah I will try on another pc and beta test it to my friends see if there any abnormalities. Anyways thanks for the tip
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
Page 1 of 1

 
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