SphereCommunity
Linux/Bash: Creating Axis2 Web-Profile - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Submissions (/Forum-Script-Submissions)
+--- Thread: Linux/Bash: Creating Axis2 Web-Profile (/Thread-Linux-Bash-Creating-Axis2-Web-Profile)



Linux/Bash: Creating Axis2 Web-Profile - wuffel - 05-24-2016 06:48 AM

Hello,
We were struggling a bit to deliver a complete itemlist for Axis2 to all our GameMasters and Players who help creating buildings on a special build-server. Since we dont want share the entire gameserver-logic with the whole world. Smile

So we made this - and it works fine.

File 1 should be a bashfile. Please be aware, that...
- you have to adjust the pathes
- need awk
- need unix2dos
- need axis 2.0.4j

Code:
#!/bin/bash
SCRIPTPATH="/home/of/your/scripts"
awk -f /path/of/srvScriptStrip.awk $SCRIPTPATH/*.scp $SCRIPTPATH/custom/*.scp $SCRIPTPATH/npcs/*.scp $SCRIPTPATH/items/*.scp $SCRIPTPATH/stone/*.scp >output.txt
unix2dos output.txt

Code:
File 2 - srvScriptStrip.awk:
BEGIN{
}
{
$0 = tolower($0)
sub(/^\xef\xbb\xbf/,"")
if (($0 ~ /^\[itemdef/) || ($0 ~ /^id/) || ($0 ~ /^defname/) || ($0 ~ /^\[defname/) || ($0 ~ /^\[typedef/) || ($0 ~ /^\[chardef/) || ($0 ~ /^group/) || ($0 ~ /^p=/) || ($0 ~ /^\[spell/) || ($0 ~ /^\[skill/) || ($0 ~ /^\[areadef/) || ($0 ~ /^category/) || ($0 ~ /^subsection/) || ($0 ~ /^description/) || ($0 ~ /^name/) || ($0 ~ /^dupelist/) || ($0 ~ /^dupeitem/) || ($0 ~ /^\[template/) || ($0 ~ /^\[spawn/) || ($0 ~ /\[itemdef/)){
print($0)
    }
}



RE: Linux/Bash: Creating Axis2 Web-Profile - karma - 05-24-2016 04:35 PM

Nice!


RE: Linux/Bash: Creating Axis2 Web-Profile - Coruja - 05-31-2016 02:30 AM

nice code Big Grin
but just a quick tip: sphere already have this function, you just need to set StripPath folder on sphere.ini and use STRIP console command, it will dump all template names (itemdef, spawndef, etc) to an external file that can be used on Axis/TNG


RE: Linux/Bash: Creating Axis2 Web-Profile - pointhz - 06-03-2016 05:30 AM

(05-31-2016 02:30 AM)Coruja Wrote:  nice code Big Grin
but just a quick tip: sphere already have this function, you just need to set StripPath folder on sphere.ini and use STRIP console command, it will dump all template names (itemdef, spawndef, etc) to an external file that can be used on Axis/TNG

Coruja, does that mean you dont have to add code like

CATEGORY=
SUBSECTION=
DESCRIPTION=

To every item so that it shows up on axis?

Can you just script everything normally and then do that you just said to use axis?