scripts help

Hi I wonder if I could help or pass on these script to version 2.6 of blender

1:

import GameLogic as g
cont = g.getCurrentController()
own = cont.getOwner()
sensor = cont.getSensor(“inflictDmg”)
target = sensor.getHitObject()

if hasattr(target,“hp”):
target.hp = target.hp - own.dmg

2:

import GameLogic as g
cont = g.getCurrentController()
own = cont.getOwner()
scene = g.getCurrentScene()
objList = scene.getObjectList()

#create a list of all enemies within range 100
#change this number to best fit your game area
g.enemyList=[]
for i in range(0,len(objList)):
obj = objList[i]
if hasattr(obj,“enemy”):
if own.getDistanceTo(obj) <100:
g.enemyList.append((obj.name))

3:

import GameLogic as g
cont = g.getCurrentController()
own = cont.getOwner()
objList = g.getCurrentScene().getObjectList()

track = cont.getActuator(“trackTo”)
motion = cont.getActuator(“motion”)

#check to see if there are any enemies within range
if len(g.enemyList) > 0:
#create a list of the enemies within range and their distances
#each list item has 2 parts: (distance, OBname)
enemyRanges = []
for i in range(0,len(g.enemyList)):
enemy = objList[g.enemyList[i]]
dist = own.getDistanceTo(enemy)
enemyRanges.append((dist,enemy.name))
#sort the list
#the first object will be the one with the shortest distance
enemyRanges.sort()
#get the second item (OBname) of the first list item
#then strips ‘OB’ from the string
nearestEnemy = enemyRanges[0][1][2:]
#set the trackTo actuator
track.setObject(nearestEnemy)
#activate the actuators
g.addActiveActuator(track,1)
g.addActiveActuator(motion,1)

else:
#if there are no enemies, activate only the motion actuator
g.addActiveActuator(track,0)
g.addActiveActuator(motion,1)

4: y este es el ultimo

import GameLogic as g

Set the distance that the tower fires here###

towerDistance=25

###Changing stuff after this could hurt you##

try:
g.oo
except AttributeError:
g.oo={}

td=towerDistance

def dist(oa,ob):
ax=oa.getPosition()
bx=ob.getPosition()
c=0
for i in range(len(ax)):
c+=(ax[i]-bx[i])**2

return c**.5

def objectNear(obj,str,d):
ro=None
rd=999
sc=g.getCurrentScene()
objs=sc.getObjectList()
for i in objs:
if i.getPropertyNames().count(str)>0:
#print dist(obj, i)
if dist(obj,i)<rd:
ro=i
rd=dist(i,obj)

if rd>d:
print rd
return None
else:
return ro

cc=g.getCurrentController()
obj=cc.getOwner()
tr=cc.getActuator(“track”)
sh=cc.getActuator(“shoot”)
to=tr.getObject()

try:
g.oo[obj.name]
except KeyError:
g.oo[obj.name]=None

if to==None:
nobj=objectNear(obj,“evil”,td)
tr.setObject(nobj)
g.oo[obj.name]=nobj
print nobj
print “lemons!”
else:

if dist(obj,g.oo[obj.name])>td:
print “monkeys!”
nobj=objectNear(obj,“evil”,td)
tr.setObject(nobj)
g.oo[obj.name]=nobj
print nobj

sc=g.getCurrentScene()

if to!=None:
g.addActiveActuator(tr,1)
g.addActiveActuator(sh,1)

PLEASE HELP