#41391 - 2003-06-11 04:48 PM
IDispatch pointers
|
Duke
Fresh Scripter
Registered: 2003-06-10
Posts: 6
|
As part of my login script, Merlin will announce any planned network outages. If I run the Merlin script by itself, it runs great. When I put it in the login script (which requires Function Merlin() and Endfunction) I get the message "IDispatch pointers not allowed in expressions. What's the problem!?
|
|
Top
|
|
|
|
#41392 - 2003-06-11 05:01 PM
Re: IDispatch pointers
|
Chris S.
MM club member
   
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
Can you post the portion of the script that is giving you problems?
Likely are performing a function on the object that isn't supported. Certain functions will fail on COM objects, like...
code:
If LEN($Merlin) = 0 ...blah EndIf
|
|
Top
|
|
|
|
#41393 - 2003-06-11 05:09 PM
Re: IDispatch pointers
|
Duke
Fresh Scripter
Registered: 2003-06-10
Posts: 6
|
Function Merlin() break On ; If InGroup("Testgroup") $merlin_path = "%windir%\msagent\chars\merlin.acs" $agent = createobject ("agent.control.2") $agent.connected = "1" $= $agent.characters.load("merlin","$merlin_path") $merlin = $agent.characters.character("merlin") $= $merlin.moveto(400,200) $= $merlin.show() $wait = $merlin.play("announce" ) do sleep 1 until $merlin.wait($wait) <> 0 $wait = $merlin.speak("Hello! You are part of a test group using the new login scripts." ) $wait = $merlin.speak("If I had anything important to say, I would have told you here." ) do sleep 3 until $merlin.wait($wait) <> 0
; Endif EndFunction
This code works fine as stand-alone and without Function Merlin() and Endfunction.
|
|
Top
|
|
|
|
#41394 - 2003-06-11 05:10 PM
Re: IDispatch pointers
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
IIRC, Shawn did some work with Merlin..
Kent
|
|
Top
|
|
|
|
#41395 - 2003-06-11 05:35 PM
Re: IDispatch pointers
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Yeah sure did, Merlin is a great guy to work with ... has this habit of disappearing from the office though ... kinda like myself ... Merlin keeps telling us he's "working from the castle" ... ja, right !
Check to make sure the merlin object is being created properly, might want to stick an @ERROR after this line, like this:
$merlin = $agent.characters.character("merlin") ?@SERROR
-Shawn ![[Wink]](images/icons/wink.gif) [ 11. June 2003, 17:37: Message edited by: Shawn ]
|
|
Top
|
|
|
|
#41396 - 2003-06-11 05:46 PM
Re: IDispatch pointers
|
Duke
Fresh Scripter
Registered: 2003-06-10
Posts: 6
|
I put the ?@serror after each line and got a "completed successfully" on each one. I then put it after the call for Merlin() and it didn't give a response. It's like it doesn't return to where it's suppose to. My code is set up like:
fun1() fun2() Merlin() fun3() Exit
And all the functions are below. It never runs fun3()
And Thanks for replying so quickly!
|
|
Top
|
|
|
|
#41398 - 2003-06-11 06:08 PM
Re: IDispatch pointers
|
Duke
Fresh Scripter
Registered: 2003-06-10
Posts: 6
|
I've created a new script.
merlin() Exit Function merlin() break On $merlin_path = "%windir%\msagent\chars\merlin.acs" $agent = createobject ("agent.control.2") $agent.connected = "1" $= $agent.characters.load("merlin","$merlin_path") $merlin = $agent.characters.character("merlin") $= $merlin.moveto(400,200) $= $merlin.show() $wait = $merlin.play("Announce" ) do sleep 1 until $merlin.wait($wait) <> 0 $wait = $merlin.speak("What the?" ) do sleep 3 until $merlin.wait($wait) <> 0 ?"script done..." EndFunction
This script is giving the same error. If I remove the function and endfunction and call this script from the login, it works. I was just hoping to keep it all in one script so that I can encrypt it so it doesn't get tampered.
|
|
Top
|
|
|
|
#41400 - 2003-06-11 06:18 PM
Re: IDispatch pointers
|
Duke
Fresh Scripter
Registered: 2003-06-10
Posts: 6
|
That was it!!! My hat's off (and showing the bald spot where I pulled my hair out) to you!
|
|
Top
|
|
|
|
#41403 - 2003-06-11 07:34 PM
Re: IDispatch pointers
|
Duke
Fresh Scripter
Registered: 2003-06-10
Posts: 6
|
It's working now and I couldn't be happier! Thanks again
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1452 anonymous users online.
|
|
|