I have an alias which sets of a script. The script then reads a file and Queues each line as an execution. The problem is that the script for each executed line is being executed BEFORE the command is executed in the speedwalk.
If you're confused look at my messy code which will confuse you even more.
This sub executes the lines from a quest file
Sub OnQuest (strAliasName, strOutput, arrWildCards)
dim fromplace
dim toplace
dim textfile
dim line
dim i
dim togo
dim todo
dim dir
dim opp
fromplace = arrWildCards (1)
textfile = "D:\Oceradan\Scripts\Routes\Quests\"+fromplace
world.setvariable "waitquest","no"
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists (textfile) Then
world.note "File exists"
Set objFile = objFSO.OpenTextFile(textfile, 1)
i =1
world.send "accept"
do until objFile.AtEndOfStream
world.SpeedWalkDelay = 750
dir = objFile.ReadLine
world.queue world.execute (dir),1
i=i+1
loop
world.SpeedWalkDelay = 500
world.queue world.execute ("reverse " + arrWildCards (1)),1
Else
world.note "ERROR! QUEST DOES NOT EXIST (check spelling?)"
End If
world.note textfile
end sub
this sub is called in a script from the directions alias (regexp the directions) and sets the last direction
sub setldir (thename, theoutput, thewildcards)
world.setvariable "lastdir", thewildcards(1)
world.send thewildcards(1)
end sub
If you're confused look at my messy code which will confuse you even more.
This sub executes the lines from a quest file
Sub OnQuest (strAliasName, strOutput, arrWildCards)
dim fromplace
dim toplace
dim textfile
dim line
dim i
dim togo
dim todo
dim dir
dim opp
fromplace = arrWildCards (1)
textfile = "D:\Oceradan\Scripts\Routes\Quests\"+fromplace
world.setvariable "waitquest","no"
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists (textfile) Then
world.note "File exists"
Set objFile = objFSO.OpenTextFile(textfile, 1)
i =1
world.send "accept"
do until objFile.AtEndOfStream
world.SpeedWalkDelay = 750
dir = objFile.ReadLine
world.queue world.execute (dir),1
i=i+1
loop
world.SpeedWalkDelay = 500
world.queue world.execute ("reverse " + arrWildCards (1)),1
Else
world.note "ERROR! QUEST DOES NOT EXIST (check spelling?)"
End If
world.note textfile
end sub
this sub is called in a script from the directions alias (regexp the directions) and sets the last direction
sub setldir (thename, theoutput, thewildcards)
world.setvariable "lastdir", thewildcards(1)
world.send thewildcards(1)
end sub
Basically what I want to do is to set the last direction as the direction comes off the speedwalk. If anybody has an easier way to do this let me know please