[HelpBot]BoxTool NOEXE

Spring EngineTools

1.0
1774 (3 today)
No votes yet

File Information

Title / Version [HelpBot]BoxTool NOEXE 1.0
License Freeware / Free
Date 02/02/2015 - 11:23
Changed 02/06/2015 - 01:34
Publisher / Author lesitespring (Uploaded by lesitespring)
Keywords

Description

#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
SetBatchLines, -1 ;
SetWinDelay, -1 ;

;---------------------------------------
;[HelpBot]BoxTool
;---------------------------------------
;Boxes position autotool for springlobby
;---------------------------------------
;AUTHOR:Senethril1985
;DATE:01/02/2015
;
;---------------------------------------

;
;1.DOWNLOAD THE TXT FILE OR COPY DOCUMENT
;2.README HERE
;3.PREREQUESITES
;4.INSTALL INSTRUCTIONS
;5.CONFIGURATION MARKED WITH *** .. ***
;6.TODO
;7.THE SCRIPT
;
;
;
;1.
;ITS HERE NOWHERE AWAY
;2.
;DATE - AUTHOR - LANGUAGE - README - DEFAULTS SHORTCUTS - TODO
;3.
;Autohotkey(http://en.wikipedia.org/wiki/AutoHotkey - http://www.autohotkey.com/docs/commands.htm) not L version.
;4.
;COPY/PASTE entirely this document into a new fresh file named whatyouwant.AHK
; Install a recent autohotkey version but not the L version just in case of...
;Maybe need to reboot but script should have changed icon and you can test the script directly but if you want you can compile it
; directly into an executable that produce exactly the same, do it by right clicking on script, others menu on systray icon if you cannot
; configure this script....
;5.
;***SHORCUTS*** are explained more in detail though the document(^=Control +=Shift ~=Alt #=WINKEY ...see list of ahk shortcuts of a keyboard.)
;6.
;Choosen variable coming soon: shorcuts to add a set of players(all commands in one copy/paste) based on a rectangle that come from
; center to the edges, always inside a bigger box, you separe them by the same distance relative to the bigbox, just need shotcuts that
; deactive others shortcuts momentaly to use them and next reactive with the same numbers of player choosen ex:CONTROL+DIGIT
;
;Fix recognize windows springlobby(so futur fix is allow not only this
;windows...)
;

MSG:="Little tool to convert mouse selection into parameters for addBoxes command in springlobby. Shift+LeftMouseButton:Begin to draw a rectangle around the minimap from left to right. Control+LeftMouseButton:Draw a box on the map. Shift+Digit:Fill your clipboard with latest selected box into coordinates. Ctrl+v:Paste last clipboard remain in the current view."
MsgBox, %MSG%

global L:=0
global T:=0
global R:=0
global B:=0
;_________________________________________________________________________________
BW := 2
BC := "Orange"
;_________________________________________________________________________________
FirstCall := True
CoordMode, Mouse, Screen
Gui, -Caption +ToolWindow +LastFound +AlwaysOnTop
Gui, Color, %BC%
;*** SHORTCUTS SO SHIFT+DIGIT ***
1::PasteIntoClipboard(1)
2::PasteIntoClipboard(2)
3::PasteIntoClipboard(3)
4::PasteIntoClipboard(4)
5::PasteIntoClipboard(5)
6::PasteIntoClipboard(6)
7::PasteIntoClipboard(7)
8::PasteIntoClipboard(8)
9::PasteIntoClipboard(9)

PasteIntoClipboard(Number)
{
L:=Round(L)
T:=Round(T)
R:=Round(R)
B:=Round(B)
thecommand=!addBox %L% %T% %R% %B% %Number%
clipboard = %thecommand%
}
Return
; ________________________________________________________________________________
;_________________________________________________________________________________

;*** SHORTCUTS SHIFT + LEFTMOUSE BUTTON ***
+LButton::
Gui, Color, ORANGE
MouseGetPos, OriginX, OriginY
SetTimer, DrawRectangle, 10
Return
;_________________________________________________________________________________
;*** SHORTCUTS SHIFT + LEFTMOUSE BUTTON ***
+LButton Up::
SetTimer, DrawRectangle, Off
FirstCall := True
Gui, Cancel
ToolTip
Xa=%X1%
Ya=%Y1%
Wa=%W1%
Ha=%H1%
Return
;_________________________________________________________________________________
;*** SHORTCUTS CONTROL + LEFTMOUSE BUTTON ***
^LButton::
Gui, Color, GREEN
MouseGetPos, OriginX, OriginY
SetTimer, DrawRectangle, 10
Return
;_________________________________________________________________________________
;*** SHORTCUTS CONTROL + LEFTMOUSE BUTTON ***
^LButton Up::
SetTimer, DrawRectangle, Off
FirstCall := True
Gui, Cancel
ToolTip
Xb=%X1%
Yb=%Y1%
Wb=%W1%
Hb=%H1%

L:= Wa/(Xb-Xa)
L:=200/L

T:=Ha/(Yb-Ya)
T:=200/T

RightX:=Wa-(Xb-Xa)-Wb
RightX:=Wa/(RightX)
R:=200-(200/RightX)

BottomY:=Ha-(Yb-Ya)-Hb
BottomY:=Ha/(BottomY)
B:=200-(200/BottomY)

Return
;_________________________________________________________________________________
;_________________________________________________________________________________
DrawRectangle:
MouseGetPos, X2, Y2
If (XO = X2) And (YO = Y2)
Return
Gui, +LastFound
XO := X2, YO := Y2
If (X2 < OriginX)
X1 := X2, X2 := OriginX
Else
X1 := OriginX
If (Y2 < OriginY)
Y1 := Y2, Y2 := OriginY
Else
Y1 := OriginY
W1 := X2 - X1, H1 := Y2 - Y1
W2 := W1 - BW, H2 := H1 - BW
WinSet, Region, 0-0 %W1%-0 %W1%-%H1% 0-%H1% 0-0 %BW%-%BW% %W2%-%BW% %W2%-%H2% %BW%-%H2% %BW%-%BW%
If (FirstCall) {
Gui, Show, NA x%X1% y%Y1% w%W1% h%H1%
FirstCall := False
}
WinMove, , , X1, Y1, W1, H1
Return