| View previous topic :: View next topic |
| Author |
Message |
daspamer Grandmaster Cheater Supreme
Reputation: 54
Joined: 13 Sep 2011 Posts: 1588
|
Posted: Fri May 03, 2013 4:38 pm Post subject: Some questions.. |
|
|
Well I got couple of questions.
1. I got this to create some form with memo and etc.
| Code: |
f = {}
f[1] = createForm()
f[2] = createPanel(f[1])
f[3] = createMemo(f[2])
f[4] = createMemo(f[2])
f[5] = createButton(f[2])
f[6] = createButton(f[2])
f[7] = createButton(f[2])
|
Is it possible for me to print the arrays of 'f' and what object they hold?
2. The LUA command
I have this situation:
I have a 2 forms.
1 is login form
2 is Running tests form
I do this (example ofcourse)
| Code: | form_hide(t)
form_hide(f)
resetLuaState()
http = require("socket.http")
a, b = http.request("http://somewebsite.com/example.php","Login")
loadstring(a)() |
The above hides the tests form and login form, calls resetLuaState() and then loads again the Login form and executes.
But when I try to Login, (executes some functions in the the loadedstring(a))
I get this kind of error
| Code: | | Error:attempt to call a nil value |
So my question.
Why after loadstring, the loaded lua file don't override the current functions in the trainer itself?
(a = website the file location, b = the post data which returns the .lua file).
_________________
I'm rusty and getting older, help me re-learn lua.
Last edited by daspamer on Fri May 03, 2013 5:13 pm; edited 1 time in total |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
|
| Back to top |
|
 |
daspamer Grandmaster Cheater Supreme
Reputation: 54
Joined: 13 Sep 2011 Posts: 1588
|
Posted: Fri May 03, 2013 5:01 pm Post subject: |
|
|
| Wiccaan wrote: | Your first question can be done using:
| Code: | for k, v in pairs( f ) do
print( object_getClassName( v ) );
end |
Your second question isn't that clear. Without knowing what a is, we can't really help given that you are executing a string which could have the error in it. |
You got skype?
If so please PM me, I will tell& show you what I use&got.
Edit:
Is it possible to print the array definition too?
like
f[1]
f[2.1]
f[21]
and etc.
so result will be for example
f[1] TCEForm
_________________
I'm rusty and getting older, help me re-learn lua. |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Fri May 03, 2013 5:44 pm Post subject: |
|
|
k is the key, just print that too.
_________________
- Retired. |
|
| Back to top |
|
 |
daspamer Grandmaster Cheater Supreme
Reputation: 54
Joined: 13 Sep 2011 Posts: 1588
|
Posted: Fri May 03, 2013 6:00 pm Post subject: |
|
|
Thanks!
| Code: | for k, v in pairs( f ) do
print("acp["..k.."]")
print( object_getClassName( v ) );
end |
_________________
I'm rusty and getting older, help me re-learn lua. |
|
| Back to top |
|
 |
|