uakf.b
Chief Technical Officer
Distinct Contributor
Offline
Posts: 5139
|
 |
« Reply #180 on: November 23, 2010, 09:31:54 AM » |
|
That's because Krauzi made a plugin that would throw an error as an example. To stop it, go into ghost_directory/plugins/python and edit test_module.py so it looks like: import host def init( ): host.registerHandler( "StartUp", TestFunc1 )
def TestFunc1( CFG ): print( "Hello World!" )
Also, I don't understand how to get commands to work in lobby or in game. It doesn't ever seem to call onPlayerCommand.
|
|
|
|
« Last Edit: November 23, 2010, 10:29:54 AM by uakf.b »
|
Logged
|
|
|
|
|
Official GHost++ Home - Codelain.com
|
 |
« Reply #180 on: November 23, 2010, 09:31:54 AM » |
|
|
|
|
|
|
Logged
|
|
|
|
|
ilaggoodly
|
 |
« Reply #181 on: November 23, 2010, 03:52:45 PM » |
|
I made some more plugins for pyGHost++. calc is a simple calculator that supports addition, subtraction, multiplication, division, cosine, sine, tangent, power, and logs (it uses the algorithms here and here). gettime just returns the server time. rickroll randomly selects a line from an input file and outputs it. For some reason it doesn't work if you just put it in a separate directory like plugins/gettime/. The only way I could get it to work was by putting PLUGINNAME.py inside plugins/python, then editing __init__.py to import PLUGINNAME and calling init() function. I also tried !enableplugin but it didn't seem to do anything. Sorry I haven't been active for a bit, but I'll look into this... it was designed to work with !enableplugin (installplugin?)
|
|
|
|
|
Logged
|
|
|
|
|
Freaky
|
 |
« Reply #182 on: November 23, 2010, 05:10:50 PM » |
|
ilaggoodly your signature links to http://' http://www.banlist.nl/phpBB3'..thought u might want to correct that  also please have a look at my idea of a plugin in the other topic 
|
|
|
|
|
Logged
|
|
|
|
uakf.b
Chief Technical Officer
Distinct Contributor
Offline
Posts: 5139
|
 |
« Reply #183 on: November 23, 2010, 06:24:30 PM » |
|
This should remove duplicate bans (!dbduplicate) and delete draw dota games (!dbdraw). For duplicate bans, it runs: ALTER IGNORE TABLE bans ADD UNIQUE INDEX (botid, server, name, ip); ALTER TABLE bans DROP INDEX botid;
And to delete draws: result = SELECT gameid FROM dotagames WHERE winner = 0; for each gameid in result, DELETE FROM games WHERE id = gameid DELETE FROM dotagames WHERE winner = 0;
It does not read anything from the config file, so you'll have to edit it and insert your mysql database name, username, and password. Also, you need to install MySQLdb for it to work (it makes its own connection).
|
|
|
|
|
Logged
|
|
|
|
uakf.b
Chief Technical Officer
Distinct Contributor
Offline
Posts: 5139
|
 |
« Reply #184 on: November 23, 2010, 07:20:20 PM » |
|
I changed it so that you can also import banlists. For example: !dbimport 1 useast.battle.net http://www.banlist.nl/fetch_approved.php?realm=azeroth
|
|
|
|
|
Logged
|
|
|
|
pusX
Initiate
Offline
Posts: 7
|
 |
« Reply #185 on: December 02, 2010, 08:49:16 PM » |
|
Is there a Handler for when the player leave the channel?
|
|
|
|
|
Logged
|
|
|
|
Hatschi
Initiate
Offline
Posts: 16
|
 |
« Reply #186 on: December 19, 2010, 09:27:08 PM » |
|
I have problems to compile the source.
Can you maybe please compile pyGhost instead of just releasing the source code?
|
|
|
|
|
Logged
|
|
|
|
Krauzi
Technical Advisor
Distinct Contributor
Offline
Posts: 392
|
 |
« Reply #187 on: December 21, 2010, 02:10:07 AM » |
|
should already be compiled, but anyways: Im coding on a DLL based ghost version. Even python itself then will be a plugin. The advantage of this is that you can decide in what language you want to code: C++, Python, Lua, etc. The problem of the current pyGHost is, that boost::python isn't working as its supposed to work (e.g. ghost.adminGame == ghost.currentGame == ghost). Thats why im completely changing to the system back to the one used in the last versions. I think i can release it as a Christmas present 
|
|
|
|
|
Logged
|
|
|
|
h4x0rz88
Chief Technical Officer
Devoted Member
Offline
Posts: 274
|
 |
« Reply #188 on: December 21, 2010, 04:47:32 AM » |
|
This would actually be cool but can you make it work with .so too? Then it could be multiplatform (Win, Lin, Mac).
|
|
|
|
|
Logged
|
|
|
|
Krauzi
Technical Advisor
Distinct Contributor
Offline
Posts: 392
|
 |
« Reply #189 on: December 21, 2010, 12:51:03 PM » |
|
i payed attention to make it multiplatform, though i haven't tested it yet.
about the system in general: There are 2 possibilities to access the game/player/etc instances: 1.) Link the wohle thing statically -> if you change a method definition which changes a ghost behaviour, you have to recompile all plugins again 2.) Link the wohle thing dynamically -> no recompile needed, but a little bit slower (call of instance methods via method pointers which have to be dereferenced).
|
|
|
|
|
Logged
|
|
|
|
uakf.b
Chief Technical Officer
Distinct Contributor
Offline
Posts: 5139
|
 |
« Reply #190 on: December 26, 2010, 10:29:43 PM » |
|
Here are some plugins I made for pyGHost++ (there's a calculator, a database manager, a getplayers function, a gettime function, a random number function, a rickroll function, and a version function). Also, I attached a script based on part of the database manager that lets you import bans in "<name> <reason>" format, like http://www.banlist.nl/fetch_approved.php?realm=azeroth.
|
|
|
|
|
Logged
|
|
|
|
velievv
Initiate
Offline
Posts: 7
|
 |
« Reply #191 on: August 22, 2011, 11:54:25 PM » |
|
ummmmm is this project steel alive ?
i got confused ..... what do we need this system of plagins ? ghost is not huge program that compiles over hour . gui ..... who needs gui ?
the best gui is console gui.....
i'm linux user and to me host bot is somthing like 24/7 stable .......
and i dont thing that remote vps or what ever you gonna get is ronning windos ..... linux/unix and use screen ....i really like ghost++ 17.1 cb3
usually bot play one specific map .... wheter it dota / foot or what ever ......so why do we need all this plagins .... you can compile new one while old one works .....and it will be off only for minute...
|
|
|
|
|
Logged
|
|
|
|
uakf.b
Chief Technical Officer
Distinct Contributor
Offline
Posts: 5139
|
 |
« Reply #192 on: August 23, 2011, 11:39:00 AM » |
|
If you don't want to use plugins then good for you...? First, it works on any OS that GHost++ works on. Also, a GUI is to be written as a plugin, not directly included. There's no such thing as a console GUI (GUI stands for graphical user interface; command line would be CLI, command line interface). There's no reason that a plugin system would be unstable, and actually it would enable the bot to be on 24/7. I don't see the relation between pyGHost++ and instability; have you even tried the program out yet? Why the hell would you post here before you even look at it?
Lastly, a patch-based system has the risk of different patches colliding with each other; although this may happen with plugins, its less likely. And both allow the core program to be small while other features are implemented as plugins.
|
|
|
|
|
Logged
|
|
|
|
velievv
Initiate
Offline
Posts: 7
|
 |
« Reply #193 on: August 23, 2011, 06:27:08 PM » |
|
by console gui i meant curses-UI
don't get mad .....
i have to more question
when is new relise is coming out .
and why phyton and not perl ?
|
|
|
|
|
Logged
|
|
|
|
uakf.b
Chief Technical Officer
Distinct Contributor
Offline
Posts: 5139
|
 |
« Reply #194 on: August 23, 2011, 08:59:13 PM » |
|
by console gui i meant curses-UI
don't get mad .....
i have to more question
when is new relise is coming out .
and why phyton and not perl ?
Curses UI is another command line interface. This project has been abandoned, there won't be anymore releases in the original project. Python is awesome ( http://xkcd.com/353/).
|
|
|
|
|
Logged
|
|
|
|
|