Simulating LUA console inside love?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Simulating LUA console inside love?
So i guess i wrote inside the wrong forum, so is there a way to simulate LUA console inside love. With some instructions please.
- Ranguna259
- Party member
- Posts: 911
- Joined: Tue Jun 18, 2013 10:58 pm
- Location: I'm right next to you
Re: Simulating LUA console inside love?
What I said on your other post:
Re: Simulating LUA console inside love?
So on previous post a guy posted about pcall and xpcall, im starting to understand what he meant, still, any help will be appretiated.
For how i understood i ask for human input, then call a function with it, right?
For how i understood i ask for human input, then call a function with it, right?
- Ranguna259
- Party member
- Posts: 911
- Joined: Tue Jun 18, 2013 10:58 pm
- Location: I'm right next to you
Re: Simulating LUA console inside love?
The other guy was me
Here's an exemple (you'll aslo need to use loadstring):
or
That's how LoveDebug does it.
Here's an exemple (you'll aslo need to use loadstring):
Code: Select all
f, err = loadstring(input)
if f then
f, err = pcall(f)
end
if not f then
print('error: '..err)
else
print('Code ran successfully')
end
Code: Select all
f, err = loadstring(input)
if f then
f = xpcall(f, function(err) print('error: '..err) end)
end
if f then
print('Code ran successfully')
end
Who is online
Users browsing this forum: Google [Bot] and 5 guests