Jump to content
Sign in to follow this  
7h331337

shoot the screen

Recommended Posts

7h331337

ok u no thos games when u shoot the screen well this i just the same but its in auto it

EDIT: i fixed my mistake thanks to Andreik & Szhlopp for pointing it out

EDIT:added monoceres idea with the moust and put a 1sec dalay on it so it lets u reload first

shoot.zip

Edited by 7h331337

Share this post


Link to post
Share on other sites
Szhlopp

ok u no thos games when u shoot the screen well this i just the same but its in auto it

Cool script!

Change the "GUIcreate("", 49 48" to "48, 48" and you will eliminate the white bar on the right hand side of the bullet hole=)

Func kick()
    $pos = MouseGetPos()
    GUICreate("", 48, 48, $pos[0] - 35, $pos[1] - 45, $ws_popup, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $gui)
    GUICtrlCreatePic(@ScriptDir & "\BulletHole.gif", 0, 0, 0, 0)
    SoundPlay(@ScriptDir & "\Pump Shotgun 68953.wav")
    GUISetState(@SW_SHOW)
    
EndFunc   ;==>kick

Share this post


Link to post
Share on other sites
Andreik

Funny muttley

I don;t undestand this line

GUICtrlCreatePic(@ScriptDir & "\Pump Shotgun 68953.wav", 0, 0, 0, 0)

GuiCtrlCreatePic can use wav files?

Edited by Andreik

When the words fail... music speaks

Share this post


Link to post
Share on other sites
7h331337

Funny muttley

I don;t undestand this line

GUICtrlCreatePic(@ScriptDir & "\Pump Shotgun 68953.wav", 0, 0, 0, 0)

GuiCtrlCreatePic can use wav files?

soz abt that lol cant belev i mist that lol i will delet it

Share this post


Link to post
Share on other sites
Szhlopp

Funny muttley

I don;t undestand this line

GUICtrlCreatePic(@ScriptDir & "\Pump Shotgun 68953.wav", 0, 0, 0, 0)

GuiCtrlCreatePic can use wav files?

Yeah that one messed me up too. I just ignored it as the script worked LOL

Share this post


Link to post
Share on other sites
gseller

Cool!! I Love it! Get rid of frustration...

Share this post


Link to post
Share on other sites
monoceres

Fun idea, however..

Add this to shoot with the mouse:

#include <misc.au3>
;.....

While 1
If _IsPressed("01") Then kick()
Sleep(25)
WEnd

And for Christ sake, sleep your main loop :)

muttley

Edited by monoceres

Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites
smashly

Rock'n , Nice work, luv it.. Buwahaha muttley

Thank You

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

HotKeySet("{ESC}", "_Quit")
HotKeySet("{space}", "_Shoot")

While 1
    Sleep(10)
WEnd

Func _Shoot()
    $pos = MouseGetPos()
    GUICreate("", 48, 48, $pos[0] - 24, $pos[1] - 24, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
    GUICtrlCreatePic(@ScriptDir & "\BulletHole.gif", 0, 0, 0, 0)
    SoundPlay(@ScriptDir & "\Pump Shotgun 68953.wav")
    GUISetState(@SW_SHOW)
EndFunc

Func _Quit()
    Exit
EndFunc

Cheers

Share this post


Link to post
Share on other sites
Paulie

Some minor changes:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>


HotKeySet("{ESC}", "Quit")
HotKeySet("{space}", "kick")
HotKeySet("{END}", "Clear")

Global $Window[1]
Global $Count = 0

While 1
    Sleep(100)
WEnd

Func Quit()
    Exit
EndFunc   ;==>main


Func kick()
    HotKeySet("{SPACE}", "Filler")
    $Count += 1
    ReDim $Window[$Count]
    $pos = MouseGetPos()
    $Window[$Count - 1] = GUICreate("", 48, 48, $pos[0] - 24, $pos[1] - 24, $ws_popup, BitOR($ws_ex_layered, $ws_ex_toolwindow))
    GUICtrlCreatePic(@ScriptDir & "\BulletHole.gif", 0, 0, 48,48)
    SoundPlay(@ScriptDir & "\Pump Shotgun 68953.wav")
    GUISetState(@SW_SHOW)
    HotKeySet("{SPACE}", "Kick")
EndFunc   ;==>kick

Func Filler()
EndFunc   ;==>Filler

Func Clear()
    For $X = UBound($Window) - 1 To 0 Step -1
        GUIDelete($Window[$X])
    Next
    $Count = 0
EndFunc   ;==>Clear
Edited by Paulie

Share this post


Link to post
Share on other sites
newbiescripter

Nice Script :P

I made this little change:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
Global $Window[1]
Global $devil, $randomX, $randomY
Global $Count = 0
Global $sizeX = 100, $sizeY = $sizeX *1.25

HotKeySet("{ESC}","_Terminate")
HotKeySet("{END}", "_Clear")
_setDevil()

While 1
    If _IsPressed("01") Then _Shoot()
    Sleep(25)
WEnd

Func _Shoot()
    $Count += 1
    ReDim $Window[$Count]
    $pos = MouseGetPos()
    $Window[$Count - 1] = GUICreate("", 48, 48, $pos[0] - 24, $pos[1] - 24, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
    GUICtrlCreatePic(@ScriptDir & "\BulletHole.gif", 0, 0, 0, 0)
    SoundPlay(@ScriptDir & "\Pump Shotgun 68953.wav")
    GUISetState(@SW_SHOW)
    If (_hitIt($pos[0],$pos[1]) == True) Then
        TrayTip("Nice Shot!!!","You killed a devil..",10)
        GUIDelete($devil)
        _setDevil()
    Else
        TrayTip("Bad Shot!!!","Kill the devil your bastard..",10)
    EndIf
    Sleep(800)
EndFunc

Func _Clear()
    For $X = UBound($Window) - 1 To 0 Step -1
        GUIDelete($Window[$X])
    Next
    $Count = 0
EndFunc

Func _setDevil()
    $randomX = Random(0+$sizeX,@DesktopWidth-$sizeX,1)
    $randomY = Random(0+$sizeY,@DesktopHeight-$sizeY,1)
    $devil = GUICreate("", $sizeX, $sizeY, $randomX, $randomY, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
    GUICtrlCreatePic(@ScriptDir & "\DevilHead.gif",0,0,$sizeX,$sizeY)
    GUISetState(@SW_SHOW)
EndFunc

Func _hitIT($x,$y)
    If ($randomX+$sizeX/8 < $x And $x < $randomX+$sizeX-$sizeX/8 And $randomY+$sizeY/8 < $y And $y < $randomY+$sizeY-$sizeY/8) Then
        Return True
    Else
        Return False
    EndIf
EndFunc

Func _Terminate()
    TrayTip("","",10)
    Exit
EndFuncoÝ÷ Ù¦zfÞ®Ú£ 塧mè"}ø¥zÆ¥²^ªÝ°@ÈM©§¶¥¢pØm+-¢f¤z+Z+m騭çî«­¢+Ù]¡¥±Ä(}ÍÑÙ¥° ¤(%]¡¥±¡5½¡M°Ì¤±ÐìÐìÀ¤($%%}%ÍAÉÍÍ ÅÕ½ÐìÀÄÅÕ½Ðì¤Q¡¸}M¡½½Ð ¤($%M±À ÈÔ¤(%]¹(%U%±Ñ ÀÌØíÙ¥°¤(%M±À ÄÀÀÀ¤)]¹

post-24573-1216942519_thumb.gif

post-24573-1216942525_thumb.gif

Edited by newbiescripter

Share this post


Link to post
Share on other sites
7h331337

wow the devil is great idea that is so fun

Share this post


Link to post
Share on other sites
DexterMorgan

This is great :P


code

Share this post


Link to post
Share on other sites
someone

I think this is really cool, I modified it a bit to pull randomly from different pics and give you a few weapon choices. Just download and unzip the Images folder and put it in the same place as the script. I can't search around right now for differnt sound bites so I just commented the sound clip out.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
#include <Array.au3>
#Include <File.au3>

HotKeySet("{ESC}", "Quit")
HotKeySet("{space}", "Shoot")
HotKeySet("{1}", "Filler")
HotKeySet("{2}", "Filler")
HotKeySet("{3}", "Filler")
HotKeySet("{4}", "Filler")


Global $Window[1]
Global $Count = 0
Global $Weapon = "Pistol"
Global $aBBGun
Global $aPistol
Global $aShotgun
Global $aHammer
Global $ImagesDir = @ScriptDir & "\Images\"

Images($aBBGun, $aPistol, $aShotgun, $aHammer)
Global $aWeapon = $aPistol

While 1
    Sleep(10)
    Select
        Case _IsPressed("01")
            Shoot()
        Case _IsPressed("31") ; 1 key
            $aWeapon = $aBBGun
            $Weapon = "BBGun"
            ToolTip("Eh, today is OK", Default, Default, "BB Gun")
        Case _IsPressed("32") ; 2 key
            $aWeapon = $aPistol
            $Weapon = "Pistol"
            ToolTip("Today sucks", Default, Default, "Pistol")
        Case _IsPressed("33") ; 3 key
            $aWeapon = $aShotgun
            $Weapon = "Shotgun"
            ToolTip("Stupid world", Default, Default, "Shotgun")
        Case _IsPressed("34") ; 4 key
            $aWeapon = $aHammer
            $Weapon = "Hammer"
            ToolTip("All work and no play makes Homer something something", Default, Default, "Hammer")
    EndSelect
WEnd

Func Quit()
    Exit
EndFunc   ;==>main

Func Shoot()
    HotKeySet("{SPACE}", "Filler")
    $Count += 1
    ReDim $Window[$Count]
    $pos = MouseGetPos()
    $Window[$Count - 1] = GUICreate("", 48, 48, $pos[0] - 24, $pos[1] - 24, $ws_popup, BitOR($ws_ex_layered, $ws_ex_toolwindow, $WS_EX_TOPMOST))
    $Random = Random(1, $aWeapon[0], 1)
    GUICtrlCreatePic($ImagesDir & $Weapon & "\" & $aWeapon[$Random], 0, 0, 48, 48)
    ;GUICtrlCreatePic(@ScriptDir & "\BulletHole.gif", 0, 0, 48,48)
    GUISetState(@SW_SHOW)
    ;SoundPlay(@ScriptDir & "\Pump Shotgun 68953.wav", 1)
    HotKeySet("{SPACE}", "Shoot")
    ToolTip("")
EndFunc   ;==>Shoot

Func Filler()
EndFunc   ;==>Filler

Func Clear()
    For $X = UBound($Window) - 1 To 0 Step -1
        GUIDelete($Window[$X])
    Next
    $Count = 0
EndFunc   ;==>Clear

Func Images(ByRef $aBBGun, ByRef $aPistol, ByRef $aShotgun, ByRef $aHammer, $Dir = $ImagesDir)
    
    $aBBGun = _FileListToArray($Dir & "BBGun", "*", 1)
    ;_ArrayDisplay($aBBGun, "BBGun")
    $aPistol = _FileListToArray($Dir & "Pistol", "*", 1)
    ;_ArrayDisplay($aPistol, "Pistol")
    $aShotgun= _FileListToArray($Dir & "Shotgun", "*", 1)
    ;_ArrayDisplay($aShotgun, "Shotgun")
    $aHammer = _FileListToArray($Dir & "Hammer", "*", 1)
    ;_ArrayDisplay($aHammer, "Hammer")
EndFunc

Very cool 7h331337!!

Edited by someone

While ProcessExists('Andrews bad day.exe')
	BlockInput(1)
	SoundPlay('Music.wav')
	SoundSetWaveVolume('Louder')
WEnd

Share this post


Link to post
Share on other sites
7h331337

IT WHONT SHOOT OR PLAY SOUD

Share this post


Link to post
Share on other sites
sensalim

I get an error on line 61, subscript used with non-Array variable...

Share this post


Link to post
Share on other sites
sensalim

The one with devilhead works. Though "Kill the devil your bastard.." should be changed to "Kill the devil, you bastard..."

Share this post


Link to post
Share on other sites
someone

I would guess what is happening for you is the _filelisttoarray isn't finding its target... is the script in the same directory as the folder? (but not in the folder?)

I disabled the sound (commented line 65), but can you be more descriptive? I didn't change the code that much... I tried running the code with 3.2.12 and 3.2.13.5 and it worked fine


While ProcessExists('Andrews bad day.exe')
	BlockInput(1)
	SoundPlay('Music.wav')
	SoundSetWaveVolume('Louder')
WEnd

Share this post


Link to post
Share on other sites
sensalim

Ok it works now. The zip (or rar, whatever) extracted as Images\Images\

I just moved them and now it works.

Cool job! Now to find appropriate .wav files...

Edit:

Would be nice to have different delay for each weapon.

Pistol: 100 (milli second)

BB gun and shotgun: 1000

Hammer: 2000

How about ammo? (unlimited of course, I meant reload delay).

Edited by sensalim

Share this post


Link to post
Share on other sites
someone

The delay could be handled a few ways... I *think* it might work best to use the sound clip as a delay. If you uncomment the soundplay line, you'll notice the script halts until the clip is finished playing. I think that could work well as you could control the delay in each weapon... hard to say without some testing though.

I think reloading could be cool, but then you have to get into some kind of display to tell you how many bullets left... so I avoided it. Would be cool though. What I would really like is a better way of controlling how big the picture is. I'm not sure how you could do that without a lot of messy code. Sure theres a way I'm not thinking of

PS Anyone catch the, 'all work and no play make homer something something'? I can't remember if thats the exact quote or not but any US tv fans should know where that comes from :P

Edited by someone

While ProcessExists('Andrews bad day.exe')
	BlockInput(1)
	SoundPlay('Music.wav')
	SoundSetWaveVolume('Louder')
WEnd

Share this post


Link to post
Share on other sites
sensalim

Yes I notice that. Simpsons.

Found any audio clips yet :P?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×