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.
I'm new to EE bot programming and I want to know how to tell where a block already in your world before you connected your bot is. I'm trying to make something where a block will continue to move downward until it touches another block :I
Offline
EE sends all the info about the world in the init message. That includes block data but it's not easy to figure out if you're new to computers. I believe a user has published their own INITPARSE. Further, someone made one that acclaimedly does not break.
You need to take this init data and save it to memory to access later, updating it with the b messages.
Offline
Proc made initparse.cs
http://forums.everybodyedits.com/viewtopic.php?id=26792
Edit: req to Proc to rename the thread to make it easier to locate, I only remember the name because I've looked for it ... twice (starred on github so shouldn't have any issues finding it again though)
Thank you eleizibeth ^
I stack my signatures rather than delete them so I don't lose them
Offline
I'm a little confused on how to use this? Can someone explain it to me?
Offline
I'm a little confused on how to use this? Can someone explain it to me?
Do normal bot code, just don't send "init2". Only send "init"
Then you'll recieve "init".
You can use initparse to figure out where blocks are.
Offline
If you're new to bots, I suggest you don't start off with something this complicated. You need a deserialiser to analyse all the block data in "init", which is complex code, and on top of that you'll need to listen to every block message so that your block data stays updated. If you want perfect map data, that means listening for "b", "pt", "br", "ts", "lb", "pt", "wp", "bc" and probably some others I've forgotten.
One bot to rule them all, one bot to find them. One bot to bring them all... and with this cliché blind them.
Offline
Awww ;c so how would I go about figuring this out? ;-; I really want to learn how to make something like this.
Offline
Awww ;c so how would I go about figuring this out? ;-; I really want to learn how to make something like this.
Isn't there an example code in the readme? The first time I used initparser I looked at the example.
Offline
Artistjr5000 wrote:Awww ;c so how would I go about figuring this out? ;-; I really want to learn how to make something like this.
Isn't there an example code in the readme? The first time I used initparser I looked at the example.
There is, but when I started off I was also like: "Thafuq am I supposed to do with this?"
Obviously I had my own block objects, and I wanted to receive the block data in a specific manner.
Basically it resulted in me having to read the code and understand it just to make the smallest of changes.
Offline
*u stinky*
Offline
Well I got the initparse to work, but now I don't know how to detect blocks placed in the world AFTER the bot connects :I The Struggle. I made a thingy where u can place a block and it keeps moving downward until it reaches another block that was in the world prior to the bot connecting, but it doesn't detect blocks placed after the bot connected ;c Also, when you delete a block that was in the world before the bot, it doesn't detect that the block was removed.
Offline
Well I got the initparse to work, but now I don't know how to detect blocks placed in the world AFTER the bot connects :I The Struggle. I made a thingy where u can place a block and it keeps moving downward until it reaches another block that was in the world prior to the bot connecting, but it doesn't detect blocks placed after the bot connected ;c
You need to listen for block messages.
See Everybody Edits Protocol for more information about individual message types and their parameters.
*u stinky*
Offline
Well, I get that part, but do I have to store the block's position in a List or something and remove it when the block is removed?
Offline
You could, yes.
I would assume you'd be using Linq, and although that isn't extremely performant, you probably wouldn't notice any declination.
*u stinky*
Offline
no idea what linq is
Offline
You could, yes.
I would assume you'd be using Linq, and although that isn't extremely performant, you probably wouldn't notice any declination.
Then what is the best way to store points?
Offline
XxAtillaxX wrote:You could, yes.
I would assume you'd be using Linq, and although that isn't extremely performant, you probably wouldn't notice any declination.Then what is the best way to store points?
I think using a List<T> is perfectly fine.
The only (barely tangible, in most cases) performance costs are from the overhead with Linq iterating over a collection lazily.
*u stinky*
Offline
SmittyW wrote:XxAtillaxX wrote:You could, yes.
I would assume you'd be using Linq, and although that isn't extremely performant, you probably wouldn't notice any declination.Then what is the best way to store points?
I think using a List<T> is perfectly fine.
The only (barely tangible, in most cases) performance costs are from the overhead with Linq iterating over a collection lazily.
Lel I use a 3D array where obviously the id's of the array are the positions [x,y,layer]. Wonder which one would be faster (Mine probably would cost a whole lot more on memory, not that you'd notice though).
Offline
[ Started around 1732401847.0276 - Generated in 0.099 seconds, 13 queries executed - Memory usage: 1.67 MiB (Peak: 1.89 MiB) ]