|
Ekaterin Newbie
Joined: 17 Aug 2006 Posts: 9
|
Posted: Thu Aug 31, 2006 9:55 pm
VBScript and triggers |
I'm trying to change a trigger state from VB. I've got a 3 state trigger.
0: Pattern "xxx"
send command to external COM program, automatically changes to state 1
1: Pattern "\S+" (any non-blank line)
Send command to external COM program - switch to state 1 (to continue processing until blank line)
2: Pattern "^$" (a blank line)
Reset trigger
2 is handled using #RESET. However because I'm sending to an external program I have to have 0 and 1 running in VBScript. If I do everything in ZMud Script it works fine (I have a #State 1 at the end of 1 and it just keeps looping). However if I want to change the state from VBScript I'm lost. I've tried
dim t
' Set the state to 1
set t = ss.GetTrigger("xxxx", "DB")
t.StateNum = 1
ss.evaluatestr("#STATE [ID] 1") 'ID is the id of the trigger
All of which fail to work. Any answers would be gratefully received. |
|
|
|
Full Throttle Wanderer
Joined: 07 Dec 2004 Posts: 65
|
Posted: Fri Sep 01, 2006 12:45 am |
If you want to change the trigger state from the command prompt by running a .vbs file, then:
Code: |
Set cc = CreateObject("Zmud.Application")
Set ss = cc.CurrentSession
Call ss.ProcessCommand("#state [id] 1") |
Where [id] is the trigger id under the options tab in the settings window. |
|
|
|
Ekaterin Newbie
Joined: 17 Aug 2006 Posts: 9
|
Posted: Fri Sep 01, 2006 9:43 am |
Thanks, that worked perfectly.
|
|
|
|
|
|