Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ VBscript
➜ CallPlugin
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| MattMc
USA (54 posts) Bio
|
| Date
| Sat 03 Jul 2004 03:23 AM (UTC) Amended on Sat 03 Jul 2004 03:37 AM (UTC) by MattMc
|
| Message
| Howdy,
Apperently the Callplugin function doesn't work when you are switching between two coding languages. Any ideas what will work to initiate a function in a different plugin that's in a different language?
Matt | | Top |
|
| Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Sat 03 Jul 2004 03:41 AM (UTC) Amended on Sat 03 Jul 2004 03:42 AM (UTC) by Nick Gammon
|
| Message
| I cannot reproduce this problem. It would have helped to specify the two languages involved, but here is a sample that uses CallPlugin to communicate from a plugin written in VBscript to one in Jscript.
Plugin "A"
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Saturday, July 03, 2004, 1:29 PM -->
<!-- MuClient version 3.50 -->
<!-- Plugin "test_a" generated by Plugin Wizard -->
<muclient>
<plugin
name="test_a"
author="Nick Gammon"
id="6cef965ac6f6795a4ec1c8b6"
language="VBscript"
purpose="Testing CallPlugin"
date_written="2004-07-03 13:28:20"
requires="3.50"
version="1.0"
>
</plugin>
<!-- Aliases -->
<aliases>
<alias
script="OnTest"
match="test *"
enabled="y"
echo_alias="y"
sequence="100"
>
</alias>
</aliases>
<!-- Script -->
<script>
<![CDATA[
Sub OnTest (name, line, wildcards)
Dim result
result = CallPlugin ("925d9a020086429f5c8a3c4b", "DoNote", wildcards (1))
if result <> 0 then
world.Note "Got result " & CStr (result) & " from CallPlugin"
end if
End Sub
]]>
</script>
</muclient>
Plugin "B"
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Saturday, July 03, 2004, 1:33 PM -->
<!-- MuClient version 3.50 -->
<!-- Plugin "test_b" generated by Plugin Wizard -->
<muclient>
<plugin
name="test_b"
author="Nick Gammon"
id="925d9a020086429f5c8a3c4b"
language="JScript"
purpose="Test being called from CallPlugin"
date_written="2004-07-03 13:31:29"
requires="3.50"
version="1.0"
>
</plugin>
<!-- Script -->
<script>
<![CDATA[
function DoNote (sText)
{
world.Note ("DoNote: " + sText);
}
]]>
</script>
</muclient>
When I install both plugins, and then type: "test hello" (which is caught by an alias in Plugin "A"), I see this:
test hello
DoNote: hello
Thus, the "hello" was passed from Plugin "A" to Plugin "B" via CallPlugin.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| MattMc
USA (54 posts) Bio
|
| Date
| Reply #2 on Sat 03 Jul 2004 03:50 AM (UTC) Amended on Sat 03 Jul 2004 03:51 AM (UTC) by MattMc
|
| Message
| Hi, thanks for the quick reply.
I'm using Vbasic to Perl (because I'm using a perl socket which I finally got to work (thanks nasa)).
_All_ of my triggers and scripts are in Vbasic, so I'm trying to transfer data over to the Perl plugin to get it to open the sockets and pull the info.
An example of what's not working:
[In Vbasic plugin]
sub SaleDone (sName, sLine, strwildcards)
... lots here ...
world.note "Going to DoAuction now"
yawn = CallPlugin ("8db4b008917c1c0d0ede17df", "DoAuction", "Datatobelogged")
end sub
[In Perl plugin]
sub GoAuction {
$world->note ("Goauction started");
... lots here ...
}
part of the Perl Plugin header is:
<plugin
name="MiniBrowser"
author="Matt and Nasa"
id="8db4b008917c1c0d0ede17df"
language="perlscript"
purpose="Minibrowser"
date_written="2003-06-29 22:16:38"
requires="3.4"
version="1.0"
>
The output I get?
Going to DoAuction now
that's it. | | Top |
|
| Posted by
| MattMc
USA (54 posts) Bio
|
| Date
| Reply #3 on Sat 03 Jul 2004 03:52 AM (UTC) |
| Message
| | Note: I don't need anything returned to the vbasic plugin, I just want it to initiate the other plugin which will open the socket, submit the data, close the socket, and echo the results there. There's no need to return anything to vbasic, and all my variables are stored so I don't need to pass data either. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
| Date
| Reply #4 on Sat 03 Jul 2004 06:52 AM (UTC) |
| Message
| Well, for one thing, you are calling "DoAuction", however your function on Perl is GoAuction. That is not the same.
If that doesn't fix it, in the calling plugin, echo the value of "yawn" (the return code from the CallPlugin) so you can see what the error code is. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| MattMc
USA (54 posts) Bio
|
| Date
| Reply #5 on Sat 03 Jul 2004 02:21 PM (UTC) |
| Message
| Wow, maybe this is why you get paid the big bucks :P
lmao
Going to DoAuction now
Goauction started
Connection to internet initiated.
Hello, your query has been submited.
Connection internet closed.
I love you Nick. | | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
19,263 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top