Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/newdelion/flowy
Awaitable for PocketMine-MP. MOVED(https://github.com/FlowyProject)
https://github.com/newdelion/flowy
pmmp pmmp-flowy pmmp-plugin pocketmine pocketmine-mp
Last synced: 3 months ago
JSON representation
Awaitable for PocketMine-MP. MOVED(https://github.com/FlowyProject)
- Host: GitHub
- URL: https://github.com/newdelion/flowy
- Owner: NewDelion
- License: lgpl-2.1
- Archived: true
- Created: 2018-03-11T13:27:54.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-15T06:55:49.000Z (over 6 years ago)
- Last Synced: 2024-09-26T10:21:52.284Z (3 months ago)
- Topics: pmmp, pmmp-flowy, pmmp-plugin, pocketmine, pocketmine-mp
- Language: PHP
- Homepage: https://github.com/FlowyProject
- Size: 35.2 KB
- Stars: 16
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Flowy
__Awaitable for PocketMine-MP__
# This project is moved => [FlowyProject](https://github.com/FlowyProject)## Install
__Composer__
```
composer config repositories.NewDelion/Flowy vcs https://github.com/NewDelion/Flowy
composer require NewDelion/Flowy:dev-master
```
__GitSubmodule__
```
git submodule add https://github.com/NewDelion/Flowy
```## Example
```php
filter(function($ev) use ($methodName, $obj, $strict){
if($strict){
return $ev->{$methodName}() === $obj;
}
else{
return $ev->{$methodName}() == $obj;
}
});
}
);
$this->start($this->heysiri());
}function heysiri(){
$event = yield listen(PlayerJoinEvent::class);
$this->start($this->heysiri());
$player = $event->getPlayer();$branch_quit = function(){ yield listen(PlayerQuitEvent::class); };
while(true){
$event = yield listen(PlayerChatEvent::class)
->filter_eq('getPlayer', $player)
->filter_eq('getMessage', 'heysiri')
->branch($branch_quit);$player->sendMessage("What can I help you with?\nGo ahead. I'm listening...");
$event->setCancelled();$event = yield listen(PlayerChatEvent::class)
->filter_eq('getPlayer', $player)
->timeout(20 * 15, [$player, 'sendMessage'], ["(♪popon)"], true)
->branch($branch_quit);if($event !== null){
$player->sendMessage("I'm not sure I understand.");
$event->setCancelled();
}
}
}
}
```