PDA

View Full Version : Perl Script to pull out Command.cpp


Monrezz
02-12-2004, 02:10 PM
Don't suppose anyone has the time to write a small Perl script that would look in command.cpp and pull out every avaliable command from there, then export the list to addon.ini using the default values specified (in command.cpp)?

I notice addon.ini hasn't been updated for a while, yet a few new commands have been added.

Hmmm, don't think this is the right forum (not sure where really) but shucks it can be moved ;)

Monrezz

smogo
02-12-2004, 02:55 PM
perl -e 'while(<>){m/command_add\("(\w+)",.*,(\d+),.*$/ && print "!$1=$2\n"} ' command.cpp


should do it for most, while it does not handle #defines or variables, and some multi-line decls.

for the last command.cpp, got :

!sendop=200
!setstat=200
!help=0
!version=0
!eitem=200
!setfaction=170
!serversidename=0
!testspawn=200
!testspawnkill=200
!wc=200
!numauths=200
!setanim=200
...
!ban=150
!oocmute=200
!revoke=200
!checklos=10
!los=0

186 lines