06 Aug 2014, 02:13
Generic-user-small

Murrrr ica (4 posts)

Hello! I’m new to programming and also pretty terrible at it so I’m confused about what to do for squidbomb. This is my code - http://pastebin.com/Fd0j6iFp

I don’t think I’ve put my for loop in the right place but I have no idea where else it could go. I saw some more plugins in the code folder that said “Squidbomb” but the directions in the book state I should be adding on to the SkyCmd plugin.

06 Aug 2014, 17:24
Andy-talking_pragsmall

Andrew Hunt (204 posts)

First of all, don’t worry about being terrible! There’s a lot to learn, and everyone is terrible at everything when they first start.

Have you tried compiling and running this code? What happens when you do?

You want to add a new command in the SkyCmd plugin. Right now, you’ve added the squid stuff into the existing ‘sky” command:

if (commandLabel.equalsIgnoreCase("sky")

You need to add your for loop and such into a new section when the commandLabel is “squidbomb”, like I’ve done in the sample code under the Squidbomb directory.

/\ndy

07 Aug 2014, 03:05
Generic-user-small

Murrrr ica (4 posts)

Very sorry that I didn’t fix it with the help you gave! http://pastebin.com/5H3RxSpy - I tried this, http://pastebin.com/RVWfNrkr - then this. (Both of which gave me a lot of compiler errors).

I don’t know where I should be putting the if(commandLabel.equalsIgnoreCase(“squidbomb”) and the for loop inside of the program without placing it inside of skycmd’s already written code.

I am looking at Squidbomb’s code but it looks like an entirely different plugin to me.

Chances are I’m just too thick to understand what you’re saying seems like everyone else got it though ;p.

07 Aug 2014, 18:34
Andy-talking_pragsmall

Andrew Hunt (204 posts)

That will not work; you can only define “onCommand” once.

Take a look at this thread: http://forums.pragprog.com/forums/314/topics/12858

Perhaps that might help?

/\ndy

  You must be logged in to comment