@@ -75,8 +75,8 @@ public static void Main(string[] args) {
75
75
Console . WriteLine ( "Not found file " + s ) ;
76
76
}
77
77
break ;
78
- } else if ( s == "version" ) {
79
- Console . WriteLine ( "AuScript 3.0r by ix4Software | ReScript by etar125" ) ;
78
+ } else if ( s == "version" || s == "ver" ) {
79
+ Console . WriteLine ( "AuScript 3.0r by ix4Software | ReScript 1.00 by etar125" ) ;
80
80
Console . ReadKey ( ) ;
81
81
Environment . Exit ( 0 ) ;
82
82
} else {
@@ -167,18 +167,14 @@ public static string ConvertS(string src) {
167
167
} return src ;
168
168
}
169
169
public static string ConvertV ( string src ) {
170
- if ( src . StartsWith ( "$" ) ) {
171
- string ofas = src . Remove ( 0 , 1 ) ;
172
- if ( vars . ContainsKey ( ofas ) ) return vars [ ofas ] ;
173
- else {
174
- if ( logs == true ) {
175
- string text = "Not found variable " + ofas + "\n " ;
176
- File . AppendAllText ( logf , text ) ;
177
- }
178
- return "-0" ;
170
+ if ( vars . ContainsKey ( src ) ) return vars [ src ] ;
171
+ else {
172
+ if ( logs == true ) {
173
+ string text = "Not found variable " + src + "\n " ;
174
+ File . AppendAllText ( logf , text ) ;
179
175
}
176
+ return "null" ;
180
177
}
181
- return src ;
182
178
}
183
179
184
180
public static void oth ( int stat )
@@ -1001,94 +997,53 @@ public static void oth(int stat)
1001
997
string ofas3 = l [ i ] . Remove ( 0 , 8 ) ;
1002
998
string sym = ConvertS ( ofas3 . Substring ( 0 , ofas3 . IndexOf ( " " ) ) ) ;
1003
999
string j = ofas3 . Substring ( ofas3 . IndexOf ( " " ) + 1 ) ;
1004
- string froma = ConvertN ( j . Substring ( 0 , j . IndexOf ( "=" ) ) ) ;
1000
+ string froma = ConvertV ( j . Substring ( 0 , j . IndexOf ( "=" ) ) ) ;
1005
1001
string to = j . Substring ( j . IndexOf ( "=" ) + 1 ) ;
1006
1002
int va = froma . IndexOf ( sym ) ;
1007
- bool d = false ;
1008
- for ( int ch = 0 ; ch < vars . Count ; ch ++ ) {
1009
- if ( vars [ ch ] . StartsWith ( to + "=" ) ) {
1010
- vars [ ch ] = to + "=" + va ;
1011
- d = true ;
1012
- break ;
1013
- }
1014
- }
1015
- if ( ! d ) {
1016
- vars . Add ( to + "=" + va ) ;
1017
- }
1003
+ if ( vars . ContainsKey ( to ) ) vars [ to ] = va . ToString ( ) ;
1004
+ else vars . Add ( to , va . ToString ( ) ) ;
1018
1005
} else {
1019
1006
if ( logs == true ) {
1020
- string texts = File . ReadAllText ( logf ) ;
1021
- texts += "Wrong command on line " + i . ToString ( ) + ", text: " + l [ i ] + " *or end of custom???|" ;
1022
- File . WriteAllText ( logf , texts ) ;
1007
+ string texts = "Wrong command on line " + i . ToString ( ) + ", text: " + l [ i ] + " *or end of custom???\n " ;
1008
+ File . AppendAllText ( logf , texts ) ;
1023
1009
}
1024
1010
}
1025
1011
}
1026
1012
catch
1027
1013
{
1028
1014
if ( logs == true )
1029
1015
{
1030
- string texts = File . ReadAllText ( logf ) ;
1031
- texts += "Wrong command on line " + i . ToString ( ) + ", text: " + l [ i ] + " *or end of custom??? or any error|" ;
1032
- File . WriteAllText ( logf , texts ) ;
1016
+ string texts = "Wrong command on line " + i . ToString ( ) + ", text: " + l [ i ] + " *or end of custom??? or any error\n " ;
1017
+ File . AppendAllText ( logf , texts ) ;
1033
1018
}
1034
1019
}
1035
1020
}
1036
1021
}
1037
1022
1038
- public static double NextDouble ( Random RandGenerator , double MinValue , double MaxValue )
1039
- {
1023
+ public static double NextDouble ( Random RandGenerator , double MinValue , double MaxValue ) {
1040
1024
return RandGenerator . NextDouble ( ) * ( MaxValue - MinValue ) + MinValue ;
1041
1025
}
1042
1026
1043
- public static void MsgBoxClose ( object sender , EventArgs e )
1044
- {
1027
+ public static void MsgBoxClose ( object sender , EventArgs e ) {
1045
1028
msgbox . Close ( ) ;
1046
1029
}
1047
- public static void InBoxClose ( object sender , EventArgs e )
1048
- {
1030
+ public static void InBoxClose ( object sender , EventArgs e ) {
1049
1031
string va = tb . Text ;
1050
- bool d = false ;
1051
- for ( int ch = 0 ; ch < vars . Count ; ch ++ )
1052
- {
1053
- if ( vars [ ch ] . StartsWith ( invar + "=" ) )
1054
- {
1055
- vars [ ch ] = invar + "=" + va ;
1056
- d = true ;
1057
- break ;
1058
- }
1059
- }
1060
- if ( ! d )
1061
- {
1062
- vars . Add ( invar + "=" + va ) ;
1063
- }
1032
+ if ( vars . ContainsKey ( invar ) ) vars [ invar ] = va ;
1033
+ else vars . Add ( invar , va ) ;
1064
1034
invar = "" ;
1065
1035
inbox . Close ( ) ;
1066
1036
}
1067
- public static void ChBoxClose ( object sender , EventArgs e )
1068
- {
1069
- try
1070
- {
1037
+ public static void ChBoxClose ( object sender , EventArgs e ) {
1038
+ try {
1071
1039
string va = lb . SelectedItem . ToString ( ) ;
1072
- bool d = false ;
1073
- for ( int ch = 0 ; ch < vars . Count ; ch ++ )
1074
- {
1075
- if ( vars [ ch ] . StartsWith ( chvar + "=" ) )
1076
- {
1077
- vars [ ch ] = chvar + "=" + va ;
1078
- d = true ;
1079
- break ;
1080
- }
1081
- }
1082
- if ( ! d )
1083
- {
1084
- vars . Add ( chvar + "=" + va ) ;
1085
- }
1040
+ if ( vars . ContainsKey ( chvar ) ) vars [ chvar ] = va ;
1041
+ else vars . Add ( chvar , va ) ;
1086
1042
chvar = "" ;
1087
1043
chbox . Close ( ) ;
1088
- }
1089
- catch
1090
- {
1091
-
1044
+ } catch {
1045
+ string texts = "ChooseBox error: no item selected maybe\n " ;
1046
+ File . AppendAllText ( logf , texts ) ;
1092
1047
}
1093
1048
}
1094
1049
}
0 commit comments