Is it possible to write to a C# value while using SendLuaScript with the WeAreDevs API?
Posted
Basically, something like
if condition == true then
ToCS("thisVar = 43;")
else
ToCS("thisVar = thisVar - 1;")
end
.
Does something like this exist already, or is there some sort of work-around? Anything that helps me achieve what I want?
Shojmorez
Replied
What do you mean write to a c# value? Like assign a value to a variable?
Cancel
Post
Replied
@63568 Yes. I want my C# code to act accordingly to my Lua code in real-time.
Cancel
Post
Added
@63568 I said I wanted to overwrite a C# variable with data influenced by my Lua findings.
Cancel
Post
Shojmorez
Replied
@Shojmorez you could do a Lua parser or a Lua lexer.
I use a parser for my Monaco Editor, Default Monaco does not have a parser.
Cancel
Post
Replied
Cool, but may you elaborate? How would I get some thing like that to work, and what good would it do along the way?
Edit: Actually, I'm not sure if you know what I'm talking about. I want to be able to edit my variables declared in my C# code with the findings from my Lua code.
Cancel
Post
Shojmorez
Replied
@Shojmorez So you want to like....for example get the player position using lua and store the player position in a c# variable? That's a lot more complicated to do (especially in c#) than you think.
Cancel
Post
Replied
@63568 So you're saying it's possible?
Maybe I use a constantly updating pastebin or something like that and read off of that?
Cancel
Post
Shojmorez
Replied
@Shojmorez Yes it's possible, You will still use a parser or lexer. Pastebin won't solve your problem.
Example of a lexer:
i = 1;
[
{
value = "i",
line = 1,
column = 1,
type = "identifier"
},
{
value = "=",
line = 1,
column = 1,
type = "eq"
},
{
value = 1,
line = 1,
column = 5,
type = "double"
}
]
Cancel
Post
Replied
@MaximusExploit This is just my intepretation of his question but i think, i think, he means he wants to get a value from Roblox.
Cancel
Post
Replied
@Shojmorez Your question is very unclear. If you want to interact with C# via Lua. You could embed a compiler and register it as a closure. This could lead to vulnerabilities so I wouldn't recommend doing it.
compile(...)Cancel
Post
Users viewing this thread:
( Members: 0, Guests: 0, Total: 0 )
Cancel
Post