Blender Python Script doesnt work

Hi there, ive tried to run a Python Script from old Blender on the latest 2.63 which doesnt work. It says “ImportError: No module named Blender”

after a search trough the internets it says, that there is no need to import the module. Unfortunatelly dont know python scripting. Maybe someone can translate this PY Script to make it useable. Thanks in advance!

#!BPY

"""
Name: 'GM6.1 (*.d3d)'
Blender: 237
Group: 'Export'
Tooltip: 'Export GM6.1 model'
"""

import Blender

def QuadToTri(face):
    vl1 = [face.v[0], face.v[1], face.v[3]]    # make v lists for two triangles from quad
    vl2 = [face.v[1], face.v[2], face.v[3]]

    f1 = Blender.NMesh.Face(vl1)        # create two triangles from v lists
    f2 = Blender.NMesh.Face(vl2)

    return [f1, f2]                # return triangles combined as list


def WriteMod(fName):
    EXPORT_VNORMS = Blender.Draw.Create(0)    # create popup buttons
    EXPORT_FNORMS = Blender.Draw.Create(1)
    EXPORT_UVS = Blender.Draw.Create(1)

    pupBlock = [\
        ("Normal type..."),\
        ("Vertex normals", EXPORT_VNORMS, "Use vertices' normals, else use faces'"),\
        ("Face normals", EXPORT_FNORMS, "Use faces' normals, else use vertices'"),\
        ("Extra data..."),\
        ("UV coords", EXPORT_UVS, "Export vertices' texture coordinates"),\
    ]

    Blender.Draw.PupBlock("Export...", pupBlock)    # display popup block

    if EXPORT_VNORMS.val == True:            # choose if not definite decision
        EXPORT_FNORMS.val = False
    elif EXPORT_FNORMS.val == True:
        EXPORT_VNORMS.val = False

    EXPORT_VNORMS = EXPORT_VNORMS.val
    EXPORT_FNORMS = EXPORT_FNORMS.val
    EXPORT_UVS = EXPORT_UVS.val

    scale = Blender.Draw.PupFloatInput("Scale", 1, 0, 1000)    # get scale

    Blender.Window.EditMode(0)    # change to object mode and display wait cursor
    Blender.Window.WaitCursor(1)

    out = file(fName, "w")        # make file, get current object data
    scn = Blender.Scene.GetCurrent()
    ob = scn.objects.active
    mesh = ob.data

    tFaces = []            # list of only triangle faces
    for f in mesh.faces:
        if len(f.v) == 4:
            tFaces += QuadToTri(f)
        elif len(f.v) == 3:
            tFaces.append(f)

    vCount = len(tFaces) * 3
    commandCount = (vCount + 2 + (vCount // 499.5))    # calculate number of commands to be written
    vCount = 0

    out.write("100
")        # write necessary value, no. of commands and begin primitive
    out.write("%i
" % (commandCount))
    out.write("0 4.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
")

    for f in tFaces:        # loop through faces
        for v in f.v:        # loop through verts of current face
            if EXPORT_UVS:
                out.write("8 ")
            else:
                out.write("7 ")

            out.write("%.4f %.4f %.4f " % (v.co.x*scale, v.co.y*scale, v.co.z*scale))

            if EXPORT_VNORMS:
                out.write("%.4f %.4f %.4f " % (v.no.x, v.no.y, v.no.z))
            else:
                out.write("%.4f %.4f %.4f " % (f.no[0], f.no[1], f.no[2]))

            out.write("%.4f %.4f 0.0000 0.0000
" % (v.uvco.x, v.uvco.y))

            vCount = vCount + 1

            if vCount >= 999:    # check for vertex count overflow. end and start new primitive if necessary
                out.write("1 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
")
                out.write("0 4.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
")
                vCount = 0

    out.write("1 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
")
    out.close()    # write final end primitive and close file

    Blender.Window.WaitCursor(0)    # display normal cursor


Blender.Window.FileSelector(WriteMod, "Export GM6.1 Model", Blender.sys.makename(ext=".d3d"))    # run function

Your script shown is for Blender <= 2.48 at least surely not for Blender 2.63!
So you need help for a ‘general’ conversion …