It's a partly translation from russian forum horadric.ru with my little additions, Almost all credits go to Overlol and ppl who created it there.
This script is for:
Keyboard devices (G15, G11, G19)
Left handed controllers (G13)
Gaming mouse (G300, G400)
What it does:
Fast mf gear equip / switch
Controls:
1) G2 shows mouse coords on device display
2) G12 (original) / G4 (my ver) switch gear
How to use:
You'll need Logitech Gaming Software (get it here)
1) Open Logitech Gaming Software and then open Scripting
2) Copy & paste code
Original version (works on pressing G12 button)
Code:
function OnEvent(event, arg)
if (event == "G_PRESSED" and arg == 12) then
Letterbox = "X"
Random = "X"
--Save current cursor position
x, y = GetMousePosition();
--Open Inventory
PressAndReleaseKey("c")
Sleep(20);
--Equip items by X and Y axis, Item Volume (1 or 2), IsLetterbox(VideoOption in game "X" if set),
--IsRandom(set "X' if you need random mouse pointer), Modificator ("ralt", etc)
EquipItemInventory(10, 5, 2, Letterbox, Random)
EquipItemInventory(9, 5, 2, Letterbox, Random)
EquipItemInventory(8, 5, 1, Letterbox, Random)
EquipItemInventory(8, 6, 1, Letterbox, Random)
EquipItemInventory(7, 5, 2, Letterbox, Random)
EquipItemInventory(6, 5, 2, Letterbox, Random)
--Close Inventory
PressAndReleaseKey("c")
MoveMouseTo(x, y)
end
-------------------------------------------
--View current mouse position on LCD screen
if (event == "G_PRESSED" and arg == 2) then
ClearLCD ()
x, y = GetMousePosition();
OutputLCDMessage("Mouse is at x=" .. x .. "; y= " .. y, 60000)
-- OutputLogMessage("x=" .. x .. "; y= " .. y .. "\n")
end
end
----------------------------------------
--Random clicking inside square limits--
----------------------------------------
function EquipItemInventory (Item_X, Item_Y, SlotVolume, IsLetterbox, IsRandom, Modify)
--Default values
if IsLetterbox == "X" then
MinVal_X = {48400, 50600, 51800, 53500, 55200, 56700, 58500, 60200, 61800, 63500}
MaxVal_X = {49400, 51000, 52700, 54300, 56000, 57700, 59300, 61000, 62700, 64300}
MinVal_Y = {35700, 38500, 41000, 43800, 46400, 48800}
MaxVal_Y = {37700, 39800, 42500, 45000, 47700, 50200}
else
MinVal_X = {46600, 48400, 50300, 52100, 53900, 55800, 57500, 59500, 61300, 63100}
MaxVal_X = {47600, 49500, 51300, 53200, 55100, 56900, 58800, 60500, 62500, 64200}
MinVal_Y = {36200, 39000, 41800, 44800, 47800, 50500}
MaxVal_Y = {37300, 40500, 43500, 46500, 49450, 52100}
end
--Use random function
if IsRandom == "X" then
MouseX = MinVal_X[Item_X] + math.random(1, math.abs(MaxVal_X[Item_X] - MinVal_X[Item_X]))
if SlotVolume == 1 then
MouseY = MinVal_Y[Item_Y] + math.random(1, math.abs(MaxVal_Y[Item_Y] - MinVal_Y[Item_Y]))
elseif SlotVolume == 2 then
MouseY = MinVal_Y[Item_Y] + math.random(1, math.abs(MaxVal_Y[Item_Y+1] - MinVal_Y[Item_Y]))
end
else
MouseX = math.ceil((MinVal_X[Item_X] + MaxVal_X[Item_X])/2)
if SlotVolume == 1 then
MouseY = math.ceil((MinVal_Y[Item_Y] + MaxVal_Y[Item_Y])/2)
elseif SlotVolume == 2 then
MouseY = math.ceil((MinVal_Y[Item_Y] + MaxVal_Y[Item_Y+1])/2)
end
end
MoveMouseTo(MouseX, MouseY)
if Modify then
PressKey(Modify)
Sleep(50);
end
--Mouse right click
PressAndReleaseMouseButton(3)
Sleep(100);
if Modify then
ReleaseKey(Modify)
Sleep(50);
end
end
My version (works on pressing G4 button; added random time before right clicking item; equip 2nd ring):
Code:
function OnEvent(event, arg)
if (event == "G_PRESSED" and arg == 4) then
Letterbox = ""
Random = "X"
--Save current cursor position
x, y = GetMousePosition();
--Open Inventory
PressAndReleaseKey("c")
Sleep(20);
--Equip items by X and Y axis, Item Volume (1 or 2), IsLetterbox(VideoOption in game "X" if set),
--IsRandom(set "X' if you need random mouse pointer), Modificator ("ralt", etc)
EquipItemInventory(2, 1, 1, Letterbox, Random)
EquipItemInventory(2, 2, 1, Letterbox, Random)
EquipItemInventory(3, 1, 1, Letterbox, Random)
EquipItemInventory(3, 2, 1, Letterbox, Random, "lalt")
EquipItemInventory(4, 1, 2, Letterbox, Random)
EquipItemInventory(5, 1, 2, Letterbox, Random)
EquipItemInventory(6, 1, 2, Letterbox, Random)
EquipItemInventory(7, 1, 2, Letterbox, Random)
EquipItemInventory(8, 1, 2, Letterbox, Random)
EquipItemInventory(9, 1, 2, Letterbox, Random)
EquipItemInventory(10, 1, 2, Letterbox, Random)
--Close Inventory
PressAndReleaseKey("c")
MoveMouseTo(x, y)
end
-------------------------------------------
--View current mouse position on LCD screen
if (event == "G_PRESSED" and arg == 2) then
ClearLCD ()
x, y = GetMousePosition();
OutputLCDMessage("Mouse is at x=" .. x .. "; y= " .. y, 2000)
-- OutputLogMessage("x=" .. x .. "; y= " .. y .. "\n")
end
end
----------------------------------------
--Random clicking inside square limits--
----------------------------------------
function EquipItemInventory (Item_X, Item_Y, SlotVolume, IsLetterbox, IsRandom, Modify)
--Default values
if IsLetterbox == "X" then
MinVal_X = {48400, 50600, 51800, 53500, 55200, 56700, 58500, 60200, 61800, 63500}
MaxVal_X = {49400, 51000, 52700, 54300, 56000, 57700, 59300, 61000, 62700, 64300}
MinVal_Y = {35700, 38500, 41000, 43800, 46400, 48800}
MaxVal_Y = {37700, 39800, 42500, 45000, 47700, 50200}
else
MinVal_X = {48933, 50610, 52351, 53951, 55630, 57301, 58975, 60580, 62253, 63930}
MaxVal_X = {48938, 50614, 52353, 53958, 55633, 57304, 58979, 60482, 62256, 63934}
MinVal_Y = {36200, 39000, 41800, 44800, 48461, 51561}
MaxVal_Y = {37700, 40500, 43500, 46500, 48468, 51566}
end
--Use random function
if IsRandom == "X" then
MouseX = MinVal_X[Item_X] + math.random(1, math.abs(MaxVal_X[Item_X] - MinVal_X[Item_X]))
if SlotVolume == 1 then
MouseY = MinVal_Y[Item_Y] + math.random(1, math.abs(MaxVal_Y[Item_Y] - MinVal_Y[Item_Y]))
elseif SlotVolume == 2 then
MouseY = MinVal_Y[Item_Y] + math.random(1, math.abs(MaxVal_Y[Item_Y+1] - MinVal_Y[Item_Y]))
end
else
MouseX = math.ceil((MinVal_X[Item_X] + MaxVal_X[Item_X])/2)
if SlotVolume == 1 then
MouseY = math.ceil((MinVal_Y[Item_Y] + MaxVal_Y[Item_Y])/2)
elseif SlotVolume == 2 then
MouseY = math.ceil((MinVal_Y[Item_Y] + MaxVal_Y[Item_Y+1])/2)
end
end
MoveMouseTo(MouseX, MouseY)
if Modify then
PressKey(Modify)
Sleep(50);
end
--Mouse right click
PressAndReleaseMouseButton(3)
--Right click with random time from 100 ms to 150
Sleep(math.random(100,150));
if Modify then
ReleaseKey(Modify)
Sleep(50);
end
end
So you'll get
Now save and close the window.
!!!Attention!!!
You'll need to unbind G buttons from default binds (g1=f1, g2=f2 and so on), this maybe the case if it won't work,
Also inventory must be closed and don't move mouse while it switching gear!
How to add, remove or change items
Original version
Inventory is divided in cells with X and Y coordinates
In this example we change 6 items
EquipItemInventory(10, 5, 2, Letterbox, Random) - we equip helm in cell with coords X=10 and Y=5
EquipItemInventory(9, 5, 2, Letterbox, Random) - gloves
EquipItemInventory(8, 5, 1, Letterbox, Random) - amulet
EquipItemInventory(8, 6, 1, Letterbox, Random)
EquipItemInventory(7, 5, 2, Letterbox, Random)
EquipItemInventory(6, 5, 2, Letterbox, Random)
Function EquipItemInventory consists of
1) cell with X coordinate (from 1 to 10)
2) cell with Y coordinate (from 1 to 6) (If item occupy 2 cells you need to write the top cell of it)
3) size of the cell (how many cells item occupy)
4) letterbox - in case if this options is on in the game options ("X" or "")
5) random - random click in cell where item is (if thi option is enabled in script with "X")
6) modificator - if you'll need to equip ring in the 2nd slot
ex: EquipItemInventory(3, 2, 1, Letterbox, Random, "lalt")
As for my version:
EquipItemInventory(2, 1, 1, Letterbox, Random) - amulet
EquipItemInventory(2, 2, 1, Letterbox, Random) - belt
EquipItemInventory(3, 1, 1, Letterbox, Random) - ring
EquipItemInventory(3, 2, 1, Letterbox, Random, "lalt") - 2nd ring
EquipItemInventory(4, 1, 2, Letterbox, Random)
EquipItemInventory(5, 1, 2, Letterbox, Random)
EquipItemInventory(6, 1, 2, Letterbox, Random)
EquipItemInventory(7, 1, 2, Letterbox, Random)
EquipItemInventory(8, 1, 2, Letterbox, Random)
EquipItemInventory(9, 1, 2, Letterbox, Random)
EquipItemInventory(10, 1, 2, Letterbox, Random)