You are inserting variables into graphical command wrong way.
See this:
 Code:    x = 150 'MouseX
    y = 200 'MouseY
'your line - is wrong
    'print #game, "SPRITETRAVELXY ogre x y 30"
'see why
    print "Wrong:"
    print "SPRITETRAVELXY ogre x y 30"
    print "Right:"
    print "SPRITETRAVELXY ogre ";x;" ";y;" 30"
 
Output:  Code:Wrong:
SPRITETRAVELXY ogre x y 30
Right:
SPRITETRAVELXY ogre 150 200 30