oxcool1
|
  |
| Joined: 05 Nov 2009 |
| Total Posts: 15444 |
|
| |
|
|
| 27 Jan 2012 10:44 PM |
| dang, I never understood newproxy() >:/ |
|
|
| Report Abuse |
|
|
|
| 27 Jan 2012 10:45 PM |
"dang, I never understood newproxy() >:/" New Proxy... How do you NOT understand that...?
|
|
|
| Report Abuse |
|
|
|
| 27 Jan 2012 10:46 PM |
| It's like not understanding Instance.new() |
|
|
| Report Abuse |
|
|
Riderj
|
  |
| Joined: 15 Aug 2011 |
| Total Posts: 1534 |
|
|
| 27 Jan 2012 10:48 PM |
@FreeGamesROBLOX Complete this challenge then
[=|I rate myself 6/10 in RBLX.Lua|=] |
|
|
| Report Abuse |
|
|
|
| 27 Jan 2012 10:49 PM |
| @free, not really because it's used with tables and metatables. Instance.new() is used 98% more times in scripts than with newproxy(). I never bothered learning because wiki didn't explain it that well and what it could be used for... |
|
|
| Report Abuse |
|
|
|
| 27 Jan 2012 10:52 PM |
@free, dont try to insult my knowledge, I really only learn from wiki because it's reliable (95% of the time) and anything that isn't understandable to me with the way that they've explained it I just ignore. this is all it gives me about newproxy:
newproxy (boolean or proxy)Undocumented feature of Lua.
Arguments: boolean - returned proxy has metatable or userdata - different proxy created with newproxy
Creates a blank userdata with an empty metatable, or with the metatable of another proxy.
Example local a = newproxy(true) local mt = getmetatable(a) print( mt ~= nil ) --> true
local b = newproxy(a) print( mt == getmetatable(b) ) --> true
local c = newproxy(false) print( getmetatable(c) ~= nil ) --> false
print( a.Name ) --> attempt to index local 'a' (a userdata value) mt.__index = {Name="Proxy"} print( a.Name ) --> Proxy print( b.Name ) --> Proxy
|
|
|
| Report Abuse |
|
|
Riderj
|
  |
| Joined: 15 Aug 2011 |
| Total Posts: 1534 |
|
|
| 27 Jan 2012 10:55 PM |
I would try and solve this but, I do not understand the challenge. Plus my downfall is that I cannot piece all that I know together. I cannot figure stuff out, I just can learn it.
[=|I rate myself 6/10 in RBLX.Lua|=] |
|
|
| Report Abuse |
|
|
Riderj
|
  |
| Joined: 15 Aug 2011 |
| Total Posts: 1534 |
|
|
| 27 Jan 2012 11:03 PM |
Going out on a limb...
t = {} t[newproxy(true)] = true for i,v in pairs(t) do i = nil print(i) end
[=|I rate myself 6/10 in RBLX.Lua|=] |
|
|
| Report Abuse |
|
|
Riderj
|
  |
| Joined: 15 Aug 2011 |
| Total Posts: 1534 |
|
|
| 27 Jan 2012 11:04 PM |
Never mind, used a loop haha. Did not read or loops.
[=|I rate myself 6/10 in RBLX.Lua|=] |
|
|
| Report Abuse |
|
|
|
| 27 Jan 2012 11:04 PM |
| @ox, can you show me the answer except with loops? so I can get a feel of how it could be done? |
|
|
| Report Abuse |
|
|
oxcool1
|
  |
| Joined: 05 Nov 2009 |
| Total Posts: 15444 |
|
| |
|
|
| 27 Jan 2012 11:18 PM |
Free seems to be a..
'I have no idea what the answer to this is so I'll try and look smart and insult someone else' type of guy.
Eh, what do I know? No idea how newproxy functions. |
|
|
| Report Abuse |
|
|
Riderj
|
  |
| Joined: 15 Aug 2011 |
| Total Posts: 1534 |
|
|
| 27 Jan 2012 11:46 PM |
Any hints?
[=|I rate myself 6/10 in RBLX.Lua|=] |
|
|
| Report Abuse |
|
|
Riderj
|
  |
| Joined: 15 Aug 2011 |
| Total Posts: 1534 |
|
|
| 27 Jan 2012 11:50 PM |
I cannot get it, so here is my last attempt. I got rid of everything haha.
t = {}
t[newproxy(true)] = true
t = nil
[=|I rate myself 6/10 in RBLX.Lua|=] |
|
|
| Report Abuse |
|
|
oxcool1
|
  |
| Joined: 05 Nov 2009 |
| Total Posts: 15444 |
|
| |
|
Riderj
|
  |
| Joined: 15 Aug 2011 |
| Total Posts: 1534 |
|
|
| 27 Jan 2012 11:55 PM |
I know, I got fed up with it. I know that the index is the userdata, so I need to figure out how to index it according to the current userdata hex.
[=|I rate myself 6/10 in RBLX.Lua|=] |
|
|
| Report Abuse |
|
|
Legend26
|
  |
| Joined: 08 Sep 2008 |
| Total Posts: 10586 |
|
|
| 28 Jan 2012 12:10 AM |
setmetatable(t,{__mode="k"}) collectgarbage()
In theory, since there is no other reference to the proxy, it would be garbage collected and removed. |
|
|
| Report Abuse |
|
|
| |
|
Riderj
|
  |
| Joined: 15 Aug 2011 |
| Total Posts: 1534 |
|
|
| 28 Jan 2012 12:12 AM |
@TNS Cannot figure it out either?
[=|I rate myself 6/10 in RBLX.Lua|=] |
|
|
| Report Abuse |
|
|
|
| 28 Jan 2012 12:18 AM |
No I asked for a hint because I knew the answer to it. [/sarcasm]
:P
▌†ηϨ▐ |
|
|
| Report Abuse |
|
|
Riderj
|
  |
| Joined: 15 Aug 2011 |
| Total Posts: 1534 |
|
|
| 28 Jan 2012 12:21 AM |
:P
I know now that the table is empty even after it is set.
That might be helpful.
[=|I rate myself 6/10 in RBLX.Lua|=] |
|
|
| Report Abuse |
|
|
Legend26
|
  |
| Joined: 08 Sep 2008 |
| Total Posts: 10586 |
|
|
| 28 Jan 2012 12:21 AM |
*Everyone ignored my (most probably) correct answer*
You guys are weird. |
|
|
| Report Abuse |
|
|
|
| 28 Jan 2012 12:23 AM |
@Legend ox never said that was the correct way, therefore everyone ignores it. Until ox acknowledges your post, I shall ignore it.
@Rider Only the best can solve ox's challenges... :o
▌†ηϨ▐ |
|
|
| Report Abuse |
|
|
Riderj
|
  |
| Joined: 15 Aug 2011 |
| Total Posts: 1534 |
|
|
| 28 Jan 2012 12:23 AM |
I did not ignore it, I tested it. It said could not something collect.
[=|I rate myself 6/10 in RBLX.Lua|=] |
|
|
| Report Abuse |
|
|