[personal profile] fardell24

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('<>', myName)


“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
<>

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

May 2025

S M T W T F S
     1 23
45 6 78910
11 12 13 141516 17
1819 2021 22 23 24
25262728293031

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 24th, 2025 06:44 pm
Powered by Dreamwidth Studios