web-esheep icon indicating copy to clipboard operation
web-esheep copied to clipboard

How do i Remove a Pet once started ?

Open Hansson0728 opened this issue 3 years ago • 2 comments
trafficstars

runnig Pet.remove() will remove sheeps most of the time, but the "black" ones wont be removed

Hansson0728 avatar May 13 '22 09:05 Hansson0728

Do you mean on the webpage? The script on the webpage is not able to create "childs" like a black sheep.

Adrianotiger avatar May 13 '22 09:05 Adrianotiger

i did this to fix it: added a "sheep" prefix to the creation of div: this.id = "sheep" + Date.now() + Math.random(),

to remove all sheeps var elements = document.querySelectorAll([id^="sheep"]); for (let i = 0; i < elements.length; i++) {

	while (elements[i].firstChild) {
		elements[i].firstChild.remove()
	}
	
}

Hansson0728 avatar May 13 '22 13:05 Hansson0728