Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Ekaterin
Newbie


Joined: 17 Aug 2006
Posts: 9

PostPosted: 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.
Reply with quote
Full Throttle
Wanderer


Joined: 07 Dec 2004
Posts: 65

PostPosted: 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.
Reply with quote
Ekaterin
Newbie


Joined: 17 Aug 2006
Posts: 9

PostPosted: Fri Sep 01, 2006 9:43 am   
 
Thanks, that worked perfectly.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net