OnPluginScreendraw error with python

Posted by Ogomez92 on Tue 22 Dec 2009 01:24 PM — 3 posts, 15,763 views.

#0
Hi.
Alright I'm trying to code a new screen reader implementation for mushClient in python, but every time the function OnPluginScreendraw is called I get a type mismatch error.
Even printing the line, printing hi, printing a number, every time its the same error.
I'll post the function here, its really short.
# world.AppendToNotepad("output", str(line)+"\r\n")
# if TTSReadNew:
# if (t==0) or (t==1):
# s.addText(str(line))
s.synthesize()
# s.synchronize()
As you can see, only using s.synthesize() which is uncommented I still get type mismatch and I sued synthesize before in other functions and it works fine.
If someone could tell me what I'm doing wrong here I'd really appreciate it.
Australia Forum Administrator #1
I seem to recall this problem is related to Python enforcing return codes. In other words, add:


return 0


at the end, or however you do it in Python to return a number to the calling function.
#2
Hey thanks that worked perfectly. I shall soon be releasing the tts_eci plugin once I get rid of a few crash bugs.