@@ -952,44 +952,43 @@ public void MouseLeftClick(string parameter) {
952952
953953 public const int MOUSEEVENTF_RIGHTDOWN = 0x08 ;
954954 public const int MOUSEEVENTF_RIGHTUP = 0x10 ;
955- public void MouseRightClick ( string parameter )
956- {
955+ public void MouseRightClick ( string parameter ) {
957956 // Try to get amount of times to click
958- if ( Int32 . TryParse ( parameter , out int repeatAmount ) )
959- {
960- for ( int count = 0 ; count < repeatAmount ; count ++ )
961- {
957+ if ( Int32 . TryParse ( parameter , out int repeatAmount ) ) {
958+ for ( int count = 0 ; count < repeatAmount ; count ++ ) {
962959 mouse_event ( MOUSEEVENTF_RIGHTDOWN , Cursor . Position . X , Cursor . Position . Y , 0 , 0 ) ;
963960 mouse_event ( MOUSEEVENTF_RIGHTUP , Cursor . Position . X , Cursor . Position . Y , 0 , 0 ) ;
964961 successMessage = "Simulated pressing the Right mouse button " + repeatAmount + " times" ;
965962 }
966- }
967- else
968- {
963+ } else {
969964 Error ( "Repeat amount is not a munber" ) ;
970965 }
971966 }
972967
973968 public const int MOUSEEVENTF_MIDDLEDOWN = 0x20 ;
974969 public const int MOUSEEVENTF_MIDDLEUP = 0x40 ;
975- public void MouseMiddleClick ( string parameter )
976- {
970+ public void MouseMiddleClick ( string parameter ) {
977971 // Try to get amount of times to click
978- if ( Int32 . TryParse ( parameter , out int repeatAmount ) )
979- {
980- for ( int count = 0 ; count < repeatAmount ; count ++ )
981- {
972+ if ( Int32 . TryParse ( parameter , out int repeatAmount ) ) {
973+ for ( int count = 0 ; count < repeatAmount ; count ++ ) {
982974 mouse_event ( MOUSEEVENTF_MIDDLEDOWN , Cursor . Position . X , Cursor . Position . Y , 0 , 0 ) ;
983975 mouse_event ( MOUSEEVENTF_MIDDLEUP , Cursor . Position . X , Cursor . Position . Y , 0 , 0 ) ;
984976 successMessage = "Simulated pressing the Middle mouse button " + repeatAmount + " times" ;
985977 }
986- }
987- else
988- {
978+ } else {
989979 Error ( "Repeat amount is not a munber" ) ;
990980 }
991981 }
992982
983+ public void Wait ( string parameter ) {
984+ if ( Int32 . TryParse ( parameter , out int time ) ) {
985+ Thread . Sleep ( time ) ;
986+ successMessage = "Waited " + time + " miliseconds" ;
987+ } else {
988+ Error ( "Time Parameter is not a number" ) ;
989+ }
990+ }
991+
993992 /* End of actions */
994993 }
995994}
0 commit comments