Marsbar 228 Posted July 3, 2020 Share Posted July 3, 2020 Does anyone know how the RunCode class works? I want to be able to let a user enter some C# similar to the quester runcode step. The RunCode class has some Compile methods but none for running that I could decifer. Any help would be appreciated ❤️ Link to comment https://wrobot.eu/forums/topic/12329-runcode-class/ Share on other sites More sharing options...
Droidz 2739 Posted July 3, 2020 Share Posted July 3, 2020 Hi, like that: var CodeToRun = "var r = 1 + 1;"; string _sourceCodeIQuesterCondition = @"using System; using System.Collections.Generic; using System.ComponentModel; using System.Configuration; using System.IO; using System.Linq; using System.Threading; using robotManager; using robotManager.FiniteStateMachine; using robotManager.Helpful; using wManager.Wow.Class; using wManager.Wow.Helpers; using wManager.Wow.ObjectManager; using Timer = robotManager.Helpful.Timer; using wManager.Wow.Enums; public class Main { public static void Pulse() { [RUNCODE]; } }"; string error; if (!robotManager.Helpful.RunCode.CompileAndInvokeStaticMethod(RunCode.CodeType.CSharp, _sourceCodeIQuesterCondition.Replace("[RUNCODE]", CodeToRun), "Main", "Pulse", out error)) Logging.WriteError(error); Marsbar 1 Link to comment https://wrobot.eu/forums/topic/12329-runcode-class/#findComment-59091 Share on other sites More sharing options...
Marsbar 228 Posted July 3, 2020 Author Share Posted July 3, 2020 11 minutes ago, Droidz said: Hi, like that: <snip> Exactly what I was looking for, thank you. Link to comment https://wrobot.eu/forums/topic/12329-runcode-class/#findComment-59092 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now