problem with Auto save script . . . . .

I find this script in Unity wiki. but this script is showing me an error
error is : the type or namespace name ‘Unity Editor’ could not be found. are you missing a using directive or an assembly reference.
this code save the scene in the interval of 1 to 10 minutes

[COLOR="blue"]using[/COLOR] UnityEngine;
[COLOR="blue"]using[/COLOR] Unity Editor;
[COLOR="blue"]using[/COLOR] System;

[COLOR="blue"]public class[/COLOR] AutoSave : [COLOR="blue"]EditorWindow[/COLOR] {

    [COLOR="blue"]private bool[/COLOR] autoSaveScene = [COLOR="blue"]true[/COLOR];
    [COLOR="blue"]private bool[/COLOR] showMessage =[COLOR="blue"] true[/COLOR];
    [COLOR="blue"]private bool[/COLOR] isStarted = [COLOR="blue"]false[/COLOR];
   [COLOR="blue"] private int[/COLOR] intervalScene; 
  [COLOR="blue"]  private[/COLOR] DateTime lastSaveTimeScene = DateTime.Now;
   
  [COLOR="blue"]  private string[/COLOR] projectPath = [COLOR="blue"]Application.dataPath[/COLOR];
   [COLOR="blue"] private string[/COLOR] scenePath;
   
    [[COLOR="blue"]MenuItem[/COLOR] ([COLOR="orange"][COLOR="red"]"Window/AutoSave"[/COLOR][/COLOR])]
    [COLOR="blue"]static void[/COLOR] Init () {
        AutoSave saveWindow = (AutoSave)[COLOR="blue"]EditorWindow.GetWindow[/COLOR] ([COLOR="blue"]typeof[/COLOR] (AutoSave));
        saveWindow.[COLOR="blue"]Show[/COLOR]();
    }
   
    [COLOR="blue"]void OnGUI[/COLOR] () { 
       [COLOR="blue"] GUILayout.Label [/COLOR]("Info:",[COLOR="blue"] EditorStyles.boldLabel[/COLOR]);
       [COLOR="blue"] EditorGUILayout.LabelField [/COLOR]("Saving to", ""+projectPath);
      [COLOR="blue"]  EditorGUILayout.LabelField[/COLOR] ("Saving scene:", ""+scenePath);
      [COLOR="blue"]  GUILayout.Label[/COLOR] ("Options:",[COLOR="blue"] EditorStyles.boldLabel[/COLOR]);
        autoSaveScene =[COLOR="blue"] EditorGUILayout.BeginToggleGroup[/COLOR] ("Auto save", autoSaveScene);
        intervalScene = [COLOR="blue"]EditorGUILayout.IntSlider[/COLOR] ("Interval (minutes)", intervalScene, 1, 10);
       [COLOR="blue"] if[/COLOR](isStarted) {
            [COLOR="blue"]EditorGUILayout.LabelField[/COLOR] ("Last save:", ""+lastSaveTimeScene);
        }
 [COLOR="#0000ff"]       EditorGUILayout.EndToggleGroup[/COLOR]();
        showMessage =[COLOR="#0000ff"] EditorGUILayout.BeginToggleGroup[/COLOR] ("[COLOR="#ff0000"]Show Message"[/COLOR], showMessage);
       [COLOR="#0000ff"] EditorGUILayout.EndToggleGroup[/COLOR] ();
    }
   
   
   [COLOR="#0000ff"] void Update()[/COLOR]{
        scenePath = [COLOR="#0000ff"]EditorApplication.currentScene[/COLOR];
       [COLOR="#0000ff"] if[/COLOR](autoSaveScene) {
           [COLOR="#0000ff"] if[/COLOR](DateTime.Now.Minute >= (lastSaveTimeScene.Minute+intervalScene) || DateTime.Now.Minute == [COLOR="#00ffff"]59[/COLOR] [B][/B] DateTime.Now.Second == [COLOR="#00ffff"]59[/COLOR]){
                saveScene();
            }
        } [COLOR="#0000ff"]else[/COLOR] {
            isStarted = [COLOR="#0000ff"]false[/COLOR];
        }
       
    }
   
   [COLOR="#0000ff"] void [/COLOR]saveScene() {
       [COLOR="#0000ff"] EditorApplication[/COLOR].Save(scenePath);
        lastSaveTimeScene = DateTime.Now;
        isStarted = [COLOR="#0000ff"]true[/COLOR];
       [COLOR="#0000ff"] if[/COLOR](showMessage){
           [COLOR="#0000ff"] Debug.Log[/COLOR]([COLOR="#ff0000"]"AutoSave saved: "[/COLOR]+scenePath+[COLOR="#ff0000"]" on "[/COLOR]+lastSaveTimeScene);
        }
        AutoSave repaintSaveWindow = (AutoSave)[COLOR="#0000ff"]EditorWindow.GetWindow[/COLOR] ([COLOR="#0000ff"][B]typeof[/B][/COLOR] (AutoSave));
        repaintSaveWindow.[COLOR="#0000ff"]Repaint[/COLOR]();
    }
}

using UnityEditor;

not

using Unity Editor;

thanks Marrrk but it is showing another error that is : identifier expected

It’d help if you listed the Line (and even wrote it out as well so no-one needs to count lines).

Double click the error and post the line it was.

@ Ntero i have double clicked on the error identifier expected it’s showing the 2nd line using Unity Editor;
i am not understanding what is the problem with the code.

Can you post the first 5 lines of the file as it’s currently written.

It should be “using UnityEditor;” And double check there are semi colons on all lines.

Identifier Expected is primarily an issue with unsual syntax. Missing semi colons, forgotten end brackets, colons replacing semi colons, missing commas etc… So it’s probably a super fast fix, but it’s tough to decipher without seeing the current code as is.

here is first 10 to 11 lines:

using UnityEngine;
using Unity Editor;
using System;

public class AutoSave : EditorWindow {

    private bool autoSaveScene = true;
    private bool showMessage = true;
    private bool isStarted = false;
    private int intervalScene; 
    private DateTime lastSaveTimeScene = DateTime.Now;
   
    private string projectPath = Application.dataPath;
    private string scenePath;

i am editing the first code that i have given in my first post for th current code which i have you can see the whole code there

Sorry Sorry Sorry . . . . .
The script is just need to save in a folder called editor and its just work fine …
all the error is coming for not saving the script in editor folder but now the problem is where should i attached the script in the game to auto save it.

ah yeah,
I really think Unity needs to do something internally to better manage all the special folders (Streaming Assets, Resources, Plugins, Native Plugins, Editor, Standard Assets).

Once that code is in the Editor Folder, all you need to do is go to Window/Auto Save at the top bar and dock that somewhere visible (I’m assuming the logic inside works already).

I want to ask that what this Auto save script will do? is this script save the editing which i am doing in the unity or it will save the game scene when i will run it.

I believe it save’s the scene after every “IntervalScene” amount of time has passed.