Errors

Errors

Postby lucasds12 » 18 Jun 2013, 02:38

Hello MCDzienny visitors (and moderators and such), I ran into a lot of errors meanwhile trying to compile my command. I'd like for someone to be assistive and assist me on these magnificently annoying errors to trying to fix:
Code: Select all
-------------------------

Error #CS1010
Message: Newline in constant
Line: 39

-------------------------

Error #CS1035
Message: End-of-file found, '*/' expected
Line: 41

-------------------------

Error #CS1519
Message: Invalid token '(' in class, struct, or interface member declaration
Line: 39

-------------------------

Error #CS1520
Message: Method must have a return type
Line: 39

-------------------------

Error #CS1001
Message: Identifier expected
Line: 39

-------------------------

Error #CS1031
Message: Type expected
Line: 39

-------------------------

Error #CS1519
Message: Invalid token '(' in class, struct, or interface member declaration
Line: 40

-------------------------

Error #CS1519
Message: Invalid token ',' in class, struct, or interface member declaration
Line: 40

-------------------------

Error #CS1519
Message: Invalid token '(' in class, struct, or interface member declaration
Line: 41

-------------------------

Error #CS1519
Message: Invalid token ',' in class, struct, or interface member declaration
Line: 41

-------------------------

Error #CS1513
Message: } expected
Line: 41

-------------------------

Error #CS1513
Message: } expected
Line: 41

Please assist!
-Lucas
There is only one thing I do in life, that's contributing here.
lucasds12
 
Posts: 334
Joined: 17 Apr 2013, 16:17
Location: In the deep caves.

Re: Errors

Postby HETAL » 18 Jun 2013, 02:59

the errors are difficult to tell with out the coding, hers what I could make out, on line 41 you either have too many { or you need to add a /,on line 39 try replacing the ( with a { and you need a return string, on line 40 replace ( with a {, I could be wrong because I don't know how and what you are coding...unless you want to post the code.
YOU HAVENT SEEN THE LAST OF ME ISMELLIKE
HETAL
 
Posts: 397
Joined: 24 May 2013, 12:10

Re: Errors

Postby ismellike » 18 Jun 2013, 02:59

It would be nice if you would post the code so we could see what's actually happening.
What a beast...
User avatar
ismellike
Coder
 
Posts: 731
Joined: 31 Oct 2012, 04:04
Location: Kansas

Re: Errors

Postby lucasds12 » 18 Jun 2013, 22:34

Alright, here's my code for my command:
Code: Select all
/*
   Auto-generated command skeleton class.

   Use this as a basis for custom commands implemented via the MCDzienny scripting framework.
   File and class should be named a specific way.  For example, /update is named 'CmdUpdate.cs' for the file, and 'CmdUpdate' for the class.
*/

// Add any other using statements you need up here, of course.
// As a note, MCDzienny is designed for .NET 3.5.
using System;

namespace MCDzienny
{
   public class CmdObjective : Command
   {
      // The command's name, in all lowercase.  What you'll be putting behind the slash when using it.
      public override string name { get { return "objective"; } }

      // Command's shortcut (please take care not to use an existing one, or you may have issues.
      public override string shortcut { get { return ""; } }

      // Determines which submenu the command displays in under /help.
      public override string type { get { return "other"; } }

      // Determines whether or not this command can be used in a museum.  Block/map altering commands should be made false to avoid errors.
      public override bool museumUsable { get { return false; } }

      // Determines the command's default rank.  Valid values are:
      // LevelPermission.Nobody, LevelPermission.Banned, LevelPermission.Guest
      // LevelPermission.Builder, LevelPermission.AdvBuilder, LevelPermission.Operator, LevelPermission.Admin
      public override LevelPermission defaultRank { get { return LevelPermission.Banned; } }

      // This is where the magic happens, naturally.
      // p is the player object for the player executing the command.  message is everything after the command invocation itself.
      public override void Use(Player p, string message)
      {
         Player.SendMessage(p, "The objective of this unique game is to survive the lava and live! There is a money system that will basically allow you to buy ranks! Good Luck!");
      }
Command.all.Find("cuboid")Use(p, "wood);
Player.SendMessage(p, "Get building!");
Player.SendMessage(p, "Waiting for a valid objective..");/*
   command's default rank.  Valid values are:
      // LevelPermission.Nobody, LevelPermission.Banned, LevelPermission.Guest
      // LevelPermission.Builder, LevelPermission.AdvBuilder, LevelPermission.Operator, LevelPermission.Admin
      public override LevelPermission defaultRank { get { return LevelPermission.Banned; } }

      // This is where the magic happens, naturally.
      // p is the player object for the player executing the command.  message is everything after the command invocation itself.
      public override void Use(Player p, string message)

      }
   }
}
      // This one controls what happens when you use /help [commandname].
      public override void Help(Player p)
      {
         Player.SendMessage(p, "%4/objective - %eShows how-to play the game!");
      }
   }
}

I accidently copied something there I didn't mean to paste so if you could help with that, I would be a happy panda :ugeek:
-Luca
There is only one thing I do in life, that's contributing here.
lucasds12
 
Posts: 334
Joined: 17 Apr 2013, 16:17
Location: In the deep caves.

Re: Errors

Postby ismellike » 18 Jun 2013, 22:38

Ok here it is.

Some code was left outside of the use method.
Some had some periods left out.
You also commented out half of the stuff in there.

Code: Select all
using System;

namespace MCDzienny
{
    public class CmdObjective : Command
    {
        public override string name { get { return "objective"; } }
        public override string shortcut { get { return ""; } }
        public override string type { get { return "other"; } }
        public override bool museumUsable { get { return false; } }
        public override LevelPermission defaultRank { get { return LevelPermission.Banned; } }
        public override void Use(Player p, string message)
        {
            Player.SendMessage(p, "The objective of this unique game is to survive the lava and live! There is a money system that will basically allow you to buy ranks! Good Luck!");
            Command.all.Find("cuboid").Use(p, "wood");
            Player.SendMessage(p, "Get building!");
            Player.SendMessage(p, "Waiting for a valid objective..");
        }
        public override void Help(Player p)
        {
            Player.SendMessage(p, "%4/objective - %eShows how-to play the game!");
        }
    }
}
What a beast...
User avatar
ismellike
Coder
 
Posts: 731
Joined: 31 Oct 2012, 04:04
Location: Kansas

Re: Errors

Postby lucasds12 » 18 Jun 2013, 22:49

Are you kidding me? It's still invalid to compile. I used the given code but just won't compile, here's the errors:
Code: Select all
-------------------------

Error #CS1520
Message: Method must have a return type
Line: 39

-------------------------

Error #CS1001
Message: Identifier expected
Line: 39

-------------------------

Error #CS1031
Message: Type expected
Line: 39

-------------------------

Error #CS1519
Message: Invalid token '(' in class, struct, or interface member declaration
Line: 40

-------------------------

Error #CS1519
Message: Invalid token ',' in class, struct, or interface member declaration
Line: 40

-------------------------

Error #CS1519
Message: Invalid token '(' in class, struct, or interface member declaration
Line: 41

-------------------------

Error #CS1519
Message: Invalid token ',' in class, struct, or interface member declaration
Line: 41

-------------------------

Error #CS1513
Message: } expected
Line: 41

-------------------------

Error #CS1513
Message: } expected
Line: 41

Help please.
-Lucas
There is only one thing I do in life, that's contributing here.
lucasds12
 
Posts: 334
Joined: 17 Apr 2013, 16:17
Location: In the deep caves.

Re: Errors

Postby ismellike » 18 Jun 2013, 22:52

Well you obviously didn't even change the code before you compiled since they're the same error logs given.

A lot of those line numbers are greater than the total line numbers of the code I provided (24 lines).
What a beast...
User avatar
ismellike
Coder
 
Posts: 731
Joined: 31 Oct 2012, 04:04
Location: Kansas

Re: Errors

Postby lucasds12 » 18 Jun 2013, 23:02

Ok, I fixed it unanimously perfectly and it works. Thank you Isme for the assistive information.
-Lucas
There is only one thing I do in life, that's contributing here.
lucasds12
 
Posts: 334
Joined: 17 Apr 2013, 16:17
Location: In the deep caves.


Return to Help in Coding

Who is online

Users browsing this forum: No registered users and 4 guests

cron