Python plugin

ysc3839

  • VC:MP Beta Tester
  • Posts: 583
Python plugin
«  »Last edited
I decided to write this because IRC bot written in Squirrel is buggy. And I don't like reinventing the wheel. So I choose Python since it has many useful libraries.

An IRC bot sample: https://gist.github.com/ysc3839/76418598bb6dd907c227bc7487fe269d
Unlike other plugins, this plugin exposes original functions to Python. Peoples can warp the functions as they like.

Project repository:
https://github.com/ysc3839/vcmp-python-plugin

Test code:
https://github.com/ysc3839/vcmp-python-test

1.0 released: https://github.com/ysc3839/vcmp-python-plugin/releases/tag/v1.0

Note: You may need to rename this plugin because the server can't take long filename.

.

  • VC:MP Beta Tester
  • .
  • Posts: 1,803
[WIP] Re: Python plugin
« Reply #1,  »
Heh, wanted to do this myself a few days ago when I looked at the state of that binding library. But then I realized I hate Python's syntax :D
.

Mahmoud Tornado

  • Full Member
  • Posts: 212
[WIP] Re: Python plugin
« Reply #2,  »
Quote from . on August 26th, 2017, 12:06 PM
Heh, wanted to do this myself a few days ago when I looked at the state of that binding library. But then I realized I hate Python's syntax :D
Nice Name

ysc3839

  • VC:MP Beta Tester
  • Posts: 583

AlecuMadalin32

  • Newbie
  • Posts: 32

ℛḝξ☂

  • Jr. Member
  • V
  • Posts: 93
Re: Python plugin
« Reply #5,  »
Good luck with this project!

ysc3839

  • VC:MP Beta Tester
  • Posts: 583
Re: Python plugin
« Reply #6,  »
Note: You may need to rename this plugin because the server can't take long filename.

31 characters length.
Code: [Select]
Plugin error >> dlopen() 'plugins/vcmp-python-plugin-cpy36-linux6.so' failed: plugins/vcmp-python-plugin-cpy36-linux6.so: cannot open shared object file: No such file or directory
Failed to load plugin: vcmp-python-plugin-cpy36-linux6

AlecuMadalin32

  • Newbie
  • Posts: 32
Re: Python plugin
« Reply #7,  »
Quote from ysc3839 on August 26th, 2017, 11:38 AM
I decided to write this because IRC bot written in Squirrel is buggy. And I don't like reinventing the wheel. So I choose Python since it has many useful libraries.

An IRC bot sample: https://gist.github.com/ysc3839/76418598bb6dd907c227bc7487fe269d
Unlike other plugins, this plugin exposes original functions to Python. Peoples can warp the functions as they like.

Project repository:
https://github.com/ysc3839/vcmp-python-plugin

Test code:
https://github.com/ysc3839/vcmp-python-test

1.0 released: https://github.com/ysc3839/vcmp-python-plugin/releases/tag/v1.0

Note: You may need to rename this plugin because the server can't take long filename.
good luck

ysc3839

  • VC:MP Beta Tester
  • Posts: 583
Re: Python plugin
« Reply #8,  »
1.0.2 released: download

This version compatible with 04rel004.
If you call new functions it will raise "NotImplementedError: server does not implement this function".
And new callbacks do not exist.

Changed output name to vcmp-python-plugin-cpyxx-(rel/dbg)(32/64).
Re: Python plugin
« Reply #9,  »Last edited
Added automated builds.
Linux Windows
No 32 bit builds for Linux.
Re: Python plugin
« Reply #10,  »
Version 1.0.4:
  • Python error message will log to server_log.txt.
  • The plugin will read "pymodule" from both "server.cfg" and "server32/64.cfg".
Download: Linux Windows