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.

Advertisement

Hello, visitor! These forums are run off of the revenue generated from these ads. If you'd like to support us, please whitelist us or consider donating:

#1 2018-11-18 16:37:53

Minisaurus
Design Team
From: Under your bed
Joined: 2015-02-26
Posts: 537

Request - Bot for switches numbers

I am looking for a bot that modify the number of the switches on a map.
For example I have 7000 switches with the number from 0 to 400 and want to increase all their numbers by 500, so I get those switches from 500 to 900 respectively.

Is there a bot that could do that?


3hEn3Lh.png
Note for EE moderators: I allow the introduction of any of my worlds for any official campaign.

Offline

Wooted by:

#2 2018-11-18 17:12:08

ILikeTofuuJoe
Banned
From: Obvervable Universe
Joined: 2018-06-04
Posts: 1,435
Website

Re: Request - Bot for switches numbers

For your question:  There is currently no bot that could do that.


https://wiki.everybodyedits.com/images/8/8f/117_cat ~meow~ https://wiki.everybodyedits.com/images/8/8f/117_cat
Posting Goal: 2000
#Joe Griffin
Signature
Thanks HG for the signature and avatar!!!

Offline

#3 2018-11-18 17:17:52

ninjasupeatsninja
Member
From: USA
Joined: 2015-04-05
Posts: 1,968
Website

Re: Request - Bot for switches numbers

here you go

//
// This is a simple example of using jsparse to store the blocks of a world!
// 
// In this example, we'll read every sign out to the console!
//
// ~by SirJosh3917/ninjasupeatsninja

var parseSigns = function(e) {
	// jsparse(e) will parse out the world, and we'll only accept anything that has id 385 ( signs )
	let switches = jsparse(e).filter(b => b.id == 113 || b.id == 467); // credit to https://github.com/atillabyte/EEWebs/blob/master/js/eewebs.js#L27
    let on = 0;
	// for every sign
	switches.forEach((i) => {

		// log it to the console
		console.log(i);
		
		if(i.args[0] <= 400)
		{
		    setTimeout(() => {
		        connection.send("b", i.layer, i.x, i.y, i.id, i.args[0] + 500);
		    }, on * 50);
		    on++;
		}
	});

	if(e.type == "init") {
		// send init2
		connection.send("init2");
	}
};

connection.addMessageCallback("init", parseSigns);
connection.addMessageCallback("reset", parseSigns);

connection.send("init");

run it with EEJSIDE

if it doesn't fit exactly to your standards, contact me on discord (SIrJosh3917#7234)

if you need to target gates/doors, just add "|| b.id == <block id of gate/door goes here>" in addition to this line here "let switches = jsparse(e).filter(b => b.id == 113 || b.id == 467);"

you may need to run it a few times to get all the switches depending on your internet

Last edited by ninjasupeatsninja (2018-11-18 17:26:53)

Offline

Wooted by:

#4 2018-11-18 17:57:01

LukeM
Dev Team
From: England
Joined: 2016-06-03
Posts: 2,529
Website

Re: Request - Bot for switches numbers

#PlugIt

The 'Builder' plugin, !selection map #id# args 0 from #from min# - #from max# to #to min#

You can put multiple IDs if you want to do doors, gates, and switches at the same time (!selection map #id1# #id2# ...)

Last edited by LukeM (2018-11-18 18:05:11)

Offline

Wooted by: (2)
LukeM1542560221732482

Board footer

Powered by FluxBB

[ Started around 1544907009.7398 - Generated in 0.024 seconds, 12 queries executed - Memory usage: 1.27 MiB (Peak: 1.39 MiB) ]