SRL Archive - MSI Suggestions

Function Headers Missing


Sir R. M8gic1an

2010-04-18 06:29:45

http://villavu.com/repositories/msi/Skills/Woodcutting.scar

[php]
{==============================================================================\
| MSI Group Scripting Include |
| WoodCutting.scar |
|==============================================================================|
| For all woodcutting routines. |
| |
\_____________________________________________________________________________}
[/php]

~RM

Dgby714

2010-04-18 06:54:52

[php]{==============================================================================\
| MSI Group Scripting Include |
| WoodCutting.scar |
|==============================================================================|
| For all woodcutting routines. |
| |
| * procedure MSI_WaitWhileChoppingEx; * by marpis |
| * function MSI_ChopTree; * by marpis |
| * function MSI_ChopInvFull; * by marpis |
| * function MSI_PowerChop; * by marpis and Coh3n |
\_____________________________________________________________________________}
[/php]

Naum

2010-04-18 07:08:11

From: Dgby714
[php]{==============================================================================\
| MSI Group Scripting Include |
| WoodCutting.scar |
|==============================================================================|
| For all woodcutting routines. |
| |
| * procedure MSI_WaitWhileChoppingEx; * by marpis |
| * function MSI_ChopTree; * by marpis |
| * function MSI_ChopInvFull; * by marpis |
| * function MSI_PowerChop; * by marpis and Coh3n |
\_____________________________________________________________________________}
[/php]


Thanks, committed.

Dgby714

2010-04-18 08:22:12

Been messing with python for a bit now and made this >.>

give it a File (File = "SomeRandFile.scar") and it should pop out a header for ya

Note: Dosnt add "by: blankity" to them though..

#!/usr/bin/env python

File = "./WoodCutting.scar"

ProjectName = "MSI Group Scripting Include"
Length = 80

def pad(x, l):
x = str(x)
while len(x) < l:
if(len(x) == l - 1):
x = x + " "
else:
x = " " + x + " "
return x

def padr(x, l):
x = str(x)
while len(x) < l:
x = x + " "
return x

def procedures():
f = open(File, 'r')
for line in f:
line = str(line)
text = ""
if(line.lower().find("forward") == -1):
if(line.lower().find("function") != -1):
if(line.lower().split()[0] == "function"):
text = line[:len(line) - 2]
if(line.lower().find("procedure") != -1):
if(line.lower().split()[0] == "procedure"):
text = line[:len(line) - 2]
if(text != ""):
if(text.find("(") != -1):
temp = text
bin = temp.find("(")
ein = temp.find(")")
text = temp[:bin] + temp[ein+1:]
print "| * " + padr(text, Length-6) +" |"
f.close()

if(File.find("/") != -1):
it = File.split("/")
FileName = it[len(it)-1]
elif(File.find("\\") != -1):
it = File.split("\\")
FileName = it[len(it)-1]
else:
FileName = File

print "{==============================================================================\\"
print "| " + pad(ProjectName, Length-4) + " |"
print "| " + pad(FileName, Length-4) + " |"
print "|==============================================================================|"
procedures()
print " \_____________________________________________________________________________}"