Difference between revisions of "Talk:RunBatchScript"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Scruggs
(Questioning the Notes on this function)
 
imported>Haama
Line 23: Line 23:
endif</pre>
endif</pre>
The variable remains zero and button presses are not recognized by the calling script.
The variable remains zero and button presses are not recognized by the calling script.
:Ha, ha! I have tricked you, and now you must fix the page! Ok, a normal response - yeah, I was going off some memories of Jaga's work with it. It was one step better than the "Works exactly like the console function", as there are no notes for the console function either.
:Seems that it does make it's own object, then. I guess the last important question - does it run through the lines immediately like a result script, or not until later?
:--[[User:Haama|Haama]] 00:18, 25 November 2007 (EST)

Revision as of 00:18, 25 November 2007

The Notes section is incorrect as far as I can tell. RunBatchScript creates a temporary script object which knows nothing about the script from which the function was called. With the following batch script in a file:

set myVar to 1
messageBox "Press a button" "zero" "one" "two"

And the following script:

short button
short myVar
short test

if (test == 1)  ; set through console for testing
  runBatchScript "test.txt"
  set test to 2
endif

if (test == 2)
  if (myVar)
    PrintC "MyVar != 0"
  endif
  set button to getButtonPressed
  if (button > -1)
    PrintC "Button pressed"
    set test to 0
  endif
endif

The variable remains zero and button presses are not recognized by the calling script.

Ha, ha! I have tricked you, and now you must fix the page! Ok, a normal response - yeah, I was going off some memories of Jaga's work with it. It was one step better than the "Works exactly like the console function", as there are no notes for the console function either.
Seems that it does make it's own object, then. I guess the last important question - does it run through the lines immediately like a result script, or not until later?
--Haama 00:18, 25 November 2007 (EST)