Register for your free account! | Forgot your password?

Go Back   elitepvpers > Diablo 3 > Diablo 3 Hacks, Bots, Cheats & Exploits
You last visited: Today at 17:33

  • Please register to post and access all features, it's quick, easy and FREE!

 

D3EQ - Diablo 3 Equip Switcher

Reply
 
Old   #16
 
elite*gold: 0
Join Date: Jun 2012
Posts: 1
Received Thanks: 0
Quote:
Originally Posted by TheOnlyOne652089 View Post
Making the coords hard coded is not good.

My little script here will left click the item and place it in the slot you recorded, saved in a ini file with the client resolution (which is smaller than the actual one the game specifies in window mode).

To avoid clicks and other input you can blockInput for the short duration of the script, which requires admin rights.

As it is, the script is canceld by ESC, but you can change that.


The script will also send "s" before "c" so it works regardless if the inventory is open or not (it will allways open it, if you do not send s before, it will just close an allready open inventory, which is bad).


Maybe use a bunch of the code parts to improve your script and give me credits in your source code if you do so.


RECORDER
Code:
#include <Misc.au3>
_Singleton(@ScriptName)

AutoItSetOption ( "MouseCoordMode", 2)

Global $winTitle = "Diablo III"
Global $hWnd = WinGetHandle($winTitle)

HotKeySet("{ESC}", "_exit")
Func _exit()
	Exit 0
EndFunc

Global $iniFile = getIniFileName()
Func getIniFileName()
	local $clientSize = WinGetClientSize($winTitle)
	local $name = "COORD_" & $clientSize[0] & "x" & $clientSize[1] & ".ini"

	return $name
EndFunc
Global $item_names[13] = ["Helm","Shoulder","Body","Hand","Arm","Leg","Boots","Belt","Amulet","LeftRing","RightRing","LeftWeapon","RightSupport"]

Global $curCoordCount = 0
Global $coordMode = "Inventory"

HotKeySet("{Right}", "_countNext")
Func _countNext()
	if ($coordMode == "Inventory") Then
		$coordMode = "BodyPart"
	Else
		$curCoordCount+=1
		if ($curCoordCount >= UBound($item_names)) Then
			$curCoordCount = 0
		EndIf

		$coordMode = "Inventory"
	EndIf
EndFunc

HotKeySet("{Left}", "_countBack")
Func _countBack()

	if ($coordMode == "Inventory") Then
		$curCoordCount-=1
		if ($curCoordCount < 0) Then
			$curCoordCount = UBound($item_names)-1
		EndIf
		$coordMode = "BodyPart"
	Else
		$coordMode = "Inventory"
	EndIf
EndFunc

HotKeySet("{+}", "_addCoord")
Func _addCoord()
	local $mousePos = MouseGetPos()
	local $x = $mousePos[0]
	local $y = $mousePos[1]

	if ($coordMode == "Inventory") Then
		IniWrite($iniFile, $item_names[$curCoordCount], $coordMode & "_x", $x)
		IniWrite($iniFile, $item_names[$curCoordCount], $coordMode & "_y", $y)
	Else
		IniWrite($iniFile, $item_names[$curCoordCount], $coordMode & "_x", $x)
		IniWrite($iniFile, $item_names[$curCoordCount], $coordMode & "_y", $y)
	EndIf

	_countNext()
EndFunc

HotKeySet("{-}", "_removeCoord")
Func _removeCoord()
	_countBack()
	if ($coordMode == "Inventory") Then
		IniDelete($iniFile, $item_names[$curCoordCount], $coordMode & "_x")
		IniDelete($iniFile, $item_names[$curCoordCount], $coordMode & "_y")
	Else
		IniDelete($iniFile, $item_names[$curCoordCount], $coordMode & "_x")
		IniDelete($iniFile, $item_names[$curCoordCount], $coordMode & "_y")
	EndIf
EndFunc

ToolTip("RECORDER READY",0,0)
While (WinExists($winTitle))
	local $mousePos = MouseGetPos()
	ToolTip("Item: " & $item_names[$curCoordCount] & " : " & $coordMode & @CRLF & _
		"MousePos[" & $mousePos[0] & ", " & $mousePos[1] & "]",0,0)
	sleep(50)
WEnd

AutoEquipper

Code:
#RequireAdmin

#include <Misc.au3>
_Singleton(@ScriptName)

AutoItSetOption ( "MouseCoordMode", 2)

Global $winTitle = "Diablo III"
Global $hWnd = WinGetHandle($winTitle)

HotKeySet("{ESC}", "_exit")
Func _exit()
	Exit 0
EndFunc

Global $iniFile = getIniFileName()
Func getIniFileName()
	local $clientSize = WinGetClientSize($winTitle)
	local $name = "COORD_" & $clientSize[0] & "x" & $clientSize[1] & ".ini"

	return $name
EndFunc
Global $item_names[13] = ["Helm","Shoulder","Body","Hand","Arm","Leg","Boots","Belt","Amulet","LeftRing","RightRing","LeftWeapon","RightSupport"]

Global $Inventory_coords[13][2]
Global $BodyPart_coords[13][2]

Func _readCoordsFromIniFile()

	if (NOT FileExists($iniFile)) Then
		MsgBox("", "ERROR", $iniFile & " not found. Use Record first")
		_exit()
	EndIf

	local $sectionNames = IniReadSectionNames($iniFile)
	if (UBound($sectionNames) < 1) Then
		local $ret
		$ret = MsgBox(1, $iniFile & " ERROR", $iniFile & " is empty, delete it ?")
		if ($ret == 1) Then
			FileDelete($iniFile)
			_exit()
		Else
			_exit()
		EndIf
	EndIf

	ReDim $Inventory_coords[UBound($sectionNames)][2]
	ReDim $BodyPart_coords[UBound($sectionNames)][2]
	for $i = 1 to UBound($sectionNames)-1
		$Inventory_coords[$i][0] = IniRead($iniFile, $sectionNames[$i],  "Inventory_x", 0)
		$Inventory_coords[$i][1] = IniRead($iniFile, $sectionNames[$i],  "Inventory_y", 0)

		$BodyPart_coords[$i][0] = IniRead($iniFile, $sectionNames[$i],  "BodyPart_x", 0)
		$BodyPart_coords[$i][1] = IniRead($iniFile, $sectionNames[$i],  "BodyPart_y", 0)
	Next

EndFunc


HotKeySet("{F1}", "_equip")
Func _equip()

	BlockInput(1)

	ControlSend($winTitle, "", $hWnd, "s")
	sleep(100)
	ControlSend($winTitle, "", $hWnd, "c")

	for $i = 1 to UBound($Inventory_coords)-1
		ControlClick($winTitle, "", $hWnd, "left", 1, $Inventory_coords[$i][0], $Inventory_coords[$i][1])
		ControlClick($winTitle, "", $hWnd, "left", 1, $BodyPart_coords[$i][0], $BodyPart_coords[$i][1])
	Next

	ControlSend($winTitle, "", $hWnd, "c")

	BlockInput(0)

EndFunc

HotKeySet("{F2}", "_unequip")
Func _unequip()

	BlockInput(1)

	ControlSend($winTitle, "", $hWnd, "s")
	sleep(100)
	ControlSend($winTitle, "", $hWnd, "c")

	for $i = 1 to UBound($Inventory_coords)-1
		ControlClick($winTitle, "", $hWnd, "left", 1, $BodyPart_coords[$i][0], $BodyPart_coords[$i][1])
		ControlClick($winTitle, "", $hWnd, "left", 1, $Inventory_coords[$i][0], $Inventory_coords[$i][1])
	Next

	ControlSend($winTitle, "", $hWnd, "c")

	BlockInput(0)

EndFunc


_readCoordsFromIniFile()
While (WinExists($winTitle))
	sleep(500)
WEnd

can you give instructions on how to use the recorder and after that?



sabrac123 is offline  
Old   #17
 
elite*gold: 50
Join Date: May 2008
Posts: 2,216
Received Thanks: 1,821
Quote:
Originally Posted by sabrac123 View Post
can you give instructions on how to use the recorder and after that?
Well, its quite simpel.


Just run the Recorder the first time.

It will display the "mousecoords" of your mouse if "Diablo III" window is open.

Then you put your mouse over the item it specifies, like "Helm Inventory" you put your mouse over the Helm in your Inventory and then press "+" on your keyboard to write it in a .ini file (which it creates) at your computer were the au3 is aswell.

Then for "helm BodyPart" you put your mouse at the Head, were the equipped Helm would be placed (the body in the top of the inventory, equipped items), press "+" again.

Do that for each item.

In case you do NOT have the item it asks for, just press "Right" Arrow key on your keyboard to skip it (it will not write that in the .ini file).



If you are done with the Recorder, just use the AutoEquipper.

It will at the beginning read the .ini file that meats your actual used resolution of the client size window of Diablo III and get the coords you recorded from it.

As it is, "ESC" will terminate the script, you can change that in the source code (or remove it entirely).

The script will terminate itself if no Window named "Diablo III" exists.


If you press F1 (also you can change that in SourceCode, like any hotkey that is specified with "hotkeyset") it will perform the equip part with mouseClicks on the item in the inventory and places it with another click on the position of the Body you recorded.
It will use "s" before to make sure the character inventory screen is not allready open (as pressing s will close it, in case, so it does not perform the clicks if the inventory is not open).

F2 will perform the reversed and just "unequip" everything ; like allways you can simply remove that in the Source code or change the hotkey.



*Addition info:

To have extra protection the script will block all your mousemovements and keyboard input while the "equip" is performend, this blockinput requires adminrights, and its quick anyway. This should prevent accidently dropping items, as you cannot mess with the equip part.


Also, it will use "ControllClicks" instead of normal MouseClicks, which do not use the actual mouse, but send the mouseEvents like "leftclick" directly to the specified handle (hwnd) of the controll (here the Diablo III window).

So in case something is above the window, it will still send the mouseclick only to Diablo III, which also works if Diablo III is minimized, or anything else.
Best thing in addition, it will keep your actual mouse at the position it is, other than moving it around, and its slighty quicker aswell.



Yes, the script is writen quickly and the actual idea was that the initial poster and creators of this EquipSwitcher Scripts will use it as inspiration to use .ini reads instead of hardcoded coords (which are plain bad, if the tool wants to work on each resolution).


TheOnlyOne652089 is offline  
Old   #18
 
elite*gold: 0
Join Date: Nov 2007
Posts: 1
Received Thanks: 0
Quote:
Originally Posted by Childish View Post
It works perfect, I'll help those who don't understand. I've been using it for 2 days now perfectly.
(1280x1024 version included at the end of this post)
Downloads included at the end for the lazy people, I like making life easy.

NOTE:
The keys can be modified.
F6 = Execute the script
C = Inventory

Click F6 while in-game to make it switch your gear. Do not move your mouse for a second when you execute it.
You must register and activate your account in order to view images.



(HD Ver - 1920x1080)
1.Download AutoIt
2.Open SciTE Script Editor and copy paste this
Code:
Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{DELETE}","terminate")
$runs = 0
While 1
   WinActivate("Diablo III")
HotKeySet("{F6}")
    Send("{F6}")
    HotKeySet("{F6}", "EquipSwitcher")
 
WEnd

Func EquipSwitcher()
Send('{c}')

MouseClick ( "right", 1434, 612, 1, 1)
MouseClick ( "right", 1486, 612, 1, 1)
MouseClick ( "right", 1524, 612, 1, 1)
MouseClick ( "right", 1580, 612, 1, 1)
MouseClick ( "right", 1629, 612, 1, 1)
MouseClick ( "right", 1672, 612, 1, 1)
MouseClick ( "right", 1729, 612, 1, 1)
MouseClick ( "right", 1768, 612, 1, 1)
MouseClick ( "right", 1824, 609, 1, 1)
MouseClick ( "right", 1823, 664, 1, 1)
MouseCLick ( "right", 1874, 606, 1, 1)
Send('{ALT down}')
Sleep(100)
MouseClick ( "right", 1866, 656, 1, 1)
Send('{ALT up}')
Send('{c}')
EndFunc

Func TogglePause()
    $Paused = Not $Paused
    While $Paused
        Sleep(100)
        ToolTip('Script is "Paused"', 0, 0)
    WEnd
    ToolTip("")
 EndFunc   ;==>TogglePause
 
 Func terminate()
        Local $pos = MouseGetPos()
                 MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1] & "Runs " & $runs)
        Exit 0
	 EndFunc
3.File -> Save As
4.Open Compile Script to .exe (x86) (because it works in 32bit not 64bit obviously)
5.Choose the file u saved and then choose the destination folder for the compiled file.
6.Start it and have fun.



(1280x1024)
1.Download AutoIt
2.Open SciTE Script Editor and copy paste this
Code:
Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{DELETE}","terminate")
$runs = 0
While 1
   WinActivate("Diablo III")
HotKeySet("{F6}")
    Send("{F6}")
    HotKeySet("{F6}", "EquipSwitcher")
 
WEnd

Func EquipSwitcher()
Send('{c}')

MouseClick ( "right", 814, 590, 1, 1)
MouseClick ( "right", 860, 599, 1, 1)
MouseClick ( "right", 912, 591, 1, 1)
MouseClick ( "right", 949, 596, 1, 1)
MouseClick ( "right", 1001, 595, 1, 1)
MouseClick ( "right", 1039 590, 1, 1)
MouseClick ( "right", 1095, 591, 1, 1)
MouseClick ( "right", 1135, 594, 1, 1)
MouseClick ( "right", 1175, 578, 1, 1)
MouseClick ( "right", 1189, 620, 1, 1)
MouseCLick ( "right", 1233, 576, 1, 1)
Send('{ALT down}')
Sleep(100)
MouseClick ( "right", 1232, 620, 1, 1)
Send('{ALT up}')
Send('{c}')
EndFunc

Func TogglePause()
    $Paused = Not $Paused
    While $Paused
        Sleep(100)
        ToolTip('Script is "Paused"', 0, 0)
    WEnd
    ToolTip("")
 EndFunc   ;==>TogglePause
 
 Func terminate()
        Local $pos = MouseGetPos()
                 MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1] & "Runs " & $runs)
        Exit 0
	 EndFunc
3.File -> Save As
4.Open Compile Script to .exe (x86) (because it works in 32bit not 64bit obviously)
5.Choose the file u saved and then choose the destination folder for the compiled file.
6.Start it and have fun.



If you need help, feel free to ask.
Using your script and it works perfect except for one issue. I'm using dual 1h xbows for my dps spec and a single quiver for my mf spec. Any chance you could tell me what to change in the script to force the quiver slot to swap with the 2nd xbow? Right now it just switches my bows on the main hand. Running 1920 btw.

Thanks
DrThanatos is offline  
Old   #19
 
elite*gold: 0
Join Date: Apr 2012
Posts: 585
Received Thanks: 47
Is it bannable?

p.s.

1680x1050
Code:
Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{DELETE}","terminate")
$runs = 0
While 1
   WinActivate("Diablo III")
HotKeySet("{F6}")
    Send("{F6}")
    HotKeySet("{F6}", "EquipSwitcher")
 
WEnd

Func EquipSwitcher()
Send('{c}')

MouseClick ( "right", 1209, 612, 1, 1)
MouseClick ( "right", 1257, 612, 1, 1)
MouseClick ( "right", 1305, 612, 1, 1)
MouseClick ( "right", 1353, 612, 1, 1)
MouseClick ( "right", 1401, 612, 1, 1)
MouseClick ( "right", 1449, 612, 1, 1)
MouseClick ( "right", 1497, 612, 1, 1)
MouseClick ( "right", 1545, 612, 1, 1)
MouseClick ( "right", 1587, 595, 1, 1)
MouseClick ( "right", 1596, 640, 1, 1)
MouseCLick ( "right", 1634, 593, 1, 1)
Send('{ALT down}')
Sleep(100)
MouseClick ( "right", 1634, 640, 1, 1)
Send('{ALT up}')
Send('{c}')
EndFunc

Func TogglePause()
    $Paused = Not $Paused
    While $Paused
        Sleep(100)
        ToolTip('Script is "Paused"', 0, 0)
    WEnd
    ToolTip("")
 EndFunc   ;==>TogglePause
 
 Func terminate()
        Local $pos = MouseGetPos()
                 MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1] & "Runs " & $runs)
        Exit 0
	 EndFunc


nekomimibadik is offline  
Old   #20
 
elite*gold: 50
Join Date: May 2008
Posts: 2,216
Received Thanks: 1,821
Quote:
Originally Posted by nekomimibadik View Post
Is it bannable?
Sure.


Unlikely but ofcourse possible.
TheOnlyOne652089 is offline  
Old   #21
 
elite*gold: 0
Join Date: Apr 2012
Posts: 585
Received Thanks: 47
I mean. any body already banned 4 this?
nekomimibadik is offline  
Old   #22
 
elite*gold: 0
Join Date: May 2008
Posts: 1
Received Thanks: 0
Quote:
Originally Posted by TheOnlyOne652089 View Post
If you are done with the Recorder, just use the AutoEquipper.
Hi,
maybe you can help me, i used the recorder and the ini file is written correct.
but when i want the Equipper to change the equip (F1), it only blocks the mouse for about 1sec but it doesn`t change the equip. When i look at the taskbar, the script is paused. Any idea? It seems to work well until the switch should be performed.
tehpapa is offline  
Old   #23
 
elite*gold: 50
Join Date: May 2008
Posts: 2,216
Received Thanks: 1,821
Quote:
Originally Posted by tehpapa View Post
Hi,
maybe you can help me, i used the recorder and the ini file is written correct.
but when i want the Equipper to change the equip (F1), it only blocks the mouse for about 1sec but it doesn`t change the equip. When i look at the taskbar, the script is paused. Any idea? It seems to work well until the switch should be performed.
Just right click and stop the script manually.

Then start it again.


+ Do not run multiple Scripts at the same time. If they share Hotkeys, only the latest will actual be able to use them (in case thats what happens for you).


Why the script pauses, i do not know (it def should not on its own).


*If you just want to check if the clicks hit the correct spots, change the ControllClicks to MouseClicks(x,y) it will move the Mouse visible for you slowly enough.


TheOnlyOne652089 is offline  
Reply



« Previous Thread | Next Thread »

Similar Threads
Diablo III - Equip-Changer (Magiefundbonus)
Hallo, Ich habe hier einen (sehr) simplen Equip-Changer, um zwischen Magie-/Goldfundbonus-Equip und Main-Equip zu wechseln. -- 1920x1080 -- ...
151 Replies - Diablo 3 Hacks, Bots, Cheats & Exploits
[AutoIt] "Background" Clicker (Diablo III Equip Changer)
Hallo, Mein aktuelles Script: If Not IsDeclared("sToolTipAnswer") Then Local $sToolTipAnswer $sToolTipAnswer = ToolTip("Equip wird...
14 Replies - AutoIt
[S] Diablo II Hdin Perf Equip + Cdkeys
Cdkeys duerfen nicht stealed sein & das Equip muss perfekt bzw sehr gut sein.. dh. gutes CoA, crafted ammy, eni 775, 40er hoto, spirit, 6ercta,...
0 Replies - Diablo 3 Trading
Trade > +9 Item on Euro Chaos for Hammerdin Equip (Diablo 2)
Yep i need FULL Hammerdin equip.. If you got full Hammerdin Equip > Pm u can choose between +9 Immune Mant,+9 High lvl Shoes or +9 Chainmail of...
1 Replies - Last Chaos Trading



All times are GMT +1. The time now is 17:33.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2017 elitepvpers All Rights Reserved.