
@eventActorClick0
	GOTO @eac0-#<currmode>
	END

@eac0-1-2
	SET vssavetype, "local"
	SET divspacing, #<vssaved>
	ADD divspacing, 1
	SET spacing, 80
	DIV spacing, #<divspacing>
	MOVE 0, 40, 50, 4
	MOVE 1, 120, 50, 4
	MOVE 2, 145, 50, 4
	MOVE 3, 50, 120, 4
	WAIT 1.5
	ACTOR 0, "Back", VSbuttons, 14, 40, 50, 0
	COMPARE #<vssaved>, 0
	IF= @eac0-1-2none
	SET index, 0
@eac0-1-2actorloop
	ADD index, 1
	SET name, vssaved-#<index>
	SET ymove, #<spacing>
	MUL ymove, #<index>
	ADD ymove, 10
	SET actorid, #<index>
	ADD actorid, 3
	ACTOR #<actorid>, "*#<name>", VSbuttons, 13, 60, 120, 0
	MOVE #<actorid>, 60, #<ymove>, 3
	WAIT 0.5
	COMPARE #<index>, #<vssaved>
	IF< @eac0-1-2actorloop
@eac0-1-2none
	SET currmode, "1-2-1"
	ACTOR 12, "New", VSbuttons, 0, 40, 65, 0
	ACTOR 13, "Delete", VSbuttons, 3, 40, 80, 0
	ACTOR 14, "Copy", VSbuttons, 19, 30, 65, 0
	ACTOR 15, "Paste", VSbuttons, 20, 30, 80, 0
	ACTOR 16, "Archive", VSbuttons, 18, 30, 50, 0
	END



@eac0-1-2-1
	SET numscenes, #<vssaved>
	ADD numscenes, 3
	SET actor, 4
@eac0-1-2-1aclear
	CALL 2240@clearactors 4, 16
	MOVE 0, #<vs0x>, 50, 4
	MOVE 1, #<vs1x>, 50, 4
	MOVE 2, #<vs2x>, 50, 4
	MOVE 3, 50, 75, 4
	WAIT 1.5
	ACTOR 0, "Local Scene", VSbuttons, 13, #<vs0x>, 50, 0
	SET currmode, 1-2
	END

@eac0-1-4
@eac1-1-4
@eac2-1-4
@eac3-1-4
@eac4-1-4
@eac5-1-4
@eac6-1-4
	SET read, actor#<event.actor>
	SET readnum, actornum#<event.actor>
	CALL 2240@vsrevnamelookup *#<read>
	SET vsguicommandcurr, "*#<readnum>"
	SET currmode, 1
	ACTOR 52, "Edit Command", VSbuttons, 1, 50, 27, 0
	GOTO @programGenericAction-#<arg1>
	END

@eac0-1-5
@eac1-1-5
@eac2-1-5
@eac3-1-5
@eac4-1-5
@eac5-1-5
@eac6-1-5
	PUSH actornum#<event.actor>
	POP read
	CALL 2240@arraymakeinsert vsguicommand, #<read>
	SET vsguicommandcurr, "#<read>"
	SET currmode, "1-3-1"
	ACTOR 53, "Insert Command", VSbuttons, 2, 50, 34, 0
	ACTOR 51, "Add Command", VSbuttons, 0, 50, 20, 17
	END

@eac0-1-6
@eac1-1-6
@eac2-1-6
@eac3-1-6
@eac4-1-6
@eac5-1-6
@eac6-1-6
	SET actor, #<event.actor>
	PUSH actornum#<actor>
	POP read
	CALL 2240@arrayrem vsguicommand, #<read>
	SET currmode, "1"
	ACTOR 54, "Remove Command", VSbuttons, 3, 50, 41, 0
	SET vsstartaction, #<vsguicommand>
	SUB vsstartaction, 6
	COMPARE #<vsstartaction>, 0
	IF> @eac0-1-6-1
	SET vsstartaction, 1
@eac0-1-6-1
	CALL 2240@drawvscommands #<vsstartaction>
	END

@eventActorClick1
	GOTO @eac1-#<currmode>
	END

@eac1-1-2
	SET vssavetype, "remote"
	SET num.devTableId, 91
	SET str.devTableRowId, sceneVS
	SET numscenes, #<str.devTableCOL1>
	COMPARE #<numscenes>, 0
	IF= @eac1-1-2none
	SET divspacing, #<numscenes>
	ADD divspacing, 1
	SET spacing, 80
	DIV spacing, #<divspacing>
	MOVE 0, -20, 50, 4
	MOVE 2, 120, 50, 4
	MOVE 3, 50, 120, 4
	MOVE 1, 40, 50, 4
	WAIT 1.0
	ACTOR 1, "Back", VSbuttons, 14, 40, 50, 0
	SET button, 0
@eac1-1-2actorloop
	WAIT 0.5
	ADD button, 2
	SET actorid, #<button>
	ADD actorid, 2
	SET actorname, str.devTableCOL#<button>
	SUB button, 1
	SET ymove, #<spacing>
	MUL ymove, #<button>
	ADD ymove, 10
	ACTOR #<actorid>, *#<actorname>, VSbuttons, 13, 60, 120, 0
	MOVE #<actorid>, 60, #<ymove>, 3
	COMPARE #<button>, #<numscenes>
	IF< @eac1-1-2actorloop
	SET currmode, "1-2-2"
	ACTOR 13, "Clear", VSbuttons, 3, 40, 80, 0
	ACTOR 14, "Copy", VSbuttons, 19, 30, 65, 0
	ACTOR 15, "Paste", VSbuttons, 20, 30, 80, 0
	ACTOR 16, "Archive", VSbuttons, 18, 30, 50, 0
	END

@eac1-1-2none
	N: No Remote VS Scenes Available.
	END

@eac1-1-2-2
	ADD numscenes, 3
	SET actor, 4
@eac1-1-2-2aclear
	CALL 2240@clearactors 4, 16
	MOVE 0, #<vs0x>, 50, 4
	MOVE 1, #<vs1x>, 50, 4
	MOVE 2, #<vs2x>, 50, 4
	MOVE 3, 50, 75, 4
	WAIT 1.0
	ACTOR 1, "Remote Scene", VSbuttons, 13, #<vs1x>, 50, 0
	SET currmode, 1-2
	END

@eventActorClick2
	GOTO @eac2-#<currmode>
	END

@eac2-1-2
	SET vssavetype, "remote"
	SET num.devTableId, 91
	SET str.devTableRowId, sceneLBVS
	SET numscenes, #<str.devTableCOL1>
	COMPARE #<numscenes>, 1
	IF> @eac2-1-2drawlbscenes
	IF< @eac2-1-2none
	SET scenenum, #<str.devTableCOL2>
@eac2-1-2drawlbmaps
	MOVE 0, -45, 50, 4
	MOVE 2, 16, 50, 4
	MOVE 3, 50, 120, 4
	MOVE 1, -20, 50, 4
	WAIT 1.5
	ACTOR 2, "Back", VSbuttons, 14, 16, 50, 0
	CALL 2240@lbmaparray #<scenenum>, vslbmap
	SET jumpnum, *#<arg0>
	DIV jumpnum, 8
	MUL jumpnum, 8
	SET index, 0
	SET xcoord, 16
	SET ycoord, 11
@eac2-1-2lbmapsloop
	WAIT 0.5
	ADD index, 1
	COMPARE #<index>, #<jumpnum>
	IF> @eac2-1-2lbmapslooplast
	SET name, vslbmap-#<index>
	SET xfind, #<index>
	SUB xfind, 1
	DIV xfind, 8
	ADD xfind, 2
	MUL xfind, #<xcoord>
	SET yfind, #<index>
	SUB yfind, 1
	MOD yfind, 8
	ADD yfind, 1
	MUL yfind, #<ycoord>
	SET actorid, #<index>
	ADD actorid, 3
	ACTOR #<actorid>, "Map *#<name>", VSbuttons, 13, #<xfind>, 120, 0
	MOVE #<actorid>, #<xfind>, #<yfind>, 3
	GOTO @eac2-1-2lbmapsloop
@eac2-1-2lbmapslooplast
	SET divspacing, *#<arg0>
	MOD divspacing, 8
	ADD divspacing, 1
	SET spacing, 80
	DIV spacing, #<divspacing>
@eac2-1-2lbmapslooplastloop
	SET name, vslbmap-#<index>
	SET xfind, #<index>
	DIV xfind, 8
	ADD xfind, 2
	MUL xfind, #<xcoord>
	SET yfind, #<index>
	MOD yfind, 8
	MUL yfind, #<spacing>
	ADD yfind, 10
	SET actorid, #<index>
	ADD actorid, 3
	ACTOR #<actorid>, "Map *#<name>", VSbuttons, 13, #<xfind>, 120, 0
	MOVE #<actorid>, #<xfind>, #<yfind>, 3
	WAIT 0.5
	ADD index, 1
	COMPARE #<index>, *#<arg0>
	IF<= @eac2-1-2lbmapslooplastloop
	SET currmode, "1-2-3-1"
	END


@eac2-1-2drawlbscenes
	SET divspacing, #<numscenes>
	ADD divspacing, 1
	SET spacing, 80
	DIV spacing, #<divspacing>
	MOVE 0, -45, 50, 4
	MOVE 2, 16, 50, 4
	MOVE 3, 50, 120, 4
	MOVE 1, -20, 50, 4
	WAIT 1.5
	ACTOR 2, "Back", VSbuttons, 14, 16, 50, 0
	SET button, 0
@eac2-1-2lbscenesloop
	WAIT 0.5
	ADD button, 2
	SET actorid, #<button>
	ADD actorid, 2
	SET actorname, str.devTableCOL#<button>
	SUB button, 1
	ACTOR #<actorid>, *#<actorname>, VSbuttons, 13, 60, 120, 0
	SET ymove, #<spacing>
	MUL ymove, #<button>
	ADD ymove, 10
	MOVE #<actorid>, 60, #<ymove>, 3
	COMPARE #<button>, #<numscenes>
	IF< @eac2-1-2lbscenesloop
	SET currmode, "1-2-3"
	END

@eac2-1-2none
	N: No Link-Based VS Scenes Available.
	END

@eac2-1-2-3
	ADD numscenes, 3
	SET actor, 4
@eac2-1-2-3aclear
	MOVE #<actor>, -100, -100, 1
	ADD actor, 1
	COMPARE #<actor>, #<numscenes>
	IF<= @eac2-1-2-3aclear
	MOVE 0, #<vs0x>, 50, 4
	MOVE 1, #<vs1x>, 50, 4
	MOVE 2, #<vs2x>, 50, 4
	MOVE 3, 50, 75, 4
	WAIT 1.5
	ACTOR 2, "Link-Based Remote Scene", VSbuttons, 13, #<vs2x>, 50, 0
	SET currmode, 1-2
	END

@eac2-1-2-3-1
	SET numscenes, #<vslbmap>
	ADD numscenes, 3
	SET actor, 4
@eac2-1-2-3-1aclear
	MOVE #<actor>, -100, -100, 1
	ADD actor, 1
	COMPARE #<actor>, #<numscenes>
	IF<= @eac2-1-2-3-1aclear
	SET num.devTableId, 91
	SET str.devTableRowId, sceneLBVS
	SET numscenes, #<str.devTableCOL1>
	COMPARE #<numscenes>, 1
	IF> @eac2-1-2-3-1aclearscenes
	MOVE 0, #<vs0x>, 50, 4
	MOVE 1, #<vs1x>, 50, 4
	MOVE 2, #<vs2x>, 50, 4
	MOVE 3, 50, 75, 4
	WAIT 1.5
	ACTOR 2, "Link-Based Remote Scene", VSbuttons, 13, #<vs2x>, 50, 0
	SET currmode, 1-2
	END
@eac2-1-2-3-1aclearscenes
	GOTO @eac2-1-2drawlbscenes
	END

@eac2-1-2-3-2
	SET numscenes, #<vslbmap>
	ADD numscenes, 3
	SET actor, 4
@eac2-1-2-3-2aclear
	MOVE #<actor>, -100, -100, 1
	ADD actor, 1
	COMPARE #<actor>, #<numscenes>
	IF<= @eac2-1-2-3-2aclear
	GOTO @eac2-1-2
	END

@eventActorClick3
	GOTO @eac3-#<currmode>
	END

@eac3-1-2
	MOVE 0, -20, 50, 4
	MOVE 2, 120, 50, 4
	MOVE 3, 50, 120, 4
	MOVE 1, -20, 50, 4
	GOTO @exit

@eventActorClick4
	GOTO @eac4-#<currmode>
	END

@eac4-1-2-1
@eac5-1-2-1
@eac6-1-2-1
@eac7-1-2-1
@eac8-1-2-1
@eac9-1-2-1
@eac10-1-2-1
@eac11-1-2-1
	SET actor, #<event.actor>
	SUB actor, 3
	PUSH vssaved-#<actor>
	POP readsaved
	CALL 2240@arraycopy #<readsaved>, vsguicommand
	SET vsguicommand-0, #<readsaved>
	SET vsstartaction, 1
	GOTO @programreturn

@eac4-1-2-1-1
@eac5-1-2-1-1
@eac6-1-2-1-1
@eac7-1-2-1-1
@eac8-1-2-1-1
@eac9-1-2-1-1
@eac10-1-2-1-1
@eac11-1-2-1-1
	ACTOR 13, "Delete", vsbuttons, 3, 40, 80, 0
	SET actor, #<event.actor>
	SUB actor, 3
	CALL 2240@arrayrem vssaved, #<actor>
	CALL 2240@clearactors 4, 11
	GOTO @eac0-1-2

@eac4-1-2-1-2
@eac5-1-2-1-2
@eac6-1-2-1-2
@eac7-1-2-1-2
@eac8-1-2-1-2
@eac9-1-2-1-2
@eac10-1-2-1-2
@eac11-1-2-1-2
	ACTOR 14, "Copy", vsbuttons, 19, 30, 65, 0
	SET actor, #<event.actor>
	SUB actor, 3
	PUSH vssaved-#<actor>
	POP readsaved
	CALL 2240@arraycopy #<readsaved>, vsclipboard
	SET vsclipboard-label, #<readsaved>
	SET currmode, "1-2-1"
	END

@eac4-1-2-1-3
@eac5-1-2-1-3
@eac6-1-2-1-3
@eac7-1-2-1-3
@eac8-1-2-1-3
@eac9-1-2-1-3
@eac10-1-2-1-3
@eac11-1-2-1-3
	ACTOR 15, "Paste", vsbuttons, 20, 30, 80, 0
	SET actor, #<event.actor>
	SUB actor, 3
	SET vssaved-#<actor>, #<vsclipboard-label>
	CALL 2240@arraycopy vsclipboard, #<vsclipboard-label>
	CALL 2240@clearactors
	GOTO @eac0-1-2

@eac4-1-2-1-4
@eac5-1-2-1-4
@eac6-1-2-1-4
@eac7-1-2-1-4
@eac8-1-2-1-4
@eac9-1-2-1-4
@eac10-1-2-1-4
@eac11-1-2-1-4
	ACTOR 16, "Archive", vsbuttons, 18, 30,50, 0
	SET actor, #<event.actor>
	SUB actor, 3
	PUSH vssaved-#<actor>
	POP readsaved
	CALL 2240@arrayadd vsarchive, #<readsaved>
	CALL 2240@arraycopy #<readsaved>, vsarchive_#<readsaved>
	SET currmode, "1-2-1"
	END

@eac4-1-2-2
@eac5-1-2-2
@eac6-1-2-2
@eac7-1-2-2
@eac8-1-2-2
@eac9-1-2-2
@eac10-1-2-2
@eac11-1-2-2
	SET actor, #<event.actor> 
	SUB actor, 2
	PUSH str.devTableCOL#<actor> ;Actor four gives us COL2 on row sceneVS, giving proper scene number
	POP readTable
	SET vsremotecat, "scene"
	SET vsremotevar, "#<readTable>"
	CALL 2240@downloadstring vsdownload, #<vsremotecat>, #<vsremotevar>
	CALL 2240@decompilestring vsdownload, vsguicommand
	SET vsstartaction, 1
	COMPARE #<arg0>, 0
	IF> @programreturn ;If not a null scene, don't ask for a label, assume it already has one.
	N: Label for VS scene #<readTable>?
	ASK 240 1
	SET #<arg0>-0, #<lastAsk>
	GOTO @programreturn
	END

@eac4-1-2-2-1
@eac5-1-2-2-1
@eac6-1-2-2-1
@eac7-1-2-2-1
@eac8-1-2-2-1
@eac9-1-2-2-1
@eac10-1-2-2-1
@eac11-1-2-2-1
	ACTOR 13, "Clear", vsbuttons, 3, 40, 80, 0
	SET actor, #<event.actor> 
	SUB actor, 2
	PUSH str.devTableCOL#<actor> ;Actor four gives us COL2 on row sceneVS, giving proper scene number
	POP readTable
	SET_SERVER_VAR vsscene, #<readTable>, "0"
	SET currmode, "1-2-2"
	END
	
@eac4-1-2-2-2
@eac5-1-2-2-2
@eac6-1-2-2-2
@eac7-1-2-2-2
@eac8-1-2-2-2
@eac9-1-2-2-2
@eac10-1-2-2-2
@eac11-1-2-2-2
	ACTOR 14, "Copy", vsbuttons, 19, 30, 65, 0
	SET actor, #<event.actor> 
	SUB actor, 2
	PUSH str.devTableCOL#<actor> ;Actor four gives us COL2 on row sceneVS, giving proper scene number
	POP readTable
	CALL 2240@downloadstring vsdownload, scene, #<readTable>
	CALL 2240@decompilestring vsdownload, vsclipboard
	PUSH vsdownload-0
	POP vsclipboard-label
	SET currmode, "1-2-2"
	END
	
@eac4-1-2-2-3
@eac5-1-2-2-3
@eac6-1-2-2-3
@eac7-1-2-2-3
@eac8-1-2-2-3
@eac9-1-2-2-3
@eac10-1-2-2-3
@eac11-1-2-2-3
	ACTOR 15, "Paste", vsbuttons, 20, 30, 80, 0
	SET actor, #<event.actor> 
	SUB actor, 2
	PUSH str.devTableCOL#<actor> ;Actor four gives us COL2 on row sceneVS, giving proper scene number
	POP readTable
	CALL 2240@compilestring vsclipboard, vsupload
	PUSH vsclipboard-label
	POP vsupload-0
	CALL 2240@uploadstring vsupload, scene, #<readTable>
	SET currmode, "1-2-2"
	END

@eac4-1-2-2-4
@eac5-1-2-2-4
@eac6-1-2-2-4
@eac7-1-2-2-4
@eac8-1-2-2-4
@eac9-1-2-2-4
@eac10-1-2-2-4
@eac11-1-2-2-4
	ACTOR 16, "Archive", vsbuttons, 18, 30,50, 0
	SET actor, #<event.actor> 
	SUB actor, 2
	PUSH str.devTableCOL#<actor> ;Actor four gives us COL2 on row sceneVS, giving proper scene number
	POP readTable
	CALL 2240@downloadstring vsdownload, scene, #<readTable>
	CALL 2240@arrayadd vsarchive, #<vsdownload-0>
	CALL 2240@decompilestring vsdownload, vsarchive_#<vsdownload-0>
	SET currmode, "1-2-2"
	END

@eac4-1-2-3
@eac5-1-2-3
@eac6-1-2-3
@eac7-1-2-3
@eac8-1-2-3
@eac9-1-2-3
@eac10-1-2-3
@eac11-1-2-3
	SET actor, #<event.actor>
	SUB actor, 2
	PUSH str.devTableCOL#<actor>
	POP scenenum
	GOTO @eac2-1-2drawlbmaps
	END

@eac4-1-2-3-1
@eac5-1-2-3-1
@eac6-1-2-3-1
@eac7-1-2-3-1
@eac8-1-2-3-1
@eac9-1-2-3-1
@eac10-1-2-3-1
@eac11-1-2-3-1
@eac12-1-2-3-1
@eac13-1-2-3-1
@eac14-1-2-3-1
@eac15-1-2-3-1
@eac16-1-2-3-1
@eac17-1-2-3-1
@eac18-1-2-3-1
@eac19-1-2-3-1
@eac20-1-2-3-1
@eac21-1-2-3-1
@eac22-1-2-3-1
@eac23-1-2-3-1
@eac24-1-2-3-1
@eac25-1-2-3-1
@eac26-1-2-3-1
@eac27-1-2-3-1
@eac28-1-2-3-1
@eac29-1-2-3-1
@eac30-1-2-3-1
@eac31-1-2-3-1
@eac32-1-2-3-1
@eac33-1-2-3-1
@eac34-1-2-3-1
@eac35-1-2-3-1
	SET actor, #<event.actor>
	SUB actor, 3
	PUSH str.devTableCOL#<actor>
	POP vsremotecat
	GOTO @eacx-1-2-3-1drawlinks
	END

@eac4-1-2-3-2
@eac5-1-2-3-2
@eac6-1-2-3-2
@eac7-1-2-3-2
@eac8-1-2-3-2
@eac9-1-2-3-2
@eac10-1-2-3-2
@eac11-1-2-3-2
@eac12-1-2-3-2
@eac13-1-2-3-2
@eac14-1-2-3-2
@eac15-1-2-3-2
@eac16-1-2-3-2
@eac17-1-2-3-2
@eac18-1-2-3-2
@eac19-1-2-3-2
@eac20-1-2-3-2
@eac21-1-2-3-2
@eac22-1-2-3-2
@eac23-1-2-3-2
@eac24-1-2-3-2
@eac25-1-2-3-2
@eac26-1-2-3-2
@eac27-1-2-3-2
@eac28-1-2-3-2
@eac29-1-2-3-2
@eac30-1-2-3-2
@eac31-1-2-3-2
@eac32-1-2-3-2
@eac33-1-2-3-2
@eac34-1-2-3-2
@eac35-1-2-3-2
	SET actor, #<event.actor>
	SUB actor, 3
	PUSH str.devTableCOL#<actor>
	POP vsremotevar
	CALL 2240@downloadstring, vsdownload, #<vsremotecat>, #<vsremotevar>
	CALL 2240@decompilestring, vsdownload, vsguicommand
	SET vsstartaction, 1
	COMPARE #<arg0>, 0
	IF> @programreturn ;If not a null scene, don't ask for a label, assume it already has one.
	N: Label for VS scene #<readTable>?
	ASK 240 1
	SET #<arg0>-0, #<lastAsk>
	GOTO @programreturn
	END

@eventActorClick5
	GOTO @eac5-#<currmode>
	END

@eac5-1-4
	CALL 2240@vsrevnamelookup #<actor5>
	SET vsguicommandcurr, "#<actornum5>"
	SET currmode, 1
	GOTO @programGenericAction-#<arg1>
	END

@eac5-1-5
	CALL 2240@arraymakeinsert vsguicommand, #<actornum5>
	SET vsguicommandcurr, "#<actornum5>"
	SET currmode, "1-3-1"
	END

@eac5-1-6
	CALL 2240@arrayrem vsguicommand, #<actornum5>
	SET currmode, "1"
	SET vsstartaction, #<vsguicommand>
	SUB vsstartaction, 6
	COMPARE vsstartaction, 0
	IF> @eac5-1-6-1
	SET vsstartaction, 1
@eac5-1-6-1
	CALL 2240@drawvscommands #<vsstartaction>
	END

@eventActorClick6
	GOTO @eac6-#<currmode>
	END

@eventActorClick7
	GOTO @eac7-#<currmode>
	END

@eac7-1
@eac8-1
@eac9-1
@eac10-1
@eac11-1
@eac12-1
@eac13-1
@eac14-1
@eac15-1
@eac16-1
@eac17-1
@eac18-1
@eac19-1
@eac20-1
	SET num.devTableId, "91"
	SET str.devTableRowId, "ProgOpt"
	COMPARE #<str.devTableCOL1>, "1"
	IF!= @end
	ADD vsguicommand, 1
	SET vsguicommandcurr, #<vsguicommand>
	SET vsstartaction, #<vsguicommand>
	SUB vsstartaction, 6
	COMPARE vsstartaction, 0
	IF> @eacx-1skip
	SET vsstartaction, 1
@eacx-1skip
	PUSH actor#<event.actor>
	POP actor
	CALL 2240@vsrevnamelookup #<actor>
	GOTO @programGenericAction-#<arg1>
	END

@eac7-1-3
@eac8-1-3
@eac9-1-3
@eac10-1-3
@eac11-1-3
@eac12-1-3
@eac13-1-3
@eac14-1-3
@eac15-1-3
@eac16-1-3
@eac17-1-3
@eac18-1-3
@eac19-1-3
@eac20-1-3
	ADD vsguicommand, 1
	SET vsguicommandcurr, #<vsguicommand>
	SET vsstartaction, #<vsguicommand>
	SUB vsstartaction, 6
	COMPARE #<vsstartaction>, 0
	IF> @eacx-1-3-1
	SET vsstartaction, 1
@eacx-1-3-1
@eac7-1-3-1
@eac8-1-3-1
@eac9-1-3-1
@eac10-1-3-1
@eac11-1-3-1
@eac12-1-3-1
@eac13-1-3-1
@eac14-1-3-1
@eac15-1-3-1
@eac16-1-3-1
@eac17-1-3-1
@eac18-1-3-1
@eac19-1-3-1
@eac20-1-3-1
	PUSH actor#<event.actor>
	POP actor
	CALL 2240@vsrevnamelookup #<actor>
	SET currmode, 1
	ACTOR 51, "Add Command", VSbuttons, 0, 50, 20, 0
	GOTO @programGenericAction-#<arg1>
	END

@eventActorClick8
	GOTO @eac8-#<currmode>
	END

@eventActorClick9
	GOTO @eac9-#<currmode>
	END

@eventActorClick10
	GOTO @eac10-#<currmode>
	END

@eventActorClick11
	GOTO @eac11-#<currmode>
	END

@eventActorClick12
	GOTO @eac12-#<currmode>
	END

@eac12-1-2-1
	COMPARE #<vssaved>, 8
	IF>= @eac12-1-2-1full
	N: Label for new scene?
	ASK 240 1
	ADD vssaved, 1
	SET vssaved-#<vssaved>, #<lastAsk>
	GOTO @programstart
	END
@eac12-1-2-1full
	N: Local Scenes Slots Full!
	END

@eac12-1-2-1-3
	COMPARE #<vssaved>, 8
	IF>= @eac12-1-2-1full
	ACTOR 15, "Paste", vsbuttons, 20, 30, 80, 0
	ADD vssaved, 1
	SET vssaved-#<vssaved>, #<vsclipboard-label>
	CALL 2240@arraycopy vsclipboard, #<vsclipboard-label>
	SET currmode, "1-2-1"
	END
	

@eventActorClick13
	GOTO @eac13-#<currmode>
	END

@eac13-1-2-1
	ACTOR 13, "Delete", vsbuttons, 3, 40, 80, 17
	SET currmode, "1-2-1-1"
	END

@eac13-1-2-1-1
	ACTOR 13, "Delete", vsbuttons, 3, 40, 80, 0
	SET currmode, "1-2-1"
	END

@eac13-1-2-2
	ACTOR 13, "Clear", vsbuttons, 3, 40, 80, 17
	SET currmode, "1-2-2-1"
	END

@eac13-1-2-2-1
	ACTOR 13, "Clear", vsbuttons, 3, 40, 80, 0
	SET currmode, "1-2-2"
	END

@eventActorClick14
	GOTO @eac14-#<currmode>
	END

@eac14-1-2-1
	ACTOR 14, "Copy", vsbuttons, 19, 30, 65, 17
	SET currmode, "1-2-1-2"
	END

@eac14-1-2-1-2
	ACTOR 14, "Copy", vsbuttons, 19, 30, 65, 0
	SET currmode, "1-2-1"
	END
	
@eac14-1-2-2
	ACTOR 14, "Copy", vsbuttons, 19, 30, 65, 17
	SET currmode, "1-2-2-2"
	END

@eac14-1-2-2-2
	ACTOR 14, "Copy", vsbuttons, 19, 30, 65, 0
	SET currmode, "1-2-2"
	END

@eventActorClick15
	GOTO @eac15-#<currmode>
	END

@eac15-1-2-1
	ACTOR 15, "Paste", vsbuttons, 20, 30, 80, 17
	SET currmode, "1-2-1-3"
	END

@eac15-1-2-1-3
	ACTOR 15, "Paste", vsbuttons, 20, 30, 80, 0
	SET currmode, "1-2-1"
	END
	
	@eac15-1-2-2
	ACTOR 15, "Paste", vsbuttons, 20, 30, 80, 17
	SET currmode, "1-2-2-3"
	END

@eac15-1-2-2-3
	ACTOR 15, "Paste", vsbuttons, 20, 30, 80, 0
	SET currmode, "1-2-2"
	END

@eventActorClick16
	GOTO @eac16-#<currmode>
	END

@eac16-1-2-1
	ACTOR 16, "Archive", vsbuttons, 18, 30, 50, 17
	SET currmode, "1-2-1-4"
	END

@eac16-1-2-1-2
	N: List of Archived Scenes:
	SET index, 0
@eac16-1-2-1-2loop
	ADD index, 1
	COMPARE #<index>, #<vsarchive>
	IF> @eac16-1-2-1-2end
	PUSH vsarchive-#<index>
	POP readlabel
	N: #<index>: #<readlabel>
	GOTO @eac16-1-2-1-2loop
@eac16-1-2-1-2end
	N: Please input the number corresponding to the scene you wish to copy from the Archive.
	N: (Input a number to copy or anything else to cancel).
	ASK 240 1
	COMPARE #<lastAsk>, 0
	IF> @eac16-1-2-1-2check
	END
@eac16-1-2-1-2check
	COMPARE #<lastAsk>, #<vsarchive>
	IF> @eac16-1-2-1-2bad
	PUSH vsarchive-#<lastAsk>
	POP readname
	CALL 2240@arraycopy vsarchive_#<readname>, vsclipboard
	SET vsclipboard-label, #<readname>
	ACTOR 14, "Copy", vsbuttons, 19, 30, 65, 0
	SET currmode, "1-2-1"
	END
@eac16-1-2-1-2none
	N: No Scenes in Archive!
	END
	
@eac16-1-2-1-3
	ACTOR 15, "Paste", vsbuttons, 20, 30, 80, 0
	CALL 2240@arrayadd vsarchive, #<vsclipboard-label>
	CALL 2240@arraycopy vsclipboard, vsarchive_#<readsaved>
	SET currmode, "1-2-1"
	END

@eac16-1-2-1-4
	ACTOR 16, "Archive", vsbuttons, 18, 30, 50, 0
	SET currmode, "1-2-1"
	END

@eventActorClick17
	GOTO @eac17-#<currmode>
	END

@eventActorClick18
	GOTO @eac18-#<currmode>
	END

@eventActorClick19
	GOTO @eac19-#<currmode>
	END

@eventActorClick20
	GOTO @eac20-#<currmode>
	END

@eventActorClick21
	GOTO @eac21-#<currmode>
	END

@eventActorClick22
	GOTO @eac22-#<currmode>
	END

@eventActorClick23
	GOTO @eac23-#<currmode>
	END

@eventActorClick24
	GOTO @eac24-#<currmode>
	END

@eventActorClick25
	GOTO @eac25-#<currmode>
	END

@eventActorClick26
	GOTO @eac26-#<currmode>
	END

@eventActorClick27
	GOTO @eac27-#<currmode>
	END

@eventActorClick28
	GOTO @eac28-#<currmode>
	END

@eventActorClick29
	GOTO @eac29-#<currmode>
	END

@eventActorClick30
	GOTO @eac30-#<currmode>
	END

@eventActorClick31
	GOTO @eac31-#<currmode>
	END

@eventActorClick32
	GOTO @eac32-#<currmode>
	END

@eventActorClick33
	GOTO @eac33-#<currmode>
	END

@eventActorClick34
	GOTO @eac34-#<currmode>
	END

@eventActorClick35
	GOTO @eac35-#<currmode>
	END

@eventActorClick40
	GOTO @eac40-#<currmode>
	END

@eac40-0
	N: What task would you like to perform?
	MENU "Program A Scene=@program","VS Management Console=@jumptoconsole","Exit=@exit"
	END

@eac40-1
	MENU "VS Management Console=@jumptoconsole","Exit=@exit"
	END

@eventActorClick41
	GOTO @eac41-#<currmode>

@eac41-1
	HTML HTML\vshelp.html
	END

@eventActorClick42
	GOTO @eac42-#<currmode>
	END

@eventActorClick43
	GOTO @eac43-#<currmode>
	END

@eac43-1
	GOTO @eac43-1s-#<vssavetype>
	END

@eac43-1s-local
	CALL 2240@arraycopy vsguicommand, #<vsguicommand-0>
	END

@eac43-1s-remote
	CALL 2240@compilestring vsguicommand, vsupload
	CALL 2240@uploadstring vsupload, #<vsremotecat>, #<vsremotevar>
	END

@eventActorClick44
	GOTO @eac44-#<currmode>
	END

@eac44-1
	CALL 2240@clearactors
	GOTO @program
	END

@eventActorClick45
	GOTO @eac45-#<currmode>
	END

@eventActorClick46
	GOTO @eac46-#<currmode>
	END

@eventActorClick47
	GOTO @eac47-#<currmode>
	END

@eac47-1
@eac47-1-3
@eac47-1-3-1
	COMPARE #<vsstartactor>, "1"
	IF= @programcommandlistnone
	SUB vsstartactor, "2"
	COMPARE #<vsstartactor>, "1"
	IF< @programclistmin
	CALL 2240@drawvscommandlist #<vsstartactor>
	END

@eventActorClick48
	GOTO @eac48-#<currmode>
	END

@eac48-1
@eac48-1-3
@eac48-1-3-1
	SET num.devTable, 90
	SET str.devTableRowId, 0
	SET vsclmaximum, #<str.devTableCOL3>
	COMPARE vsclmaximum, 0
	IFEVEN @eac48-1skipround
	ADD vsclmaximum, 1
@eac48-1skipround
	SUB vsclmaximum, 13
	COMPARE #<vsstartactor>, "#<vsclmaximum>"
	IF= @programcommandlistnone
	ADD vsstartactor, "2"
	CALL 2240@drawvscommandlist #<vsstartactor>
	END

@eventActorClick49
	GOTO @eac49-#<currmode>
	END

@eac49-1
@eac49-1-3
@eac49-1-3-1
	COMPARE #<vsstartactor>, "11"
	IF<= @programclistmin
	SUB vsstartactor, "12"
	COMPARE #<vsstartactor>, "1"
	IF< @programclistmin
	CALL 2240@drawvscommandlist #<vsstartactor>
	END

@eventActorClick50
	GOTO @eac50-#<currmode>
	END

@eac50-1
@eac50-1-3
@eac50-1-3-1
	SET num.devTable, 90
	SET str.devTableRowId, 0
	SET vsclmaximum, #<str.devTableCOL3>
	COMPARE #<vsclmaximum>, 0
	IFEVEN @eac50-1skipround
	ADD vsclmaximum, 1
@eac50-1skipround
	SUB vsclmaximum, 25
	COMPARE #<vsstartactor>, "#<vsclmaximum>"
	IF>= @programclistmax
	ADD vsstartactor, "12"
	CALL 2240@drawvscommandlist #<vsstartactor>
	END

	;Set of things for the events 47-50, mode one.  They are still needed.
	@programcommandlistnone
		END
	@programclistmin
		SET vsstartactor, "1"
		CALL 2240@drawvscommandlist #<vsstartactor>
		END
	@programclistmax
		SET num.devTable, 90
		SET str.devTableRowId, 0
		SET vsclmaximum, #<str.devTableCOL3>
		COMPARE #<vsclmaximum>, 0
		IFEVEN @eacmax-1skipround
		ADD vsclmaximum, 1
	@eacmax-1skipround
		SUB vsclmaximum, 13
		SET vsstartactor, "#<vsclmaximum>"
		CALL 2240@drawvscommandlist #<vsstartactor>
		END
	;And these last two will be useful even in the final release.

@eventActorClick51
	GOTO @eac51-#<currmode>
	END

@eac51-1
	SET_LEN testlen, "#<currmode>"
	COMPARE #<testlen>, "1"
	IF!= @end
	SET currmode, "1-3"
	ACTOR 51, "Add Command", VSbuttons, 0, 50, 20, 17
	END

@eac51-1-3
	SET currmode, "1"
	ACTOR 51, "Add Command", VSbuttons, 0, 50, 20, 0
	END

@eventActorClick52
	GOTO @eac52-#<currmode>
	END

@eac52-1
	SET currmode, "1-4"
	ACTOR 52, "Edit Command", VSbuttons, 1, 50, 27, 17
	END

@eac52-1-4
	SET currmode, "1"
	ACTOR 52, "Edit Command", VSbuttons, 1, 50, 27, 0
	END

@eventActorClick53
	GOTO @eac53-#<currmode>
	END

@eac53-1
	SET currmode, "1-5"
	ACTOR 53, "Insert Command", VSbuttons, 2, 50, 34, 17
	END

@eac53-1-5
	SET currmode, "1"
	ACTOR 53, "Insert Command", VSbuttons, 2, 50, 34, 0
	END

@eventActorClick54
	GOTO @eac54-#<currmode>
	END

@eac54-1
	SET currmode, "1-6"
	ACTOR 54, "Remove Command", VSbuttons, 3, 50, 41, 17
	END

@eac54-1-6
	SET currmode, "1"
	ACTOR 54, "Remove Command", VSbuttons, 3, 50, 41, 0
	END

@eventActorClick55
	GOTO @eac55-#<currmode>
	
@eac55-1
	SUB vsstartaction, 1
	COMPARE #<vsstartaction>, 1
	IF>= @eac55-1up
	SET vsstartaction, 1
	END
@eac55-1up
	CALL 2240@drawvscommands #<vsstartaction>
	END

@eventActorClick56
	GOTO @eac56-#<currmode>
	END

@eac56-1
	SET vsmaxaction, #<vsguicommand>
	SUB vsmaxaction, 6
	ADD vsstartaction, 1
	COMPARE #<vsstartaction>, #<vsmaxaction>
	IF<= @eac56-1down
	SET vsstartaction, #<vsmaxaction>
	END
@eac56-1down
	CALL 2240@drawvscommands #<vsstartaction>
	END

@eventActorClick57
	GOTO @eac57-#<currmode>
	END

@eac57-1
	SUB vsstartaction, 6
	COMPARE #<vsstartaction>, 1
	IF>= @eac57-1up
	SET vsstartaction, 1
@eac57-1up
	CALL 2240@drawvscommands #<vsstartaction>
	END

@eventActorClick58
	GOTO @eac58-#<currmode>
	END

@eac58-1
	SET vsmaxaction, #<vsguicommand>
	SUB vsmaxaction, 6
	ADD vsstartaction, 6
	COMPARE #<vsstartaction>, #<vsmaxaction>
	IF<= @eac58-1down
	SET vsstartaction, #<vsmaxaction>
@eac58-1down
	CALL 2240@drawvscommands #<vsstartaction>
	END

@eventActorClick59
	GOTO @eac59-#<currmode>
	END

@eac59-1
	N: Label to jump to?
	ASK 240 1
	SET findLabel, "#<lastAsk>"
	SET index, 0
	SET maxindex, #<vsguicommand>
@eac59-1loop
	ADD index, 1
	COMPARE #<index>, #<maxindex>
	IF> @eac59-1none
	SET read, vsguicommand-#<index>
	NTH_TOKEN vscheck99, 0, "*#<read>", "&"
	STRCMP #<vscheck99>, "99"
	IF!= @eac59-1loop
	NTH_TOKEN labelcheck, 1, "*#<read>", "&"
	STRCMP #<labelcheck>, #<findLabel>
	IF!= @eac59-1loop
	SET vsmaxaction, #<vsguicommand>
	SUB vsmaxaction, 6
	COMPARE #<index>, #<vsmaxaction>
	IF<= @eac59-1good
	SET vsstartaction, #<vsmaxaction>
	CALL 2240@drawvscommands #<vsstartaction>
	END
@eac59-1good
	SET vsstartaction, #<index>
	CALL 2240@drawvscommands #<vsstartaction>
	END
@eac59-1none
	N: Line Label not found!
	END

@eventActorClick60
	GOTO @eac60-#<currmode>
	END

@eac60-1
	SET vsguicommand0, #<vslabel>
	CALL 2240@printQUEST vsguicommand
	END

@eventActorClick61
	ASK 240 1
	CALL 2240@splitcommand #<lastAsk>
	STRCMP #<arg0>, "null"
	IF= @end
	ADD vsguicommand, 1
	SET vsguicommandcurr, #<vsguicommand>
	CALL 2240@vspack #<arg0>, #<arg1>, #<arg2>, #<arg3>, #<arg4>, #<arg5>, #<arg6>, #<arg7>, #<arg8>, #<arg9>
	SET vsguicommand#<vsguicommandcurr>, #<arg0>
	SET vsstartaction, #<vsguicommand>
	SUB vsstartaction, 6
	COMPARE vsstartaction, 0
	IF> @eac61-1
	SET vsstartaction, 1
@eac61-1
	CALL 2240@drawvscommands #<vsstartaction>
	END

@eventActorClick62
	GOTO @eac62-#<currmode>
	COMPARE #<VSadvcolor>, "22"
	IF= @end
	CALL @terminal0
	STRCMP #<arg0>, "null"
	IF= @end
	STRSTR "-#<arg0>-", "-upload-download-console-program-"
	IF> @eac62commands
	ADD vsguicommand, 1
	SET vsguicommandcurr, #<vsguicommand>
	CALL 2240@vspack #<arg0>, #<arg1>, #<arg2>, #<arg3>, #<arg4>, #<arg5>, #<arg6>, #<arg7>, #<arg8>, #<arg9>
	SET vsguicommand#<vsguicommandcurr>, #<arg0>
	SET vsstartaction, #<vsguicommand>
	SUB vsstartaction, 6
	COMPARE vsstartaction, 0
	IF> @eac62-1
	SET vsstartaction, 1
@eac62-1
	CALL 2240@drawvscommands #<vsstartaction>
	CALL @terminal0
	END
@eac62commands
	GOTO @eac62term-#<arg0>
	END
@eac62term-console
	COMPARE #<currmode>, "2"
	IF!= @jumptoconsole
	END
@eac62term-program
	COMPARE #<currmode>, "1"
	IF!= @programreturn
	END

@eacx-1-2-3-1drawlinks
	SET numscenes, #<vslblinks>
	ADD numscenes, 3
	SET actor, 4
@eacx-1-2-3-1linksaclear
	MOVE #<actor>, -100, -100, 1
	ADD actor, 1
	COMPARE #<actor>, #<numscenes>
	IF<= @eacx-1-2-3-1linksaclear

	ACTOR 2, "Back", VSbuttons, 14, 16, 50, 0
	CALL 2240@lblinkarray #<scenenum>, #<vsremotecat>, vslblink
	SET jumpnum, *#<arg0>
	DIV jumpnum, 8
	MUL jumpnum, 8
	SET index, 0
	SET xcoord, 16
	SET ycoord, 11
@eacx-1-2-3-1lblinksloop
	WAIT 0.5
	ADD index, 1
	COMPARE #<index>, #<jumpnum>
	IF> @eacx-1-2-3-1lbmapslooplast
	SET name, vslblink-#<index>
	SET xfind, #<index>
	SUB xfind, 1
	DIV xfind, 8
	ADD xfind, 2
	MUL xfind, #<xcoord>
	SET yfind, #<index>
	SUB yfind, 1
	MOD yfind, 8
	ADD yfind, 1
	MUL yfind, #<ycoord>
	SET actorid, #<index>
	ADD actorid, 3
	ACTOR #<actorid>, "Link *#<name>", VSbuttons, 13, #<xfind>, 120, 0
	MOVE #<actorid>, #<xfind>, #<yfind>, 3
	GOTO @eacx-1-2-3-1lbmapsloop
@eacx-1-2-3-1lbmapslooplast
	SET divspacing, *#<arg0>
	MOD divspacing, 8
	ADD divspacing, 1
	SET spacing, 80
	DIV spacing, #<divspacing>
@eacx-1-2-3-1lbmapslooplastloop
	SET name, vslblink-#<index>
	SET xfind, #<index>
	DIV xfind, 8
	ADD xfind, 2
	MUL xfind, #<xcoord>
	SET yfind, #<index>
	MOD yfind, 8
	MUL yfind, #<spacing>
	ADD yfind, 10
	SET actorid, #<index>
	ADD actorid, 3
	ACTOR #<actorid>, "Link *#<name>", VSbuttons, 13, #<xfind>, 120, 0
	MOVE #<actorid>, #<xfind>, #<yfind>, 3
	WAIT 0.5
	ADD index, 1
	COMPARE #<index>, *#<arg0>
	IF<= @eacx-1-2-3-1lbmapslooplastloop
	SET currmode, "1-2-3-2"
	END


@end
END
