I am unable to get OnPluginPartialLine to work from python.
This is what I looked at first:
http://www.gammon.com.au/forum/bbshowpost.php?id=3774&page=2
But my VBScript knowledge just isn't good enough to get what I want.
I want to do something like:
Putting a world.Note("Plugin Match Found") there causes errors in my plugin. I get a pop-up saying Type Mismatch. But i have no idea what line the type mismatch is on. My hunch is that this is not a function in VB, so it must be something different to use in Python, but I have no clue.
Here is the code for my plugin at the moment:
Who can enlighten me?
Warm regards, Worlo
This is what I looked at first:
http://www.gammon.com.au/forum/bbshowpost.php?id=3774&page=2
But my VBScript knowledge just isn't good enough to get what I want.
I want to do something like:
import re
def OnPluginPartialLine(txt):
if re.match("^([0-9]+)h, ([0-9]+)m, ([0-9]+)e, ([0-9]+)w (.*)-", txt):
<do some work>
Putting a world.Note("Plugin Match Found") there causes errors in my plugin. I get a pop-up saying Type Mismatch. But i have no idea what line the type mismatch is on. My hunch is that this is not a function in VB, so it must be something different to use in Python, but I have no clue.
Here is the code for my plugin at the moment:
<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE muclient>
<!-- Plugin "Status_Bar_Prompt" generated by Plugin Wizard -->
<muclient>
<plugin
name="Prompt_Handler"
author="Worlo"
id="ff9331b06c15ab21046be001"
language="Python"
purpose="Get prompt info in variables as it arrives."
date_written="2007-12-05 16:00:00"
requires="4.14"
version="1.0"
>
</plugin>
<!-- Script -->
<script>
<![CDATA[
import re
def OnPluginPartialLine(txt):
if re.match("^([0-9]+)h, ([0-9]+)m, ([0-9]+)e, ([0-9]+)w (.*)-", txt):
world.Note("Plugin Match Found")
]]>
</script>
</muclient>
Who can enlighten me?
Warm regards, Worlo