[ADCH++] Python interface with scripting (WIP)

Python Script Releases, known supporting hubsofts for python scripting.

DSHub | ADCH++
Post Reply
Lanowen
Newbie
Posts: 3
Joined: 06 Mar 2010, 21:17

[ADCH++] Python interface with scripting (WIP)

Post by Lanowen » 22 May 2012, 01:39

I started working on this about a year or so ago slowly.

I've got most of the LUA functionality that was in place at the time into this Python version.

Some key features:
  • Uses python
  • Scripts loadable and unloadable at runtime (if written properly)
  • Some enhancements in user experience like help menu organization, command character can be changed, other random stuff I can't remember
  • Commands are run in threads so that CPU intensive and long running commands on the python side don't slow down chat and other users' interaction with the hub
  • A public command character, that when used can send hub responses publicly instead of only to the user who initiated the command if the script command supports it.
  • Other things I can't remember
I've also written a couple scripts which I will include as well.

8Ball: The regular 8ball script, will supply 1 of the 20 default answers to a query. Answers can be modified (removed, replaced, or added).

Calculate: A calculator which uses the python eval safely to evaluate most python expressions like mathematical functions, bitwise operations, and other random functions.

Dice: A dice roller, rolls 1-n sided dice.

History: A history script, can archive history from hub chat. Also included is a php script for parsing history files that can be used online for history archives if you want to.

LaTeX: Parses TeX formatted strings and supplies the correct unicode characters if they conform to UTF-8 formatting.

motd: Reads the motd.txt and send that to users when they log in. Using special formatting you can run python expressions to create a dynamic motd like greeting the user by name, outputting history, or things like outputting the current topic.

opchat: A bot that relays pm messages to all users level_op and above.

URLFollow: When links are posted in chat, URLFollows downloads a portion of the page's source and extracts the page title, or in special cases like youtube videos the video author and playtime as well, and that information to all users in the channel.

Code: Select all

[20:44:00] <Lanowen> http://www.dcbase.org/forums/
[20:44:00] * ADC Hub Title: DCBase • Index page (at http://www.dcbase.org)
WolframAlpha: Queries wolfram alpha with questions, and returns information to the hub.



Notes when compiling ADCH++:
There are three bugs currently in the bug tracker that are not applied to trunk. You should at least apply this patch https://bugs.launchpad.net/adchpp/+bug/920791
Others that are not required unless you need the functions in self written scripts include: https://bugs.launchpad.net/adchpp/+bug/920788 and https://bugs.launchpad.net/adchpp/+bug/920792

Test hub available to try at: adc://lanowen.com:4780
Attachments
PythonADCHPP.7z
run adchpp.py
(62.6 KiB) Downloaded 2078 times

Lanowen
Newbie
Posts: 3
Joined: 06 Mar 2010, 21:17

Re: [ADCH++] Python interface with scripting (WIP)

Post by Lanowen » 12 Jun 2012, 20:57

Fixed 8ball script and archived my windows msvc release build files hopefully for easier testing for some people.
Attachments
PythonADCHPP.7z
run adchpp.py
(612.05 KiB) Downloaded 4723 times

Lanowen
Newbie
Posts: 3
Joined: 06 Mar 2010, 21:17

Re: [ADCH++] Python interface with scripting (WIP)

Post by Lanowen » 21 Jul 2012, 02:46

Fixed disconnecting function in the Unthreader which is used my kicks/bans/drops.

If anyone is actually trying this out (lol), and you find some bugs just let me know what they are.
Attachments
PythonADCHPP.7z
run adchpp.py
(560.02 KiB) Downloaded 173 times

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest