Official Everybody Edits Forums

Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?

You are not logged in.

#1 2015-04-09 13:24:56, last edited by Processor (2015-04-09 19:51:34)

Firecrackericebreak
Member
Joined: 2015-02-15
Posts: 616

Why won't this work?

case "b":
                    int l = m.GetInt(0);
                    int x = m.GetInt(1);
                    int y = m.GetInt(2);
                    int b = m.GetInt(3);
                    int n = m.GetInt(4);
if (rpg.Checked)
                    {
                        if (b == 9)
                        {
                            Thread.Sleep(delay);
                            con.Send(worldKey, new object[] { l, x, y, 0 });
                        }
                         int spin;
                                Random choice = new Random();
                                if (b == 361)
                                {
                                    spin = choice.Next(1, 5);
                                    if (spin == 1)
                                    {
                                        Thread.Sleep(10);
                                        con.Send(worldKey, new object[] { 0, x, y, 0 });
                                        Thread.Sleep(10);
                                        con.Send(worldKey, new object[] { 0, x + 1, y + 1, 361 });
                                    }
                                    if (spin == 2)
                                    {
                                        Thread.Sleep(10);
                                        con.Send(worldKey, new object[] { 0, x, y, 0 });
                                        Thread.Sleep(10);
                                        con.Send(worldKey, new object[] { 0, x - 1, y + 1, 361 });
                                    }
                                    if (spin == 3)
                                    {
                                        Thread.Sleep(10);
                                        con.Send(worldKey, new object[] { 0, x, y, 0 });
                                        Thread.Sleep(10);
                                        con.Send(worldKey, new object[] { 0, x + 1, y - 1, 361 });
                                    }
                                    if (spin == 4)
                                    {
                                        Thread.Sleep(10);
                                        con.Send(worldKey, new object[] { 0, x, y, 0 });
                                        Thread.Sleep(10);
                                        con.Send(worldKey, new object[] { 0, x - 1, y - 1, 361 });
                                    }
                                }
                    }
return;

Offline

#2 2015-04-09 13:27:04

Srna
Member
Joined: 2015-02-26
Posts: 220

Re: Why won't this work?

Did u check the rpg.Checked

Offline

#3 2015-04-09 13:30:06

Firecrackericebreak
Member
Joined: 2015-02-15
Posts: 616

Re: Why won't this work?

Yep

Offline

#4 2015-04-09 13:36:17, last edited by Processor (2015-04-09 19:51:42)

Srna
Member
Joined: 2015-02-26
Posts: 220

Re: Why won't this work?

Try doing

spin = choice.Next(0, 5);

Offline

#5 2015-04-09 13:43:18

Firecrackericebreak
Member
Joined: 2015-02-15
Posts: 616

Re: Why won't this work?

It should still choose a number between them anyway so something should happen.

Offline

#6 2015-04-09 13:48:32, last edited by Processor (2015-04-09 19:51:49)

Srna
Member
Joined: 2015-02-26
Posts: 220

Re: Why won't this work?

if (spin == 1)
                                    {
                                        Thread.Sleep(10);
                                        con.Send(worldKey, 0, x, y, 0 );
                                        Thread.Sleep(10);
                                        con.Send(worldKey, 0, x + 1, y + 1, 361);
                                    }
                                    if (spin == 2)
                                    {
                                        Thread.Sleep(10);
                                        con.Send(worldKey, 0, x, y, 0 );
                                        Thread.Sleep(10);
                                        con.Send(worldKey,  0, x - 1, y + 1, 361);
                                    }
                                    if (spin == 3)
                                    {
                                        Thread.Sleep(10);
                                        con.Send(worldKey, 0, x, y, 0);
                                        Thread.Sleep(10);
                                        con.Send(worldKey, 0, x + 1, y - 1, 361);
                                    }
                                    if (spin == 4)
                                    {
                                        Thread.Sleep(10);
                                        con.Send(worldKey, 0, x, y, 0);
                                        Thread.Sleep(10);
                                        con.Send(worldKey,  0, x - 1, y - 1, 361);
                                    }

Try without new object[] stuff

Offline

#7 2015-04-09 14:00:14

Firecrackericebreak
Member
Joined: 2015-02-15
Posts: 616

Re: Why won't this work?

Still won't work

Offline

#8 2015-04-09 14:01:56, last edited by Srna (2015-04-09 14:02:20)

Srna
Member
Joined: 2015-02-26
Posts: 220

Re: Why won't this work?

Replace int spin; with int spin = 0;

Offline

#9 2015-04-09 14:19:39

Firecrackericebreak
Member
Joined: 2015-02-15
Posts: 616

Re: Why won't this work?

Still won't work.

Offline

#10 2015-04-09 15:01:05, last edited by SmittyW (2015-04-09 15:03:28)

SmittyW
Member
Joined: 2015-03-13
Posts: 2,085

Re: Why won't this work?

By looking at your code, (b == 9) should work fine.

The only reason (b == 361) does not work is because block id 361 is a rotation block (spike), so just setting it the way you have currently isn't enough.

Also why are you using return instead of break at the end

Offline

#11 2015-04-09 15:14:36

Firecrackericebreak
Member
Joined: 2015-02-15
Posts: 616

Re: Why won't this work?

Thanks SmittyW.

Offline

#12 2015-04-09 15:38:32

DarkDragon4900
Member
Joined: 2015-03-17
Posts: 251

Re: Why won't this work?

Try using break; rather than return;
Also, make a

Random choice = new Random();

at the variables.
And then change the

int spin;

to

int spin = choice.Next(0, 5);

Offline

#13 2015-04-09 18:47:48

Srna
Member
Joined: 2015-02-26
Posts: 220

Re: Why won't this work?

Smittyw wrote:

By looking at your code, (b == 9) should work fine.
The only reason (b == 361) does not work is because block id 361 is a rotation block (spike), so just setting it the way you have currently isn't enough.
Also why are you using return instead of break at the end

Nice find. I didnt even know that the block id was spike.

Offline

#14 2015-04-10 00:18:48

darkblades
Member
From: New MLG City/Weed Town
Joined: 2015-03-21
Posts: 122

Re: Why won't this work?

DarkDragon4900 wrote:

Try using break; rather than return;
Also, make a

Random choice = new Random();

at the variables.
And then change the

int spin;

to

int spin = choice.Next(0, 5);

Is it faster than using return?


Sample Text.

Doritos/Mountain Dew eater.
420 No scoping 69 scrubs per day
Always smoke weed everyday.

Known for: #getrekt Bot (possible revive with new stuff?)

Offline

#15 2015-04-10 09:24:00

DarkDragon4900
Member
Joined: 2015-03-17
Posts: 251

Re: Why won't this work?

darkblades wrote:

Is it faster than using return?

Adding break; to the end of a "case" is the proper way to end it.

Offline

Wooted by: (2)
DarkDragon49001428654240493011

Board footer

Powered by FluxBB

[ Started around 1732811742.1695 - Generated in 0.077 seconds, 12 queries executed - Memory usage: 1.5 MiB (Peak: 1.67 MiB) ]