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-11-15 21:24:15

AK712
Member
Joined: 2015-02-16
Posts: 94

Two Users, One Bot

Hello everyone,

So It's become clear that I'll need to two users to draw any large maps in worlds because of them being disconnected after X amount of blocks. However, I am unclear how to do this.

1) How do you add more than one user to a level with a bot? I've never made a bot that added more than one user, so I have no clue.

2) How do you control which of the users in the level draws a tile? Do they generate a different world key?

3) How do you control which user receives data from the non-bot users in the level?

These three questions are what are keeping me back from my progress on my bots. Any help would be appreciated.


O4DmNuI.png

Offline

#2 2015-11-15 21:31:37

Prodigy
Member
From: The United States of America
Joined: 2015-07-15
Posts: 2,613

Re: Two Users, One Bot

What size because I want to help you


h0qIF0q.png

Offline

#3 2015-11-15 21:32:55

Krosis
Formerly Arkonagames
Joined: 2015-06-17
Posts: 2,279
Website

Re: Two Users, One Bot

what this title remembers...
( ͡° ͜ʖ ͡°)


Krosis.gif

Offline

Wooted by: (5)

#4 2015-11-15 22:54:24, last edited by Koya (2015-11-15 22:54:33)

Koya
Fabulous Member
From: The island with those Brits
Joined: 2015-02-18
Posts: 6,310

Re: Two Users, One Bot

Add bots to a list and then call

bot[i].Send(data);
(i < bot.count - 1) ? i++ : i = 0;

Po9cnQh.png

PLNQVL8.png
Thank you eleizibeth ^

1SYOldu.png

I stack my signatures rather than delete them so I don't lose them
giphy.gif

WfSi4mm.png

Offline

Wooted by:

#5 2015-11-15 23:25:26

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

Re: Two Users, One Bot

With bots, Koya means connections.
Each connection represents a bot connected.

I could hand you a little bot of which I know which works (for me), if it doesn't for you then it might also be a smart idea to ask a moderator why.

What you can also do, is that whenever a bot gets disconnected (in case it's unresolvable), listen to it being disconnected and start it back up.

Offline

#6 2015-11-16 00:54:23

AlphaJon
Member
From: Who knows
Joined: 2015-07-21
Posts: 1,297

Re: Two Users, One Bot

AK712 wrote:

1) How do you add more than one user to a level with a bot? I've never made a bot that added more than one user, so I have no clue.

Make 2 connections, the same way you would do one for one user, you can even attach both of them to the same OnMessage

AK712 wrote:

2) How do you control which of the users in the level draws a tile? Do they generate a different world key?

capasha.com wrote:

    # b - UserID added bricks, decorations, backgrounds (Blocks)
    [0] <Integer> Layer (BackGround = 1, ForeGround = 0)
    [1] <Integer> PosX
    [2] <Integer> PosY
    [3] <Integer> BlockID
    [4] <Integer> UserID

The UserID tells you who placed a block, the UserID <-> UserName matches can be made using the "add" message:

capasha.com wrote:

    # Add - UserID joined the room
    [0] <Integer> ID
    [1] <String> UserName
    [2] <String> UserID
And many other messages(snipped out)

3) How do you control which user receives data from the non-bot users in the level?

I'm not sure about this one, so I'll just let someone else provide a better answer. Otherwise, most messages are sent to all users, with some exceptions I won't list here

Offline

#7 2015-11-16 05:16:00

AK712
Member
Joined: 2015-02-16
Posts: 94

Re: Two Users, One Bot

I'm having trouble having both bots place blocks. Only one seems to be able to, despite using two different "connection.Send"s. Do I need to make two different world keys?


O4DmNuI.png

Offline

#8 2015-11-16 08:48:22

capasha
Member
Joined: 2015-02-21
Posts: 4,066

Re: Two Users, One Bot

AK712 wrote:

I'm having trouble having both bots place blocks. Only one seems to be able to, despite using two different "connection.Send"s. Do I need to make two different world keys?

Yes you need different worldkeys. Two connections.

Offline

#9 2015-11-16 15:18:46

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

Re: Two Users, One Bot

Just... Copy all your code, paste it in a new file, rename your "Program" class to "Program2", your "void Main" to "void Main2" and in your program add this:

static void Main() {
     Program2.Main2();

     // Do stuff you normally do here
}

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

#10 2015-11-16 16:40:36

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

Re: Two Users, One Bot

Jonathan1003 wrote:
capasha.com wrote:

    # b - UserID added bricks, decorations, backgrounds (Blocks)
    [0] <Integer> Layer (BackGround = 1, ForeGround = 0)
    [1] <Integer> PosX
    [2] <Integer> PosY
    [3] <Integer> BlockID
    [4] <Integer> UserID

Actually the last one is tickId, used for the campaign levels, can fill in any integer there.

Offline

#11 2015-11-16 18:08:26

capasha
Member
Joined: 2015-02-21
Posts: 4,066

Re: Two Users, One Bot

den3107 wrote:
Jonathan1003 wrote:
capasha.com wrote:

    # b - UserID added bricks, decorations, backgrounds (Blocks)
    [0] <Integer> Layer (BackGround = 1, ForeGround = 0)
    [1] <Integer> PosX
    [2] <Integer> PosY
    [3] <Integer> BlockID
    [4] <Integer> UserID

Actually the last one is tickId, used for the campaign levels, can fill in any integer there.

Is there really a tickid for blocks?

Offline

#12 2015-11-16 18:32:01, last edited by Processor (2015-11-16 18:32:55)

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

Re: Two Users, One Bot

No, it is the userid. You are mistaking "b" for "m".


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

#13 2015-11-16 19:47:42

zioxei
Member
Joined: 2015-06-20
Posts: 847

Re: Two Users, One Bot

2users1bot.com :v


user.php?id=zioxei
user.php?id=thanksmom
( ͡° ͜ʖ ͡°)

Offline

zioxei1447699662559527

Board footer

Powered by FluxBB

[ Started around 1713497706.3066 - Generated in 0.235 seconds, 12 queries executed - Memory usage: 1.53 MiB (Peak: 1.69 MiB) ]