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 2016-05-05 10:34:37

Kikikan
Member
From: Hungary
Joined: 2015-08-10
Posts: 204

[Question] How can a bot teleport every player to a point?

I am currently making a bot and I would like to know how can the bot teleport every player to a specific location.
Any help is appreciated.
Thanks in advance.

Offline

#2 2016-05-05 10:39:45, last edited by Kaslai (2016-05-05 10:45:21)

Kaslai
Official Caroler
From: SEAͩT̓͑TLͯͥͧͪ̽ͧE͑̚
Joined: 2015-02-17
Posts: 787

Re: [Question] How can a bot teleport every player to a point?

All you need to do is iterate over all the players in the room and issue a teleport command for them all. Assuming you have a sane list of players already stored somewhere, one which provides the name of each player, you can do something like the following pseudocode.

int x = 100;
int y = 50;
for( player p in player_list ){
    connection.send("say", String.Format("/teleport {0} {1} {2}", p.name, x, y) );
}

Edit: made Proc happier

Offline

#3 2016-05-05 10:42:19

Kikikan
Member
From: Hungary
Joined: 2015-08-10
Posts: 204

Re: [Question] How can a bot teleport every player to a point?

Kaslai wrote:

All you need to do is iterate over all the players in the room and issue a teleport command for them all. Assuming you have a sane list of players already stored somewhere, one which provides the name of each player, you can do something like the following pseudocode.

string x = "100";
string y = "50";
for( player p in player_list ){
    connection.send("say", "/teleport " + p.name + " " + x + " " + y);
}

Thank you! That's what I was looking for! //forums.everybodyedits.com/img/smilies/big_smile

Offline

#4 2016-05-05 11:28:49

Zumza
Member
From: root
Joined: 2015-02-17
Posts: 4,656

Re: [Question] How can a bot teleport every player to a point?

Or the easier solution: you can pace a spawn point on that position
And send a world reset message.


Everybody edits, but some edit more than others

Offline

Zumza1462444129600620

Board footer

Powered by FluxBB

[ Started around 1732367015.728 - Generated in 0.030 seconds, 12 queries executed - Memory usage: 1.38 MiB (Peak: 1.48 MiB) ]