| Message |
Ah, you had be puzzled for a while there.
This is how I worked it out. I changed your function to display the world name it got:
function funsend_to_world(worldname, message)
require "getworld"
wname = worldname
folder = "Aardwolf"
print ("worldname=", worldname, "wname=", wname)
local otherworld = get_a_world(wname, folder)
otherworld:DeleteOutput()
otherworld:Note (message)
end -- funsend_to_world
Forcing through a test line I saw this:
worldname= Cpinfo wname= Cpinfo
worldname= wname=
Can't open world file: C:\Program Files\MUSHclient\worlds\Aardwolf\.mcl
Run-time error
First time the world name was right, but what was the second time?
Then I spotted it. You are calling the script twice:
<triggers>
<trigger
enabled="y"
match="^You are friends with \:"
omit_from_output="y"
regexp="y"
script="funsend_to_world"
send_to="14"
sequence="100"
>
<send>funsend_to_world("Cpinfo","HEY")
</send>
</trigger>
</triggers>
If you are using "send to script" you don't also place the function name in the script box.
Delete the line:
script="funsend_to_world"
That was calling your function without sending "cpinfo" down to it, and thus it couldn't open the world.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|