◆ EvalScriptRun()
static Tuple< bool, int > EvalScripts.Eval.EvalScriptRun |
( |
string | Script | ) |
|
|
inlinestatic |
113 {
114 try
115 {
116 CSharpScript.EvaluateAsync(Script);
117
118
119
120
121 return new Tuple<bool, int>(true, 0);
122 }
123 catch (Exception)
124 {
125
126
127
128
129 return new Tuple<bool, int>(false, 0);
130 }
131 }
◆ EvalScriptRunConditionalStatementAsync()
static async Task< Tuple< bool, int > > EvalScripts.Eval.EvalScriptRunConditionalStatementAsync |
( |
string | Script | ) |
|
|
inlinestatic |
37 {
38 try
39 {
40 string FinalCode = @"
41
42 int tmp = 0;
43 void test_statement(int Token) {
44 tmp = Token;
45 }
46
47 " + Script + @"
48
49 int num = tmp;
50
51 ";
52 var SetParam = await CSharpScript.RunAsync(FinalCode);
53 var RunCode = await SetParam.ContinueWithAsync("num");
54 var X = RunCode.ReturnValue;
55
56
57
58
59 return new Tuple<bool, int>(true, (int)X);
60 }
61 catch (Exception)
62 {
63
64
65
66
67 return new Tuple<bool, int>(false, 0);
68 }
69 }
◆ EvalScriptRunLoopsAsync()
static async Task< Tuple< bool, int > > EvalScripts.Eval.EvalScriptRunLoopsAsync |
( |
string | Script | ) |
|
|
inlinestatic |
72 {
73 try
74 {
75 string FinalCode = @"
76
77 int tmp = 0;
78 int val = 0;
79 void test_statement(int Token) {
80 tmp = Token;
81 }
82
83 int tmp_counter = 0;
84 int x = 0;
85
86 " + Script + @"
87
88 test_statement(tmp_counter);
89 int num = tmp;
90
91 ";
92
93 var SetParam = await CSharpScript.RunAsync(FinalCode);
94 var RunCode = await SetParam.ContinueWithAsync("num");
95 var X = RunCode.ReturnValue;
96
97
98
99
100 return new Tuple<bool, int>(true, (int)X);
101 }
102 catch (Exception)
103 {
104
105
106
107
108 return new Tuple<bool, int>(false, 0);
109 }
110 }
◆ EvalStatementAsync()
static async Task< Tuple< bool, int > > EvalScripts.Eval.EvalStatementAsync |
( |
string | Statement | ) |
|
|
inlinestatic |
13 {
14 try
15 {
16 var SetParam = await CSharpScript.RunAsync("var num = " + Statement + ";");
17 var RunCode = await SetParam.ContinueWithAsync("num");
18 var X = RunCode.ReturnValue;
19
20
21
22
23 return new Tuple<bool, int>(true, (int)X);
24 }
25 catch (Exception)
26 {
27
28
29
30
31 return new Tuple<bool, int>(false, 0);
32 }
33
34 }
The documentation for this class was generated from the following file:
- hyperdbg/script-engine/modules/script-engine-test/EvalScripts/Eval.cs