Skip to content

Instantly share code, notes, and snippets.

View Frago9876543210's full-sized avatar

Frago9876543210

View GitHub Profile
@Frago9876543210
Frago9876543210 / ui.php
Last active March 30, 2018 06:31
simple form
<?php
namespace ui;
use pocketmine\event\Listener;
use pocketmine\event\player\PlayerInteractEvent;
use pocketmine\event\player\PlayerJoinEvent;
use pocketmine\event\server\DataPacketReceiveEvent;
use pocketmine\item\Item;
use pocketmine\network\protocol\v120\ModalFormResponsePacket;
@Frago9876543210
Frago9876543210 / Gui.cs
Created September 7, 2017 12:59
inv menu
using MiNET.Items;
using MiNET.Net;
using MiNET.Plugins;
using MiNET.Plugins.Attributes;
using MiNET.Utils;
using TestPlugin.Player;
namespace GuiPlugin
{
[Plugin]
@Frago9876543210
Frago9876543210 / info.php
Last active July 11, 2018 11:17
Get server info
<?php
/**
* Script for get info from target server
* @link https://github.com/Frago9876543210
* @author Frago9876543210
*/
declare(strict_types=1);
<?php
declare(strict_types=1);
namespace test;
use pocketmine\entity\Skin;
use pocketmine\event\Listener;
use pocketmine\event\player\PlayerChatEvent;
<?php
class Skin{
public static function getTextureFromFile(string $filename) : string{
$im = imagecreatefrompng($filename);
list($width, $height) = getimagesize($filename);
$bytes = "";
for($y = 0; $y < $height; $y++){
for($x = 0; $x < $width; $x++){
$code = imagecolorat($im, $x, $y);
$bytes .= chr(($code >> 16) & 0xff) . chr(($code >> 8) & 0xff) . chr(($code >> 16) & 0xff) . ($code >> 24) & 0xff;
<code_scheme name="pmmp-code-style">
<PHPCodeStyleSettings>
<option name="ALIGN_PHPDOC_PARAM_NAMES" value="true" />
<option name="ALIGN_PHPDOC_COMMENTS" value="true" />
<option name="LOWER_CASE_BOOLEAN_CONST" value="true" />
<option name="LOWER_CASE_NULL_CONST" value="true" />
<option name="KEEP_RPAREN_AND_LBRACE_ON_ONE_LINE" value="true" />
<option name="SPACE_BEFORE_CLOSURE_LEFT_PARENTHESIS" value="false" />
<option name="SPACE_BEFORE_COLON_IN_RETURN_TYPE" value="true" />
<option name="PLACE_PARENS_FOR_CONSTRUCTOR" value="2" />
package main
/*
#include <stdlib.h>
#include "HCNetSDK.h"
*/
import "C"
import(
"os"
"fmt"
2017-12-26 10:30:10,034 DEBUG MiNET.Client.MiNetClient - PlayerEquipment: Entity ID: 19, Selected Slot: 9, Slot: 0, Item ID: 0
2017-12-26 10:30:10,034 DEBUG MiNET.Client.MiNetClient - > Receive: 13 (0x0d): McpeAddEntity
2017-12-26 10:30:10,048 DEBUG MiNET.Client.MiNetClient - McpeAddEntity Entity ID: -4294967290
2017-12-26 10:30:10,048 DEBUG MiNET.Client.MiNetClient - McpeAddEntity Runtime Entity ID: 4
2017-12-26 10:30:10,048 DEBUG MiNET.Client.MiNetClient - Entity Type: 2118423 - 0x205317
2017-12-26 10:30:10,048 DEBUG MiNET.Client.MiNetClient - Entity Family: 83 - 0x53
2017-12-26 10:30:10,048 DEBUG MiNET.Client.MiNetClient - Entity Type ID: 23 - 0x17 Horse
2017-12-26 10:30:10,048 DEBUG MiNET.Client.MiNetClient - X: 781.3013
2017-12-26 10:30:10,048 DEBUG MiNET.Client.MiNetClient - Y: 4
2017-12-26 10:30:10,048 DEBUG MiNET.Client.MiNetClient - Z: 11.02353
2017-12-26 11:31:22,560 WARN MiNET.Client.MiNetClient - Connecting to: 192.168.43.1:19132
2017-12-26 11:31:22,674 DEBUG MiNET.Client.MiNetClient -
2b 00 00 00 00 00 00 00 +.......
2017-12-26 11:31:22,675 INFO MiNET.Client.MiNetClient - Initializing...
2017-12-26 11:31:22,763 INFO MiNET.Client.MiNetClient - Server open for business for TheGrey
2017-12-26 11:31:22,776 WARN MiNET.Client.MiNetClient - Client listening for connecting on: 0.0.0.0:59760
2017-12-26 11:31:22,875 INFO MiNET.Utils.Config - Trying to load config-file C:\Users\alex\Desktop\minet 1.2 dev\MiNET\src\MiNET\MiNET.Client\bin\Debug\server.alex.conf
2017-12-26 11:31:22,875 INFO MiNET.Utils.Config - Trying to load config-file C:\Users\alex\Desktop\minet 1.2 dev\MiNET\src\MiNET\MiNET.Client\bin\Debug\server.conf
2017-12-26 11:31:22,875 INFO MiNET.Utils.Config - Loading config-file C:\Users\alex\Desktop\minet 1.2 dev\MiNET\src\MiNET\MiNET.Client\bin\Debug\server.conf
@Frago9876543210
Frago9876543210 / NBTDumper.php
Last active July 31, 2018 12:12
NBT object to code
<?php
declare(strict_types=1);
namespace NS;
use pocketmine\nbt\NBTStream;
use pocketmine\nbt\NetworkLittleEndianNBTStream;
use pocketmine\nbt\tag\NamedTag;