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-08-29 20:02:01, last edited by ParadoxInTheVoid (2015-08-30 07:27:34)

ParadoxInTheVoid
Member
From: ̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺
Joined: 2015-02-18
Posts: 341

[Solved] Regenerating dug blocks

I'm trying to add a feature to my bot that allows the press of a button to replace 414 with blocks from my 'int[] diggables;'. I'm listing my blocks in a list (go figure.) the lists name is blockL (from Jaba's tutorial). I'm also using InitParse.

I figured things out.


signature.png

Offline

#2 2015-08-29 20:12:10

hummerz5
Member
From: wait I'm not a secret mod huh
Joined: 2015-08-10
Posts: 5,853

Re: [Solved] Regenerating dug blocks

The beauty of bots is that there is no set path to take. You could read up on all the tutorials, but at that point you're not learning anything or creating anything of value. You've simply copying someone else's creation, but through a painstakingly long process.

But lo and behold, you've come to an idea! This is monumental. Truly. Now, you're deciding that you want to "regenerate" dug blocks.
There are so many possible solutions, it's astounding. But which one? You didn't specify, so I'm taking the liberty to treat this as guidance rather than spoonfeeding code.

Some ideas:
Portal snake. Go hunt people down and re fill the world at the same time!
Random fill: Just randomly attack those dug blocks. They'll all get filled up at some point.
Targeted fill: bury people alive!
Anti-targeted fill: start replacing blocks where people aren't digging so it doesn't affect gameplay
Time-lapse fill: start replacing blocks from teh oldest dig to the newest!
Least-traveled fill: Don't block thke passages people often take, instead fill up those branching caverns no one uses anymore!
Flood fill: Simply treat EE like Paint.
Spaz fill: Starting at some central point, start rapidly filling in random adjacent points unpredictably.

Here's a list of ideas. Most aren't serious. But you're given the option to take this question and turn it into something creative!
Now, I'm not saying you should be more specific in your mooching of code. Rather, I hope that you can take your ideas and learn with them.
If you ask someone else for the code, you're not particularly learning and your bot won't be original. (Well, the flood fill won't.)

#blazeyourowntrailm8

Offline

Wooted by: (4)

#3 2015-08-29 22:50:21

ParadoxInTheVoid
Member
From: ̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺
Joined: 2015-02-18
Posts: 341

Re: [Solved] Regenerating dug blocks

hummerz5 wrote:

-snip-

I know how I want to do it, I'm just not sure how i'm going to do it.
I want to search the list for blocks with the ID of 414 and replace them, I've never tried this before and I'm having trouble figuring it out.

PS: Thanks for the ideas, I just can't do much with it just yet.


signature.png

Offline

#4 2015-08-29 23:12:28, last edited by ParadoxInTheVoid (2015-08-29 23:13:07)

ParadoxInTheVoid
Member
From: ̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺
Joined: 2015-02-18
Posts: 341

Re: [Solved] Regenerating dug blocks

The code I'm currently uses place 3 blocks then returns an error.

foreach (block item in blockL)
                {
                    if (item.bid == 414)
                    {
                        if (item.y < 25)
                        {

                        }
                        else
                        {
                            con.Send(worldkey, 0, item.x, item.y, 9);
                            Thread.Sleep(27);
                        }
                    }
                }

Sorry for double-post.


signature.png

Offline

#5 2015-08-29 23:13:35

den3107
Member
From: Netherlands
Joined: 2015-04-24
Posts: 1,025

Re: [Solved] Regenerating dug blocks

Use a for loop, check if the block at index i has ID 414 and if true, then change it to whatever. That simple

Or am I missing something? Please correct me if I am.

Offline

#6 2015-08-30 00:17:26

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

Re: [Solved] Regenerating dug blocks

ParadoxInTheVoid wrote:

The code I'm currently uses place 3 blocks then returns an error.

-snip-

Sorry for double-post.

Could be that since you are placing a block during the loop, it changes the value of the list, causing the foreach to crash. I would use a for loop instead of a foreach.

Offline

#7 2015-08-30 00:50:16

Cyral
Member
From: United States
Joined: 2015-02-15
Posts: 2,269

Re: [Solved] Regenerating dug blocks

returns an error.

If you give us a vague reason you will get a vague answer.  You need to provide the actual error.


Player Since 2011. I used to make bots and stuff.

Offline

#8 2015-08-30 01:32:44, last edited by ParadoxInTheVoid (2015-08-30 06:57:03)

ParadoxInTheVoid
Member
From: ̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺
Joined: 2015-02-18
Posts: 341

Re: [Solved] Regenerating dug blocks

Cyral wrote:

returns an error.

If you give us a vague reason you will get a vague answer.  You need to provide the actual error.

Apologies. The error tells me it was Unhandled by user code. There wasn't a really specific error. It just said that.

EDIT: http://prntscr.com/8ai2gk <--- This, actually.


signature.png

Offline

#9 2015-08-30 11:30:12

Processor
Member
Joined: 2015-02-15
Posts: 2,246

Re: [Solved] Regenerating dug blocks

Closed on request by OP.


I have never thought of programming for reputation and honor. What I have in my heart must come out. That is the reason why I code.

Offline

Processor1440930612536449

Board footer

Powered by FluxBB

[ Started around 1732460784.8998 - Generated in 0.049 seconds, 12 queries executed - Memory usage: 1.52 MiB (Peak: 1.69 MiB) ]