Git Product home page Git Product logo

tetrio-bot's Introduction

tetrio-bot

bot to automatically play https://tetr.io. utilizing a modified eltetris and robotjs modules.

the bot automatically starts into zen mode and completes the first level.

install

$ sudo apt install chromium xserver-xephyr libxtst-dev libpng++-dev python g++ make
$ git clone https://github.com/misterhat/tetrio-bot
$ cd tetrio-bot && npm install

usage

make sure the game quality is set to minimal for the best performance.

$ ./tetrio.sh

license

Copyright (C) 2021 Zorian Medwid

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.

tetrio-bot's People

Contributors

misterhat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tetrio-bot's Issues

tetr.io requires webgl

Bot doesn't work, says tetr.io requires webgl.

Running KDE Wayland on endeavourOS (Arch-derivative), and I've installed everything.

cant install

errors installing. is there a specialised app needed to do so?

Error from the start

sh tetrio.sh
events.js:174
throw er; // Unhandled 'error' event
^

Error: spawn chromium ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
[... lines matching original stack trace ...]
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

Package 'chromium' has no installation candidate

Error while running command

sudo apt install chromium xserver-xephyr libxtst-dev libpng-dev python g++ make

if you need more infomation here :

reko@rekoPC:~$ sudo apt install chromium xserver-xephyr libxtst-dev libpng-dev python g++ make
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'python-is-python2' instead of 'python'
Package chromium is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  chromium-bsu

E: Package 'chromium' has no installation candidate

Errors on Errors.

Hi, I am having trouble with the installation of this. I have tried reinstalling my Linux VM, redownloading everything, even changing chromium and python versions. It will not work. this is the error message I receive:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package chromium is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  chromium-bsu

Package python is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  2to3 python2-minimal python2 dh-python python-is-python3

E: Package 'chromium' has no installation candidate
E: Package 'python' has no installation candidate
Cloning into 'tetrio-bot'...
remote: Enumerating objects: 27, done.
remote: Counting objects: 100% (27/27), done.
remote: Compressing objects: 100% (21/21), done.
remote: Total 27 (delta 9), reused 24 (delta 6), pack-reused 0
Receiving objects: 100% (27/27), 3.06 MiB | 8.10 MiB/s, done.
Resolving deltas: 100% (9/9), done.
npm ERR! code 1
npm ERR! path /home/graysengg/tetrio-bot/tetrio-bot/node_modules/robotjs
npm ERR! command failed
npm ERR! command sh -c prebuild-install || node-gyp rebuild
npm ERR! make: Entering directory '/home/graysengg/tetrio-bot/tetrio-bot/node_modules/robotjs/build'
npm ERR!   CXX(target) Release/obj.target/robotjs/src/robotjs.o
npm ERR! make: Leaving directory '/home/graysengg/tetrio-bot/tetrio-bot/node_modules/robotjs/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp info find Python using Python version 3.10.6 found at "/usr/bin/python3"
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/graysengg/tetrio-bot/tetrio-bot/node_modules/robotjs/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/graysengg/.cache/node-gyp/20.5.0/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/home/graysengg/.cache/node-gyp/20.5.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/graysengg/.cache/node-gyp/20.5.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/graysengg/tetrio-bot/tetrio-bot/node_modules/robotjs',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! cc1plus: warning: command-line option ‘-Wbad-function-cast’ is valid for C/ObjC but not for C++
npm ERR! In file included from ../../nan/nan.h:176,
npm ERR!                  from ../src/robotjs.cc:2:
npm ERR! ../../nan/nan_callbacks.h:55:23: error: ‘AccessorSignature’ is not a member of ‘v8’
npm ERR!    55 | typedef v8::Local<v8::AccessorSignature> Sig;
npm ERR!       |                       ^~~~~~~~~~~~~~~~~
npm ERR! ../../nan/nan_callbacks.h:55:40: error: template argument 1 is invalid
npm ERR!    55 | typedef v8::Local<v8::AccessorSignature> Sig;
npm ERR!       |                                        ^
npm ERR! In file included from ../src/robotjs.cc:2:
npm ERR! ../../nan/nan.h: In function ‘bool Nan::IdleNotification(int)’:
npm ERR! ../../nan/nan.h:682:63: warning: ‘bool v8::Isolate::IdleNotificationDeadline(double)’ is deprecated: Use MemoryPressureNotification() to influence the GC schedule. [-Wdeprecated-declarations]
npm ERR!   682 |     return v8::Isolate::GetCurrent()->IdleNotificationDeadline(
npm ERR!       |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
npm ERR!   683 |         idle_time_in_ms * 0.001);
npm ERR!       |         ~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! In file included from /home/graysengg/.cache/node-gyp/20.5.0/include/node/v8-initialization.h:13,
npm ERR!                  from /home/graysengg/.cache/node-gyp/20.5.0/include/node/v8.h:34,
npm ERR!                  from /home/graysengg/.cache/node-gyp/20.5.0/include/node/node.h:73,
npm ERR!                  from ../src/robotjs.cc:1:
npm ERR! /home/graysengg/.cache/node-gyp/20.5.0/include/node/v8-isolate.h:1293:8: note: declared here
npm ERR!  1293 |   bool IdleNotificationDeadline(double deadline_in_seconds);
npm ERR!       |        ^~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! In file included from ../src/robotjs.cc:2:
npm ERR! ../../nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, Nan::GetterCallback, Nan::SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, Nan::imp::Sig)’:
npm ERR! ../../nan/nan.h:2542:19: error: no matching function for call to ‘v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>&, void (*&)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&), void (*&)(v8::Local<v8::Name>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<void>&), v8::Local<v8::Object>&, v8::AccessControl&, v8::PropertyAttribute&, Nan::imp::Sig&)’
npm ERR!  2542 |   tpl->SetAccessor(
npm ERR!       |   ~~~~~~~~~~~~~~~~^
npm ERR!  2543 |       name
npm ERR!       |       ~~~~
npm ERR!  2544 |     , getter_
npm ERR!       |     ~~~~~~~~~
npm ERR!  2545 |     , setter_
npm ERR!       |     ~~~~~~~~~
npm ERR!  2546 |     , obj
npm ERR!       |     ~~~~~
npm ERR!  2547 |     , settings
npm ERR!       |     ~~~~~~~~~~
npm ERR!  2548 |     , attribute
npm ERR!       |     ~~~~~~~~~~~
npm ERR!  2549 |     , signature);
npm ERR!       |     ~~~~~~~~~~~~
npm ERR! In file included from /home/graysengg/.cache/node-gyp/20.5.0/include/node/v8-function.h:15,
npm ERR!                  from /home/graysengg/.cache/node-gyp/20.5.0/include/node/v8.h:33,
npm ERR!                  from /home/graysengg/.cache/node-gyp/20.5.0/include/node/node.h:73,
npm ERR!                  from ../src/robotjs.cc:1:
npm ERR! /home/graysengg/.cache/node-gyp/20.5.0/include/node/v8-template.h:809:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>, v8::AccessorGetterCallback, v8::AccessorSetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
npm ERR!   809 |   void SetAccessor(
npm ERR!       |        ^~~~~~~~~~~
npm ERR! /home/graysengg/.cache/node-gyp/20.5.0/include/node/v8-template.h:814:22: note:   no known conversion for argument 7 from ‘Nan::imp::Sig’ {aka ‘int’} to ‘v8::SideEffectType’
npm ERR!   814 |       SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
npm ERR!       |       ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! /home/graysengg/.cache/node-gyp/20.5.0/include/node/v8-template.h:816:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::Name>, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
npm ERR!   816 |   void SetAccessor(
npm ERR!       |        ^~~~~~~~~~~
npm ERR! /home/graysengg/.cache/node-gyp/20.5.0/include/node/v8-template.h:821:22: note:   no known conversion for argument 7 from ‘Nan::imp::Sig’ {aka ‘int’} to ‘v8::SideEffectType’
npm ERR!   821 |       SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
npm ERR!       |       ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! In file included from ../src/robotjs.cc:1:
npm ERR! ../src/robotjs.cc: At global scope:
npm ERR! /home/graysengg/.cache/node-gyp/20.5.0/include/node/node.h:1166:7: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
npm ERR!  1166 |       (node::addon_register_func) (regfunc),                          \
npm ERR!       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! /home/graysengg/.cache/node-gyp/20.5.0/include/node/node.h:1200:3: note: in expansion of macro ‘NODE_MODULE_X’
npm ERR!  1200 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
npm ERR!       |   ^~~~~~~~~~~~~
npm ERR! ../src/robotjs.cc:907:1: note: in expansion of macro ‘NODE_MODULE’
npm ERR!   907 | NODE_MODULE(robotjs, InitAll)
npm ERR!       | ^~~~~~~~~~~
npm ERR! make: *** [robotjs.target.mk:132: Release/obj.target/robotjs/src/robotjs.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:514:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm ERR! gyp ERR! System Linux 5.15.90.1-microsoft-standard-WSL2
npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /home/graysengg/tetrio-bot/tetrio-bot/node_modules/robotjs
npm ERR! gyp ERR! node -v v20.5.0
npm ERR! gyp ERR! node-gyp -v v9.4.0
npm ERR! gyp ERR! not ok

I thought it was an NPM problem, so I uninstalled it and re-installed it. I'm still getting these errors. If this is a problem, please fix it! I really just want to watch an AI play tetr.io.
Or more likely, I'm just being an idiot; please tell me what I'm doing wrong so I can fix it!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.