Creates a bot instance
Internal use only
Height of the current canvas
Width of the current canvas
Current load barrier index
Internal use only
Draws an image.
A promise that resolves once the image is done drawing, contains place results for all placed pixels.
Draws a line between two positions (experimental).
Draws an outline
Draws a rectangle
Draws text.
The ending position of the text.
Emits a packet type and value through the socket.
Packet type.
Optionalvalue: PacketSendMap[T]Value. If not set, no value will be sent through other than the packet name.
A promise that will complete once the bot is actively connected; this is usually instant, it only waits if the bot crashes
The name of the area. E.g. "United States"
An IArea instance containing info on the area.
This is used if you want to get the area from a raw packet since the packets give id's rather than names.
The id of an area
An IArea instance containing info on the area.
All war locations and stats on them.
Returns the canvas data
Gets the url to a canvas image png;
This will automatically convert canvas 0 to blank.png as done in pixelplace normally.
This will also add Date.now() for caching
Gets the closest color to an r,g,b value
The current war zone. Or "NONE" if a war is not found.
Gets painting data
The canvas to get painting data of
If it should reload or return the cached value when called again. Defaults to false.
Connected or not. Not too useful. Defaults to true.
Gets the color of the pixel at x,y coordinates.
Gets the color being protected at a position, or undefined if not protected
Gets a random color
Gets the regional data for a pixel
This only works on canvas 7.
Region data has the name, botting status, and repairing status.
Creates a unique player id based on a user's name.
This utilizes the creation date of the account, which is unique for all players, and converts it into a UUID
This is deterministic, and the same name will always give the same UUID regardless of session.
Gets user data
Name of the user
If it should reload or return the cached value when called again. Defaults to false
Gets an account username from the uid. Requires the uid manager enabled.
The uid of the account.
The username from the uid.
If the chat is loaded or not. (true/false)
If the connection is open
This does not account for the current war zone or if a war is occuring.
X position of pixel
Y position of pixel
If a pixel is in a war zone (true/false)
This does not account for if a war is occurring. You can check if a pixel is in the current war with isPixelInWarZone(bot.getCurrentWarZone(), x, y)
Name of the war zone
X position of pixel
Y position of pixel
If a pixel is within a specific war zone.
If the spot is protected or not
A color id.
If it's a valid color or not.
if an x,y is on the canvas
If a war is occurring (true/false)
Amount of detected new lag ms; based on pixel confirm response times
Ms to increase pixels when lagging; per lag amount ms
Current load data
Max time a pixel will be waiting for. Setting place rate will increase this if it's higher.
Enables a listener for a packet. When the packet is received, the function will be called.
The packet to listen for.
The function to execute upon receiving it.
Optionalpre: booleanIf true, the function will be called before ppjs processes it (only applies to 42[] packets). Defaults to false.
Places a pixel
A promise that resolves upon the pixel being sent.
Plays an animation. If repeats is -1, it'll play forever and will skip the await. You can then use AnimationDrawer#stop
If the bot is premium
Directly protects a pixel. This does not place the pixel down.
The x coordinate of the pixel.
The y coordinate of the pixel.
The color of the pixel.
If it should replace pre-existing protection; defaults to false
amount of pixels in the sent queue; this is how many are waiting on confirmation
Shouldn't be edited by the user. This is the rate change packet.
If the bot is ratelimited.
Amount of time ratelimited for.
Sends a value through the socket. It's recommended to use emit() over this.
The value to send.
A promise that will complete once the bot is actively connected; this is usually instant, it only waits if the bot crashes
This is used internally. Calling this probably won't do anything but I don't recommend it.
Sets the placement speed of the bot
Either a direct number or a function for the pixeling
If the rate should automatically be updated to be rate_change value -- won't do anything if you use a function
Suppress warnings if the number is below bot.rate
Sorts the current queue with a drawing mode
You can take advantage of this by adding a bunch of pixels into queue with async: false, then sort.
Special pixel queue info
Statistics that are modified internally. Use getStatistics() instead, since it updates other things.
Amount of sustained packets
Directly unprotects a pixel.
X of the pixel
Y of the pixel
The user id of the bot
Username of the bot
Adds a listener for all sent and received packets
Connects the bot to pixelplace.
A promise that will resolve once the socket opens.
Gets the connection instance
This does not verify the bot is connected, you can use await connection.verify(); for that
Pixeling rate requested by pixelplace
Statistics
The statistics of the bot.
Initiates the bot.
A promise that will resolve once the bot connects and is fully loaded.
Loads the bot fully. This should always be ran directly after Connect() or the bot won't function.
A promise that will resolve once the bot is fully loaded.
Sets the request headers. This will automatically add the auth cookie.
Pixelplace bot instance.
Contains helper functions etc.