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 2018-11-18 16:37:53

Minisaurus
Banned

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?

Wooted by:

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

ILikeTofuuJoe
Member
From: Obvervable Universe
Joined: 2018-06-04
Posts: 1,770
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, last edited by SirJosh3917 (2018-11-18 17:26:53)

SirJosh3917
Formerly ninjasupeatsninja
From: USA
Joined: 2015-04-05
Posts: 2,095

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

Offline

#4 2018-11-18 17:57:01, last edited by LukeM (2018-11-18 18:05:11)

LukeM
Member
From: England
Joined: 2016-06-03
Posts: 3,009
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# ...)

Offline

Wooted by:
LukeM1542560221732482

Board footer

Powered by FluxBB

[ Started around 1711633171.8292 - Generated in 0.053 seconds, 12 queries executed - Memory usage: 1.41 MiB (Peak: 1.52 MiB) ]