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-12 22:04:40, last edited by Tomahawk (2015-04-12 22:11:02)

Tomahawk
Forum Mod
From: UK
Joined: 2015-02-18
Posts: 2,837

[Alpha] TomaBot Deserialiser Library

Not another deserialiser!

On the other hand, I've created this .dll to allow a user to keep an up to date struct array of all the blocks in the world with only two lines of code!

Line 1:

public/static Deserialiser.Block[,] b;

Line 2 (at the very start of the con_OnMessage void/delegate):

Deserialiser.Deserialise(m, ref b);

The "Deserialise()" method will filter all incoming bot messages for block messages such as "br" (spikes) and "ts" (signs) and update the struct accordingly, as well as deserialising the world data in "init".

The struct in the Deserialiser called "Block" contains the following data:
- FG             - Foreground block ID;
- BG            - Background block ID;
- deaths       - Deaths needed to open/close a death door or gate;
- coins         - Coins needed to open/close a coin door or gate;
- purpleID    - ID of a switch, purple door or purple gate;
- soundID    - ID of a sound block
- rotation     - Rotation of a portal, spike or one-way block (0 = down, 1 = left, 2 = up, 3 = right);
- portalID    - ID of a regular or invisible portal
- targetID    - Target ID of a regular or invisible portal
- text          - Text on a sign, or on Guardian/Mod text
- roomID     - Room ID of a world portal

Examples:

string signText = b[50, 50].text;  // Gets the text written on a sign at position (50, 50);

if (b[25, 30].FG == 242) { con.Send("say", "Portal at (25, 30)"); }  //Announces the presence of a normal portal at (25, 30);

if (b[50, 50].FG == 374) { con.Send("say", "Room ID of world portal: " + b[50, 50].roomID); }  //Checks for a world portal at (50, 50).

I'll be updating this software regularly to accompany every EE update that adds new special blocks.

Download Page: http://tomabot.weebly.com/tomabot-deserialiser.html

The .dll comes with an almost foolproof instruction manual. I say "almost" because most don't bother to read the damn thing. //forums.everybodyedits.com/img/smilies/tongue   (Please do, there's more stuff!)

Enjoy!


One bot to rule them all, one bot to find them. One bot to bring them all... and with this cliché blind them.

Offline

#2 2015-04-12 22:19:11, last edited by Processor (2015-04-12 22:30:24)

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

Re: [Alpha] TomaBot Deserialiser Library

This seems to be a good alternative to all these frameworks, if you only need init parsing. (And it turns out that my init parse is very popular, so there is a need for it //forums.everybodyedits.com/img/smilies/wink)

but but but... this breaks after updates! //forums.everybodyedits.com/img/smilies/sad and it shouldn't be a great concern, as long as you keep this up to date.

Some suggestions:
- Make this Open Source: Chances are you leave EE some day, all our bots depending on this shouldn't break because of that!
- Put this on NuGet so I get update notifications automatically without having to call your ugly method //forums.everybodyedits.com/img/smilies/big_smile
- Clear doesn't re-draw the border
- USE THE DAMN NAMING CONVENTIONS


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

Processor1428873551494106

Board footer

Powered by FluxBB

[ Started around 1714797303.8068 - Generated in 0.087 seconds, 12 queries executed - Memory usage: 1.39 MiB (Peak: 1.49 MiB) ]