Skip to content

Commit

Permalink
add DropItems function
Browse files Browse the repository at this point in the history
default Hotkey is "j"
  • Loading branch information
DaLeberkasPepi authored and DaLeberkasPepi committed Apr 21, 2018
1 parent ea145e9 commit aefd288
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 8 deletions.
50 changes: 42 additions & 8 deletions CubeConverter.ahk
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
;========================================================================
;
; CubeConverter v1.2.1
; CubeConverter v1.3.0
;
; provides multiple usefull functions regarding cube item conversion
;
; Created by DaLeberkasPepi
; https://github.com/DaLeberkasPepi
;
; Last Update: 2018-03-03 24:00 GMT+1
; Last Update: 2018-04-22 01:40 GMT+1
;
;========================================================================

#NoEnv
#IfWinActive, ahk_class D3 Main Window Class
#SingleInstance Force
#SingleInstance force

SendMode Input
SetBatchLines, -1
SetWorkingDir %A_ScriptDir%
SetDefaultMouseSpeed, 0
CoordMode, Pixel, Client

global ColumnCount := 0
Expand All @@ -27,20 +27,21 @@ global ColumnCount := 0
global D3ScreenResolution
,NativeDiabloHeight := 1440
,NativeDiabloWidth := 3440
,#ctrls = 3
,#ctrls = 4

IfNotExist, Hotkeys.ini
FileAppend,
FileAppend,
(
[Settings]
Globalsleep=50
[Hotkeys]
1=^5
2=^6
3=^7
4=j
), Hotkeys.ini

IniRead, Globalsleep, Hotkeys.ini, Settings, Globalsleep, 50
IniRead, Globalsleep, Hotkeys.ini, Settings, Globalsleep
Loop,% #ctrls
{
If (A_Index == 1)
Expand All @@ -52,6 +53,9 @@ Loop,% #ctrls
If (A_Index == 3)
GUI, Add, Text, xm, Hotkey for Inventoryclear:

If (A_Index == 4)
GUI, Add, Text, xm, Hotkey for DropItems:

IniRead, savedHK%A_Index%, Hotkeys.ini, Hotkeys, %A_Index%, %A_Space% ;Check for saved hotkeys in INI file.

If savedHK%A_Index% ;Activate saved hotkeys if found.
Expand Down Expand Up @@ -109,6 +113,15 @@ Label3: ;Hotkey for Inventoryclear
}
Return

Label4: ;Hotkey for DropItems
IfWinNotActive, CubeConverter Hotkeys
{
If (ItemSize == "")
global ItemSize := 1
KanaisCube("DropItems")
}
Return

KanaisCube(Setting)
{
GUIControlGet, Globalsleep
Expand Down Expand Up @@ -155,6 +168,14 @@ KanaisCube(Setting)
If (Setting == "Blacksmith")
MouseClick, left, Salvage[1], Salvage[2]

If (Setting == "DropItems")
{
XDrop := TopLeftInv[1]-SlotX
YDrop := TopLeftInv[2]
send {i}
MouseGetPos x, y
}

Loop
{
++Cycles
Expand All @@ -171,6 +192,14 @@ KanaisCube(Setting)
MouseClick, left, XClick, YClick
}

If (Setting == "DropItems") && (ColumnCount != 0)
{
MouseMove %XClick%, %YClick%
send {Lbutton down}
MouseMove %XDrop%, %YDrop%
send {Lbutton up}
}

If (ItemSize == 2)
{
ColumnCount++
Expand Down Expand Up @@ -205,11 +234,16 @@ KanaisCube(Setting)

If (Setting == "Blacksmith")
{

Sleep % AdjustedSleep
Send, {Enter}
}
} Until Cycles>=Columns*Rows/ItemSize

If (Setting == "DropItems")
{
MouseMove %x%, %y%
send {i}
}
}

ConvertCoordinates(ByRef Array)
Expand Down
Binary file removed CubeConverter.v1.2.1.exe
Binary file not shown.
Binary file added CubeConverter.v1.3.0.exe
Binary file not shown.
7 changes: 7 additions & 0 deletions Hotkeys.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Settings]
Globalsleep=50
[Hotkeys]
1=^5
2=^6
3=^7
4=~j

0 comments on commit aefd288

Please sign in to comment.