converter scripts 2.49b to 2.57b

I need help converting two scripts to work in blender 2.57b, can someone help me?

SCRIPT 1

cursor

import Rasterizer as r
import GameLogic as g
c = g.getCurrentController()
o = c.getOwner()
mouse = c.getSensor(“mouse”)
move = c.getActuator(“move”)
wx = r.getWindowWidth()/2
wy = r.getWindowHeight()/2
mx = mouse.getXPosition()
my = mouse.getYPosition()
x = 0.050
move.setDLoc((mx-wx)x,0,(my-wy)-x,0)
g.addActiveActuator(move,1)
r.setMousePosition(wx,wy)

SCRIPT 2

draw the line between two points

import GameLogic as GL
import Rasterizer as RS
from Mathutils import Vector
scene = GL.getCurrentScene()
cont = GL.getCurrentController()
own = cont.owner

objects = [obj for obj in scene.objects if “instance” in obj]
obj_count = len(objects)
if obj_count > 1:
for i in range(obj_count):
RS.drawLine(objects[i].position, objects[i-1].position, [1, 1, 1])

Have a look at the Game Engine Modules in this page.
http://www.blender.org/documentation/blender_python_api_2_57_release/