Jump to content

My Personal Junkyard


Diarazad
 Share

Recommended Posts

There are some scripts that i've written occasionly during different work or research. They're quite useless by themselves but sometimes i do use 'em in some larger programs. Try it, enjoy.

1. This program automatically hides any title you would click. I intended to call this script "Black Widow" 'cause it does devoid windows from their titles :) .

Some windows (ex. Far, Task Manager) do resist such an "title execution". Script unloads itself as only you would move your mouse to the left upper corner of your desktop.

You may run compiled script with param "hazard" (as "hider.exe hazard") and it won't unload itself completely (kill it with Task Manager). Beware: with this param script may become harmful for some users.

;Window Hider v1.01 (c) 2006 Rusted
;----------------------------------
#include <Misc.au3>
#include <AnyGUI.au3>
;----------------------------------
AutoItSetOption("WinTitleMatchMode",2)
AutoItSetOption("MouseCoordMode",1)
AutoItSetOption("TrayIconHide",1)
;----------------------------------
Dim $Pos[4]
Dim $MousePos[2]
$Interval = 100
$Hazard = 0
If $CmdLine[0] > 0 Then 
  if StringLower($CmdLine[1] = "hazard") then $Hazard = 1
EndIf
AdlibEnable("WHider",$Interval)
While 1
  Sleep(10000)
WEnd
Exit

Func WHider()
  $MousePos = MouseGetPos()
  if (NOT $Hazard)AND($MousePos[0] = 0)AND($MousePos[1] = 0) then Leave()
  If _IsPressed(1) then
    $title = WinGetTitle("")
    $Pos = WinGetPos("")
    $x = $MousePos[0] - $Pos[0]
    $y = $MousePos[1] - $Pos[1]
    If ($x>=0)AND($x<=$Pos[2])AND($y>=0)AND($y<=22) Then
      $handle = WinGetHandle("")
      $xhandle = _GuiTarget($handle,1)
      $Style = $WS_Caption
      $ExStyle = -1
      $result = _TargetStyle("unset",1,$Style,$ExStyle,$xhandle)
    EndIf
  EndIf
EndFunc

Func Leave()
  MsgBox(0,"Goodbye","WinHider is leaving your memory")
  Exit
EndFunc

whider.rar

2. This prog makes any active window to migrate constantly. Direction is random, frequency and intensity of migration is controllable through the $Interval and $Range variables.

Same param "hazard" is accessible. Use it with caution.

;Window Shifter v1.01 (c) 2006 Rusted
;----------------------------------
AutoItSetOption("MouseCoordMode",1)
AutoItSetOption("TrayIconHide",1)
;----------------------------------
Dim $Pos[4]
Dim $MousePos[2]
$Range = 10
$Interval = 100
$Hazard = 0
If $CmdLine[0] > 0 Then 
  if StringLower($CmdLine[1] = "hazard") then $Hazard = 1
EndIf
AdlibEnable("Shifter",$Interval)
While 1
WEnd
  Sleep(10000)
Exit

Func Shifter()
  $MousePos = MouseGetPos()
  if (NOT $Hazard)AND($MousePos[0] = 0)AND($MousePos[1] = 0) then Leave()
  $Pos = WinGetPos("")
  $x = $Pos[0] + round(Random(-$Range*100,$Range*100)/100)
  $y = $Pos[1] + round(Random(-$Range*100,$Range*100)/100)
  WinMove("","",$x,$y)
EndFunc

Func Leave()
  MsgBox(0,"Goodbye","WinShifter is leaving your memory")
  Exit
EndFunc

wshifter.rar

3. Here's one more utility. It was written for Diablo2 and does make quick exit if you hit an <Esc> key twice. This script just register double-hit and instantly clicks on "Save and Exit" Diablo2 menu string.

Seems like this script is not such a useless one. But it's so small and simple so i cannot post it by individual topic.

; - -    -  -;
; Diablo2 Fast Exit;
;   -   -    -   ;
AutoItSetOption("MouseCoordMode",2)
AutoItSetOption("MouseClickDelay",10)
AutoItSetOption("MouseClickDownDelay",10)
; - preventing running second copy of this script -
AutoItSetOption("WinTitleMatchMode",3)
If WinExists("Diablo2 FastExit Tool") Then
  MsgBox(0,"Script won't launch","Another copy of this script is already running")
  Exit
EndIf
AutoItWinSetTitle("Diablo2 FastExit Tool")
; - fase game exit -
$ExitMS = 200
$EscStart = TimerInit()
Dim $EscMS
Dim $ExitPoint[2]
$ExitPoint[0] = 400
$ExitPoint[1] = 275
HotKeySet("{ESC}","FastExit")
While 1
  Sleep(10000)
WEnd

;sub to perform Double-ESC fast game exit
Func FastExit()
  $EscMS = TimerDiff($EscStart)
  if $EscMS < $ExitMS then MouseClick("left",$ExitPoint[0],$ExitPoint[1],1,0)
  $EscStart = TimerInit()
  HotKeySet("{ESC}")
  Send("{ESC}")
  HotKeySet("{ESC}","FastExit")
EndFunc

fastexit.rar

May be i would add one more script in future. But remember: they are just for fun.

Edited by Diarazad

I have been walking shadow ways to land where Terror rules...

Link to comment
Share on other sites

those are some nice little scripts, you should make like a little joke shop udf or somethin just in case someone wanted to make a joke application to send to a friend. BUT you would have to set limits because some people would abuse this power then would ruin it for all of the rest.

50% of the time, it works all the time

Link to comment
Share on other sites

Added new little script.

3. Here's one more utility. It was written for Diablo2 and does make quick exit if you hit an <Esc> key twice. This script just register double-hit and instantly clicks on "Save and Exit" Diablo2 menu string.

2PezoFaSho: udf? quite possible if number of these tiny codes would overgrow. I suppose this won't happen any soon. But the only way to "set limits" i see is to limit it by free-like license agreement.

I have been walking shadow ways to land where Terror rules...

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...