![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Digital and Interactive Games 2015 – Term 3, Session 13
Today: - Powershell
・ Your game
Powershell
$myVar = 0
function increaseValue() {
$myVar = 1 ← Local Variable
}
increaseValue()
Write-Host $myVar
increaseValue()
Write-Host $myVar
Pass by reference
function increaseValue([REF] $myVar) {
$myVar = 1
}
increaseValue()
Write-Host $myVar
increaseValue()
Write-Host $myVar
Create a Visual Basic Form – in Powershell
Automate tasks
ISE – many limitations
・ Integreated Script Environment
Commenting
<#
#
#>
Set-ExecutionPolicy unrestricted -Force
Set-ExecutionPolicy restricted -Force
Start-process Powershell -ArguementList “java -jar Spigot-1.8.7.jar -PassThru
Set-Location c:\Spigot-1.8.7
.\LaunchSpigot.ps1
Running Scripts is disabled on this system
Plugin.yml
plugin_template.yml
name: <
main:<
version:<
Copy Plugin_template.yml to plugin.yml
New Script
Copy-item plugin_template.yml -Destination plugin.yml
(Get-Content .\Plugin.yml).Replace('<
“System.Windows.Forms”
“Microsoft.VisualBasic”
LoadWithPartial Name(“System.Windows.Forms”)
$form = NewObject “System.Windows.Forms”
$form.width = 600
$form.height = 300
$form.text = “myForm”
$form.StartPosition = [System.Windows.Forms.FormStartPosition]
$form.ShowDialogue()
$label1 = New Object =”System.Windows.Forms.Label”
$label1.left = 28
$label1.top = 15
$label1.text = label
$text1 = System.Windows.Forms.TextBox”
$form.controls.Add(label1)
$form.controls.Add(ltext)
$closeCmdletHandler = [System.EventHandler] {
$form.close()
}
$CloseButton.Add_click(closeCmdletHandler)
increaseValue([REF] $myVar)
main = org.fardell24.text
Parsing
. org
.. fardell24
… test.
…. Text.java
…. TestCommand.java
Template for the .classpath
Copy the “con” and the “lib”
Path = <
Path = <
Template for the .project