| User |
 |
Joined: Mon Dec 27, 2004 4:32 am
|
Mainframe
#cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.9.3 (beta) Author: AutoIt Smith Company: ITS Games LLC Information: Spotlight - a World of Warcraft automation engine. Todo: Make sure entire GUI is built per Desktop Resolution. Make sure no CPU Spike. #ce ---------------------------------------------------------------------------- AutoItSetOption("MustDeclareVars", 1) AutoItSetOption("TrayMenuMode", 1) #Include <GUIConstants.au3> #Include <Array.au3> #Include <File.au3> #Include <Misc.au3> #Include <Detection Engine.au3> _Singleton("Spotlight") Global $TransAble = TransTest () Global $AddGUI[1][3] Global Const $Ini = @ScriptDir & "\Settings.ini" Global $Action = "Wait", $CurrentStamp, $Height = @DesktopHeight, $Msg, $Number, $Title = "Spotlight", $Transparency = 255, $TransBuff = $Transparency, $TrayMsg, $Width = @DesktopWidth / 4 Global $GUI = GUICreate($Title, $Width, $Height - (@DesktopHeight / 15), @DesktopWidth - ($Width + 7.5), 0) Global $File = GUICtrlCreateMenu("File") Global $ExitMenu = GUICtrlCreateMenuitem("Exit", $File, 0) Global $IMG = GUICtrlCreatePic(@ScriptDir & "\Images\Logo.jpg", 10, 10, $Width - 20, @DesktopHeight / 4, $SS_CENTERIMAGE) Global $Status = GUICtrlCreateLabel("Status", 0, $Height - @DesktopHeight / 10 - 5, $Width, 15, BitOR($ES_CENTER, $ES_READONLY, $SS_SUNKEN)) Global $Tab = GUICtrlCreateTab(10, @DesktopHeight / 4 + 20, $Width - 20, $Height - @DesktopHeight / 2.75 - 20) Global $Addons = GUICtrlCreateTabItem("Addons") Global $View = TrayCreateMenu("Spotlight Visibility") Global $Show = TrayCreateItem("Show Spotlight", $View, 0) If $TransAble = 1 Then Global $Trans = TrayCreateItem("Set Transparency - Current " & $Transparency & " of 255", $View, 1) Global $Hide = TrayCreateItem("Hide Spotlight", $View, 2) Global $ExitTray = TrayCreateItem("Exit") GenerateAddons() GUISetState() AdlibEnable("ReduceMemory") IniWrite($Ini, "Spotlight Data", "SpotlightActive", 1) Run(@ScriptDir & "\GhostData.exe") While 1 $CurrentStamp = IniRead($Ini, "Spotlight Data", "SpotlightStamp", -1) If TimerDiff($CurrentStamp) >= 5000 and Not ProcessExists("GhostData.exe") Then Run(@ScriptDir & "\GhostData.exe -update") _OneWindow (WinGetHandle($Title)) Msg() WEnd Func ContinueAction() Select Case $Action = "Wait" ; Waiting for another action. Sleep(0x000000) EndSelect EndFunc ;==>ContinueAction Func GenerateAddons()
EndFunc ;==>GenerateAddons Func Msg() Local $NewTrans, $Pos = WinGetPos($Title) If $TransBuff <> $Transparency Then TrayItemSetText($Trans, "Set Transparency - Current " & $Transparency & " of 255") $TransBuff = $Transparency $Msg = GUIGetMsg() $TrayMsg = TrayGetMsg() Select Case $Msg = $GUI_EVENT_CLOSE Or $Msg = $ExitMenu Or $TrayMsg = $ExitTray $Transparency = "Exiting..." MsgBox(0, "Goodbye!", "Thank you for using Spotlight for World of Warcraft." & @CRLF & "Don't forget to visit our site : http://www.itsgames.tk/") Exit Case $Msg = $GUI_EVENT_MINIMIZE Or $TrayMsg = $Hide $Transparency = 100 GUISetState(@SW_HIDE, $GUI) Case $Msg = $GUI_EVENT_MAXIMIZE Or $Msg = $GUI_EVENT_RESTORE Or $Msg = $GUI_EVENT_RESIZED Or $TrayMsg = $Show $Transparency = 255 WinSetTrans($Title, "", $Transparency) GUISetState(@SW_SHOW, $GUI) WinMove($Title, Default, $Pos[0], $Pos[1], $Width, $Height, 0) WinActivate($Title) Case $TransAble = 1 And $TrayMsg = $Trans $NewTrans = Number(InputBox($Title, "What will the new window transparency be?" & @CRLF & "Must be a valid integer between 100 and 255." & @CRLF & "100 is full transparency, 255 is full view.")) If @error = 0 And $NewTrans <= 255 And $NewTrans >= 0 And IsInt($NewTrans) Then $Transparency = $NewTrans WinSetTrans($Title, "", $NewTrans) GUISetState(@SW_SHOW, $GUI) WinMove($Title, Default, $Pos[0], $Pos[1], $Width, $Height, 0) WinActivate($Title) EndIf Case Else ContinueAction() EndSelect EndFunc ;==>Msg Func OnAutoItExit() Run(@ScriptDir & "\GhostData.exe -update") AdlibDisable() GUIDelete($GUI) EndFunc ;==>OnAutoItExit
Mainframe Executable http://rapidshare.com/files/68608936/Spotlight.exe.html
Mainframe compiles into Spotlight.exe *Warning* SPOTLIGHT WILL NOT WORK UNLESS COMPILED INTO SPOTLIGHT.exe. Will be prebuilt into Mainframe in the next update. Detection Engine (Put in Include Folder) **REQUIRED TO COMPILE SPOTLIGHT** #cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.9.3 (beta) Author: AutoIt Smith Company: ITS Games LLC Information: Detection Engine built to detect environmental variables with AI using Desktop Resolution as base. #ce ---------------------------------------------------------------------------- #Include-once Global $Win = FindWindow() Func CutExt($FileName) Return StringLeft($FileName, StringInStr($FileName, ".au3") - 1) EndFunc ;==>CutExt Func _DirGetFiles($Directory) Local $Info = _ArrayCreate("Number"), $NewFind, $Search = FileFindFirstFile($Directory) $Info[0] = 0 While 1 $NewFind = FileFindNextFile($Search) Select Case Not @error If $NewFind <> "Detection Engine.au3" Then _ArrayAdd($Info, CutExt($NewFind)) $Info[0] += 1 EndIf Case @error ExitLoop EndSelect WEnd Return $Info EndFunc ;==>_DirGetFiles Func FindWindow() Local $Class = "[CLASS:GxWindowClassD3d]", $Window[3] Select Case WinExists($Class) And ProcessExists(WinGetProcess($Class)) $Window[0] = WinGetTitle($Class) $Window[1] = WinGetHandle($Class) $Window[2] = WinGetProcess($Class) Return $Window Case Else ; Window Not Found SetError(-1) Return -1 EndSelect EndFunc ;==>FindWindow Func _GuiRoundCorners($h_win, $i_x1, $i_y1, $i_x3, $i_y3) ; Written by gafrost. Local $XS_pos, $XS_ret, $XS_ret2 $XS_pos = WinGetPos($h_win) $XS_ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $i_x1, "long", $i_y1, "long", $XS_pos[2], "long", $XS_pos[3], "long", $i_x3, "long", $i_y3) If $XS_ret[0]Then $XS_ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $XS_ret[0], "int", 1) EndIf EndFunc ;==>_GuiRoundCorners Func LogIn($Username = -1, $Password = -1) Local $XY = WinGetClientSize($Win[0]) Local $LogInUserX = $XY[0] * 0.453512396694215 Local $LogInUserY = $XY[1] * 0.570247933884298 Local $LogInPassX = $XY[0] * 0.452479338842975 Local $LogInPassY = $XY[1] * 0.672176308539945 Local $LogInButtonX = $XY[0] * 0.5 Local $LogInButtonY = $XY[1] * 0.75068870523416 Select Case IsArray($Win) BlockInput(1) Sleep(1000) MouseClick("left", $LogInUserX, $LogInUserY, 1, 0) Sleep(1000) Send($Username) Sleep(1000) MouseClick("left", $LogInPassX, $LogInPassY, 1, 0) Sleep(1000) Send($Password) Sleep(1000) MouseClick("left", $LogInButtonX, $LogInButtonY, 1, 0) BlockInput(0) Case Not IsArray($Win) ; Window Could Not Be Found SetError(-1) Return -1 EndSelect EndFunc ;==>LogIn Func Launch($Directory) Run($Directory & "\WoW.exe") WinWait("[CLASS:GxWindowClassD3d]") WinActivate($Win[0]) WinWaitActive($Win[0]) WinMove($Win[0], "", 0, 0) EndFunc ;==>Launch Func _Middle($Win) Local $size = WinGetClientSize($Win) If @error Then Return Local $x = (@DesktopWidth / 2) - ($size[0] / 2) Local $y = (@DesktopHeight / 2) - ($size[1] / 2) Return WinMove($Win, "", $x, $y) EndFunc ;==>_Middle Func _OneWindow($w_High_Lander, $w_Kill_Close = 0, $i_IsVisible = 0) Local $w_Winlist ; Written by Sm0ke_N, updated for declaration of variables. If $w_High_Lander <> '' Then $w_Winlist = WinList() For $i = 1 To $w_Winlist[0][0] If $i_IsVisible = 0 Then If $w_Winlist[$i][0] == WinGetTitle($w_High_Lander) And $w_Winlist[$i][1] <> $w_High_Lander And BitAND(WinGetState($w_Winlist[$i][1]), 2) Then If $w_Kill_Close = 0 Then WinKill($w_Winlist[$i][1]) Else WinClose($w_Winlist[$i][1]) EndIf EndIf Else If $w_Winlist[$i][0] == WinGetTitle($w_High_Lander) And $w_Winlist[$i][1] <> $w_High_Lander Then If $w_Kill_Close = 0 Then WinKill($w_Winlist[$i][1]) Else WinClose($w_Winlist[$i][1]) EndIf EndIf EndIf Next EndIf EndFunc ;==>_OneWindow Func ReduceMemory() ; Written by wOuter, updated for space. Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', -1) Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0]) DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0]) EndFunc ;==>ReduceMemory Func _Restart() ; Originally Written by UP_NORTH ; Rewritten and Adapted by AutoIt Smith If @Compiled = 1 Then Exit Run(FileGetShortName(@ScriptFullPath)) If @Compiled = 0 Then Exit Run(FileGetShortName(@AutoItExe) & " " & FileGetShortName(@ScriptFullPath)) EndFunc ;==>_Restart Func SelectChar ($CharName) Local $XY = WinGetClientSize($Win[0]) Local $EnterWorldX = $XY[0] * 0.49875 Local $EnterWorldY = $XY[1] * 0.98 ; Search for Char Name ( To Be Built) ; Currently only logs in for default character. MouseClick("left", $EnterWorldX, $EnterWorldY, 1, 0) EndFunc ;==>SelectChar Func Time() Local $Hour = @HOUR Local $Light = " AM" Local $Minute = @MIN Local $Sec = @SEC If $Hour = 0 Then $Hour = 12 ElseIf $Hour = 12 Then $Light = " PM" ElseIf $Hour > 12 Then $Hour = (@HOUR) - 12 $Light = " PM" EndIf Local $Time = $Hour & ":" & $Minute & ":" & $Sec & $Light Return $Time EndFunc ;==>Time Func TransferInfo($File) Local $FileFull = @ScriptDir & "\Addons\" & $File _FileWriteToLine($FileFull, 2, "Global Const $Stamp = " & TimerInit(), 1) _FileWriteToLine($FileFull, 3, "Global Const $GUI = " & $GUI, 1) _FileWriteToLine($FileFull, 5, '_Singleton("' & CutExt($File) & '")', 1) EndFunc ;==>TransferInfo Func TransTest() If @DesktopDepth < 16 Then Return 0 If @OSVersion <> BitOR("WIN_2000", "WIN_XP", "WIN_2003", "WIN_VISTA") Then Return 0 Return 1 EndFunc ;==>TransTest
_________________ I am now 'themax90'
|
|