Aller au contenu


Photo

{Tutoriel} [Autoit ]{Dh} Sarkoth Acte 1


  • Ce sujet est fermé Ce sujet est fermé
717 réponses à ce sujet

#141 Foxnet

Foxnet

    Débutant lvl 4

  • Membres
  • 92 messages

Posté 24 June 2012 - 23:41

Bonjour Bonjour !

Mon petit partage pour barb

http://www.ownedcore...20x1080-35.html

Une merveille en 9 heure 3.8m presque 2 page de Storage de rare et 2 legendaire avec 308%GF 121%MF (inferno)

Autre petite contribution a partager si vous avez un moniteur qui ne fais pas le 1920x1080 ou vous voulez avoir votre pc libre pendant le farming voici la solution !!! (sa prend une pc un minimum performant)

http://www.ownedcore...ur-pc-free.html

NB: Le programme est payant


CPU [email protected] 1.32v LLC=Ultra High, offset négatif=0.025v

Heatsink Corsair H60 * MOBO P8P67 Pro (B3) * RAM 16GB DDR3 G-Skill Sniper@2133mhz 10-10-10-24

GPU Asus GTX570 Direct cu2@875/1750/2000mhz * PSU Corsair AX850 Gold * SSD Crucial M4 128GB * HDD1 WD Black 1TB * HDD2 WD Green 2TB

CASE Thermaltake Armor+ * LCD Asus MT276 27P * Logitech G15/Cyborg R.A.T 7 * OS Windows 7 Ultimate x64



Bonjour, voici le même script pour les 1680 * 1050

+ ajout de plusieurs sorts de zone et modif du sleep avant le tp si la cave ne pope pas. Cela permet de ne pas se faire casser son cast de portail.
- Retrait de la mise en vente et de la répa (je paye 54 G pour 40 minutes de farm donc bon). J'ai un souci de coordonnées. Par contre le stash marche très bien.

;tofuartist, LATM & BlackSack's Barbarian Script

;notAres' Sarkoth Gold Script - 6/16/2012
;YOU MUST START THE BOT AT THE RESUME GAME SCREEN!
;Thread: http://www.ownedcore.com/forums/diablo-3/diablo-3-bots-programs/d3-gold-profiles/355316-goldfarming-barbarian-sarkoth-goldfarming-script-autoit-script-1920x1080.html
;;;;;
;WONT WORK UNLESS MOVE IS BOUND TO MIDDLE MOUSE (Mouse 3) -- NOT MOVE/INTERACT
;Required build: http://us.battle.net/d3/en/calculator/barbarian#TUXgkj!ghV!bYabZa
;Required display mode for cellar detection: "FULLSCREEN WINDOWED"
;Official supported resolution: 1920x1080
;;;;;
;Original by mackus101 @ ownedcore
;ImageSearch contributions by rvbfreak, goofinator, and asuRob
;Refactoring and additional functions by Shimizoki
;Modifications de résolution par Foxnet + modif mineures

;=========== DO NOT TOUCH ===========;
#RequireAdmin
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt('MouseCoordMode', 2)
Opt('PixelCoordMode', 2)
Global $size = WinGetClientSize("[CLASS:D3 Main Window Class]"), $ver = "1.9", $ini = "tf-Barbarian.ini", $hFont = 0, $title, $Paused, $Go = False, $i = 0, $gX = 0, $gY = 0, $LegendaryCount = 0, $SetCount = 0, $RareCount = 0, $MagicCount = 0, $GemCount = 0, $TomeCount = 0, $t = TimerInit(), $rt = 0, $run = 0, $yellow = 0xFFF000, $red = 0xD90000, $lblRun, $lblLocation, $lblStatus, $lblLast, $lblRuntime, $lblGear, $lblItems
For $i = 0 To Random(3, 6, 1)
	$title &= Chr(Random(97, 122, 1))
Next
For $i = 0 To Random(4, 8, 1)
	$title &= Chr(Random(65, 90, 1))
Next
$title &= " "
Global $gems[8] = ["Ru1.png", "Ru2.png", "Em1.png", "Em2.png", "To1.png", "To2.png", "Am1.png", "Am2.png"]
If @OSArch = "X64" Then DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1)
If @OSArch = "X64" And Not @AutoItX64 Then MsgBox(16, "ERROR", "Why aren't you running the 64-bit AutoIt??? Expect bugs!")
If $size = 0 Then
	MsgBox(16, "Error", "Diablo III is not running, cannot grab resolution!" & @CRLF & "Exiting...")
	Exit
EndIf
;====================================;

;============= SETTINGS =============;
HotKeySet("=", "Begin") ;script toggled on/off by pressing =
HotKeySet("{PAUSE}", "TogglePause") ;script toggle pause by pressing Pause/Break key
HotKeySet("x", "Stop") ;script stopped by pressing x

$movementSpeed = 0 ;This is the % increase movement speed you have. 25 = 25%, 0 = 0%, 50 = 50%

;Custom Loot
$pngLoc = "C:\Program Files (x86)\AutoIt3\pics\" ;Location of the .PNGs (NO SUBFOLDERS - ALL PNGS GO HERE)
$totalItems = 1 ;Number of items in the pick array
Global $pick[$totalItems] ;DONT CHANGE THIS

;Array of items to loot (GEMS AND TOMES ALREADY INCLUDED)
$pick[0] = "mythic.png|40" ;png|Tolerance
;$pick[1] = "item2.png|0"
;$pick[2] = "item3.png|0"

;Looting
$LootSets = "True" ;True if you want to pick up Sets
$LootLegendaries = "True"	;True if you want to pick up Legendaries
$LootRares = "True" ;True if you want to pick up Rares
$LootMagic = "True" ;True if you want to pick up Magic
$LootGems = "True" ;True if you want to pick up Gems
$LootTomes = "True" ;True if you want to pick up Tome of Secrets
$LootCustom = "False" ;True if you want to pick up Custom Items (The items in the $pick array above)

;Manage Loot
$mLoot = 5 ;Nuber of successful runs until Stash and Vendor
$mLootOff = 2 ;Stash and Vendor after mLoot +- X number of runs (Variability)

;Stashing
$StashLoot = "True" ;True if you want to store Items in the stash
$IdentifyItems = "False" ;True if you want to identify Items before stashing
;---
$StashLegendary = "True";True if you want to store Legendary items in the stash
$StashRare = "True" ;True if you want to store Rare items in the stash
$StashMagic = "False" ;True if you want to store Magic items in the stash
$StashTomes = "True" ;True if you want to store Tomes items in the stash
$StashGems = "True" ;True if you want to store Gems items in the stash

$GemTab = 3 ;Tab to put gems and tombs in
$ItemTab = 1 ;Tab to put any items in
$NextItemTab = 2 ;Next Tab to put any items in when first one is full

;Vendoring ==NEW SETTINGS==
$VendorLoot = "True" ;True if you want to vendor anything
;---
$VendorRare = "False" ;True if you want to vendor Rares
$VendorMagic = "True" ;True if you want to vendor Magic
$vendorAll = "False" ;True if you want to right click all items when talking to vendor
$vendorRows = 6 ;# of rows to vendor, starting from the top (default = 5: bottom row is safe)
$vendorCols = 10 ;# of columns to vendor, starting from left

;Variability ==NEW SETTINGS==
$Timer = "True" ;True and the bot will add random sleep intervals
;---
$walktime = 2400 ;Time (in ms) the script waits for you to enter and load the cellar. Slow this down for slower move speeds and loading times
$loadtime = 3400 ;Time (in ms) the script waits for the game to load before it starts pathfinding. Slow this down for slower hard drives
$tptime = 6900 ;Time (in ms) the script waits for teleport before exiting the game
;====================================;

$x_ratio = $size[0] / 1920
$y_ratio = $size[1] / 1080
If FileExists($ini) Then
	Call("ReadINI")
	Call("CreateINI")
Else
	Call("CreateINI")
EndIf

$mLootIn = $mLoot ;DO NOT CHANGE, how many more runs till next manage
$movementSpeed = 1 + ($movementSpeed / 100)
$VersionsInfo = "http://dl.dropbox.com/u/9955791/version.ini"
$oldVersion = IniRead("updater.ini", "Version", "Version", $ver)
$newVersion = "0.0"

If Not FileExists($pngLoc & "MainMenu.png") Then
	MsgBox(16, "Fatal Error", "FATAL ERROR: Cannot find: " & $pngLoc & "MainMenu.png" & @CRLF & "Make sure your directory is set properly in the script")
	Exit
EndIf

Call("SetupGUI")

While 1
        Call("RestartRun")
WEnd
 
Func RestartRun()
        If ($Go) Then
                $i = 0
				Send("{SPACE}")
			    Sleep(100)
                WinSetTitle($title, "", $title & $ver & " - Running")
				RandMove(Round(Random(10, 230) * $x_ratio), Round(Random(11, 286) * $y_ratio), 120, 20);Moves mouse out of the way
                ;Checks if the player is Dead/Logout/Window, then in Old Ruins, then if in Main Menu, etc.
                If CheckDead() Then
                        Return
                ElseIf CheckFor("OldRuins", "", 1500 * $x_ratio, 0 * $y_ratio, 1920 * $x_ratio, 80 * $y_ratio, 1, 140) Then
                        Call("TownPortal")
                        Call("LeaveGame")
                        Return
                ElseIf CheckFor("MainMenu", "", Round(40 * $x_ratio), Round(300 * $y_ratio), Round(400 * $x_ratio), Round(450 * $y_ratio), 7, 140) Then
                        GUICtrlSetData($lblRun, "Run Number: " & $run & " - Runs till vendor: " & $mLootIn)
                        GUICtrlSetData($lblLocation, "Location: Main Menu")
                        GUICtrlSetData($lblStatus, "Status: Starting Game")
						Send("{SPACE}")
						Sleep(100)
                        RandClick("left", Round(230 * $x_ratio), Round(416 * $y_ratio), 120, 20, 1, 6) ;Random Click on the resume button
                        $rt = TimerInit()
                        $run += 1
                ElseIf CheckFor("ExitGame", "", Round(700 * $x_ratio), Round(340 * $y_ratio), Round(1200 * $x_ratio), Round(420 * $y_ratio), 1, 140) Then
                        GUICtrlSetData($lblStatus, "Status: Exit window up")
                        MouseClick("left", Round(1064 * $x_ratio), Round(632 * $y_ratio))
                        Sleep(100)
                        Send("{SPACE}")
                        Return
                ElseIf CheckFor("LimitError", "", Round(700 * $x_ratio), Round(340 * $y_ratio), Round(1200 * $x_ratio), Round(600 * $y_ratio), 1, 140) Then
                        MouseClick("left", Round(960 * $y_ratio), Round(635 * $x_ratio))
                        $rand = Random(40000, 80000)
                        GUICtrlSetData($lblStatus, "Status: Input Limit - Waiting " & Round($rand / 1000) & " seconds.")
                        Sleep($rand)
                        Send("{SPACE}")
                        Return
                ElseIf CheckFor("Disconnect", "", Round(700 * $x_ratio), Round(340 * $y_ratio), Round(1200 * $x_ratio), Round(600 * $y_ratio), 1, 140) Then
                        GUICtrlSetData($lblStatus, "Status: Network Disconnect window up")
                        MouseClick("left", Round(960 * $x_ratio), Round(632 * $y_ratio))
                        Sleep(100)
                        Send("{SPACE}")
                        Return
                Else
                        GUICtrlSetData($lblStatus, "ERROR: Cannot find Resume button")
                        Return
                EndIf
                ;Make sure we are in the right area before beginning run
		If CheckFor("OldRuins", "Area", 1500 * $x_ratio, 0 * $y_ratio, 1920 * $x_ratio, 80 * $y_ratio, 6, 180) Then
			GUICtrlSetData($lblLocation, "Location: Old Ruins")
			;Check if player needs to repair
			Call("CheckRepair")
			;Start Run
         MouseClick("middle", Round(480), Round(250))
         Sleep(1390)
         MouseMove(Round(20), Round(383), 1)
         Sleep(10)
         Send("1")
         Sleep(800)
         MouseClick("middle", Round(10), Round(280))
         Sleep(2900)
			;RandClick("right",Round(210*$x_ratio),Round(12*$y_ratio), 10, 10)
			;RandClick("middle", Round(56 * $x_ratio),Round(360 * $y_ratio), 1, 1)
			;Sleep(Random(2300, 2500))
			;RandMove(Round(348*$x_ratio),Round(179*$y_ratio), 2, 2) ;moves cursor over to the cellar so the proper blue pixel becomes highlighted
			
			$celx = 250
			$cely = 250
			MouseMove(Round($celx*$x_ratio),Round($cely*$y_ratio), 1) ;moves cursor over to the cellar
			Sleep(200)              
			$Pixel2 = PixelSearch(0,0, Round(600*$x_ratio), Round(600*$y_ratio),0x334FB7,3) ;checks for open cellar (in a 600x400 box from the top left - where it should always be)
			If @error Then
				  $celx = 309
				  $cely = 224
				  MouseMove(Round($celx*$x_ratio),Round($cely*$y_ratio),1) ;moves cursor over to the cellar
				  Sleep(200)
				  $Pixel2 = PixelSearch(0,0, Round(600*$x_ratio), Round(600*$y_ratio),0x334FB7,3) ;checks for open cellar (in a 600x400 box from the top left - where it should always be)
			EndIf
			$celerr = @error 
			
			Sleep(10)
			If Call("CheckDead") Then
				Return
			EndIf

			;Checks if Dank Cellar is Open
			;$Pixel2 = PixelSearch(0, 0, Round(600 * $x_ratio), Round(600 * $y_ratio), 0x334FB7, 3)
			If Not $celerr Then
				GUICtrlSetData($lblStatus, "Status: Cellar - Found")
				Sleep(10)
			    RandClick("right",Round(15*$x_ratio),Round(1055*$y_ratio), 10, 10)
			    RandClick("left",Round($celx*$x_ratio),Round($cely*$y_ratio), 1) ;Entrance to cellar
			    Sleep(Random(1400, 1600))
				Moving($walktime)
			Else ;ABORT RUN
				GUICtrlSetData($lblStatus, "Status: Cellar - Not Found" & @CRLF)
				Sleep(200)
				Send("3")
				Sleep(250)
				Send("4")
				Sleep(1000)
			    Send("{SHIFTDOWN}")
			    RandClick("left", Round(900*$x_ratio), Round(600*$y_ratio), 100, 100) ;earthquake
			    Send("{SHIFTUP}")
			    Sleep(2500)
				Call("TownPortal")
				If Not Call("CheckDead") Then
					Call("LeaveGame")
				EndIf
				Return
			EndIf
		Else
			Call("TownPortal")
			If Not Call("CheckDead") Then
				Call("LeaveGame")
			EndIf
			Return
		EndIf

		;Checks that the player is in the Dank Cellar
		If CheckFor("DankCellar", "Area", 1500 * $x_ratio, 0 * $y_ratio, 1920 * $x_ratio, 80 * $y_ratio, 6, 180) Then
			GUICtrlSetData($lblLocation, "Location: Dank Cellar")
			Call("CheckDead")
			RandClick("middle",Round(70*$x_ratio),Round(880*$y_ratio), 1, 1) ;moves to doorway leading to rare inside cellar
			Sleep(Random(2000, 2400))
			GUICtrlSetData($lblStatus, "Status: Attacking Sarkoth")
			RandMove(Round(350*$x_ratio),Round(60*$y_ratio),1) ;hovers over the rare Sarkoth
			Send("3")
			Sleep(250)
			Send("1")
			Sleep(200)
			Send("{SHIFTDOWN}")
			RandClick("left", Round(11*$x_ratio), Round(1037*$y_ratio), 10, 10) ;earthquake
			Send("{SHIFTUP}")
			Sleep(200)
			Send("{SHIFTDOWN}")
			RandClick("left", Round(11*$x_ratio), Round(1037*$y_ratio), 10, 10) ;earthquake
			Send("{SHIFTUP}")
			Sleep(800)
			Send("2")
			Sleep(140)
			Send("2")
			Sleep(100)
			Send("4")
			Sleep(100)
			Send("4")
			Sleep(100)
			Send("4")
			Sleep(100)
			Send("4")
			Sleep(100)
			Call("CheckDead")
			Sleep(Random(2600, 3000))
			RandClick("middle",Round(730*$x_ratio),Round(585*$y_ratio), 1, 1) ;move to left top corner for gold
			Sleep(Random(850, 1350))
			RandClick("middle",Round(1205*$x_ratio),Round(380*$y_ratio), 1, 1) ;move to right top corner for gold
			Sleep(Random(900, 1400))
			RandClick("middle",Round(1121*$x_ratio),Round(805*$y_ratio), 1, 1) ;move to middle before looting
			Sleep(Random(2500, 2820))
			Call("CheckDead")
			GUICtrlSetData($lblStatus, "Status: Looting")
			Call("Loot")
			RandSleep(0, 5, 25)
			Call("CheckDead")
			Call("TownPortal")
		Else
			Sleep(10)
			Send("{SHIFTDOWN}")
			RandClick("left", Round(900*$x_ratio), Round(600*$y_ratio), 100, 100) ;earthquake
			Send("{SHIFTUP}")
			Sleep(620)
			Call("TownPortal")
			If Not Call("CheckDead") Then
				Call("LeaveGame")
			EndIf
			Return
		EndIf
		;After successful run
		If Not Call("CheckDead") Then
			Sleep(600)
			If $mLootIn = 1 And CheckFor("NewTristram", "Area", 1500 * $x_ratio, 0 * $y_ratio, 1920 * $x_ratio, 80 * $y_ratio, 4, 200) Then ;If its time to manage loot and we are in town
			    If $IdentifyItems == "True" Then
				   Call("Identify")
				EndIf
				If $StashLoot == "True" Then
					Call("StashLoot")
				EndIf
				If $VendorLoot == "True" Then
					Call("VendorLoot")
				EndIf
				$mLootIn = Round(Random($mLoot - $mLootOff, $mLoot + $mLootOff)) ;Reset Counter
			ElseIf Not CheckFor("NewTristram", "Area", 1500 * $x_ratio, 0 * $y_ratio, 1920 * $x_ratio, 80 * $y_ratio, 1, 200) Then
				GUICtrlSetData($lblStatus, "Status: Skipping vendor, not in New Tristram")
				Sleep(3000)
			Else
				$mLootIn -= 1
			EndIf
			If Not Call("CheckDead") Then
				Call("LeaveGame")
			EndIf
			Return
		Else
			Return
		EndIf
	EndIf
EndFunc   ;==>RestartRun

;Helper Functions

Func SetupGUI()
	$frmBot = GUICreate($title & $ver & " - Updating", 280, 121, Round(1540 * $x_ratio), Round(920 * $y_ratio), -1, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW), 0)
	GUISetBkColor(0xC0C0C0)
	$lblRun = GUICtrlCreateLabel("Run Number: 0 - Runs till vendor: 0", 4, 0, 280, 24)
	GUICtrlSetFont(-1, 10, 600, 0, "Segoe UI")
	GUICtrlSetColor(-1, 0xFF0000)
	$lblLocation = GUICtrlCreateLabel("Location: Main Menu", 12, 20, 240, 17)
	$lblStatus = GUICtrlCreateLabel("Status: ", 12, 35, 240, 17)
	$lblLast = GUICtrlCreateLabel("Last Runtime: 0 seconds", 12, 50, 240, 17)
	$lblRuntime = GUICtrlCreateLabel("Total Runtime: 0 hours, 0 minutes", 12, 65, 240, 17)
	$lblGear = GUICtrlCreateLabel("Legendary: 0 - Set: 0 - Rare: 0", 12, 80, 240, 17)
	$lblItems = GUICtrlCreateLabel("Magic: 0 - Gems: 0 - Tomes: 0", 12, 95, 240, 17)
	GUISetState(@SW_SHOW)
EndFunc   ;==>SetupGUI

Func CheckDead()
	$LogoutTimerCancel = PixelSearch(Round(900 * $x_ratio), Round(240 * $y_ratio), Round(1010 * $x_ratio), Round(290 * $y_ratio), 0x993827) ; checks for cancel button on logout timer
	If Not @error Then
		GUICtrlSetData($lblStatus, "Status: Logging out")
		Sleep(11000)
		Sleep($loadtime)
		Return 1
	EndIf

	$YouHaveDied = PixelSearch(Round(620 * $x_ratio), Round(325 * $y_ratio), Round(625 * $x_ratio), Round(330 * $y_ratio), 0xFFFFFF) ; checks for white text "YOU HAVE DIED"
	If Not @error Then
		GUICtrlSetData($lblStatus, "Status: Dead")
		Call("LeaveGame")
		Sleep(11000)
		Sleep($loadtime)
		Return 1
	Else
		Return 0
	EndIf
EndFunc   ;==>CheckDead

Func CheckRepair()
	$RepairArea = PixelSearch(Round(1480 * $x_ratio), 0, Round(1570 * $x_ratio), Round(100 * $y_ratio), $yellow)
	If Not @error Then
		Call("DoRepair")
	EndIf
	$RepairAreaRed = PixelSearch(Round(1480 * $x_ratio), 0, Round(1570 * $x_ratio), Round(100 * $y_ratio), $red)
	If Not @error Then
		Call("DoRepair")
	EndIf
EndFunc   ;==>CheckRepair

Func DoRepair()
	Sleep(Random(75, 150))
	Call("TownPortal")
	If Call("CheckDead") Then
		Return
	EndIf
	If CheckFor("NewTristram", "Area", 1500 * $x_ratio, 0 * $y_ratio, 1920 * $x_ratio, 80 * $y_ratio, 6, 180) Then
		RandClick("left", Round(1480 * $x_ratio), Round(281 * $y_ratio), 1, 1) ;begin movement towards merchant
		Moving(1875)
		RandClick("left", Round(1316 * $x_ratio), Round(206 * $y_ratio), 1, 1) ;moves to get merchant in screen
		Moving(1875)
		RandClick("left", Round(845 * $x_ratio), Round(225 * $y_ratio), 1, 1) ;NPC Merchant to the right of cain's home
		Sleep(1200)
		RandClick("left", Round(521 * $x_ratio), Round(506 * $y_ratio), 1, 1) ;button to open up repair menu
		Sleep(400)
		RandClick("left", Round(260 * $x_ratio), Round(595 * $y_ratio), 1, 1) ;button to pay for repairs
		Sleep(Random(1000, 2000)
		Send("{Escape}")
		If Not Call("CheckDead") Then
			Call("LeaveGame")
		EndIf
	EndIf
EndFunc   ;==>DoRepair

Func CalcTime()
	$srt = TimerDiff($rt)
	GUICtrlSetData($lblLast, "Last Runtime: " & Round($srt / 1000, 2) & " seconds.")
	$trt = TimerDiff($t)
	$total = Round((($trt / 1000) / 60) / 60, 4)

	;Total runtime calculation.
	$hours = Floor((($trt / 1000) / 60) / 60)
	$minutes = (($trt / 1000) / 60)
	;trim minutes if runtime is more then 1 hour.
	If $minutes > 60 Then
		While $minutes > 60
			$minutes -= 60
		WEnd
	EndIf
	GUICtrlSetData($lblRuntime, "Total Runtime: " & $hours & " hours, " & Ceiling($minutes) & " minutes")
EndFunc   ;==>CalcTime

Func CheckFor($img, $type = "", $startX = 0, $startY = 0, $endX = @DesktopWidth, $endY = @DesktopHeight, $seconds = 5, $tolerance = 130)
	$c = 0
	$string = $pngLoc & $img & ".png"
	Do
		$c += 1
		Sleep(100)
		If $c > ($seconds * 10) Then ;Make sure we never get stuck here for infinity.
			If $type = "Area" Then
				GUICtrlSetData($lblStatus, "Status: Area not found - " & $img)
			EndIf
			Return False
		EndIf
	Until _ImageSearchArea($string, 1, $startX, $startY, $endX, $endY, $gX, $gY, $tolerance)
	Return True
EndFunc   ;==>CheckFor

Func Loot()
	Sleep(Random(500, 2000))
	MouseMove(Round(Random(0, 400) * $x_ratio), Round(Random(700, 1080) * $y_ratio), 3) ;Moves mouse out of the way
	If $LootSets == "True" Then
		$SetCount += LootGear(0x02CE01, 2)
	EndIf
	If $LootLegendaries == "True" Then
		$LegendaryCount += LootGear(0xBF642F, 0)
	EndIf
	If $LootRares == "True" Then
		$RareCount += LootGear(0xBBBB00, 2)
	EndIf
	If $LootGems == "True" Then
		Call("LootGems")
	EndIf
	If $LootTomes == "True" Then
		Call("LootTomes")
	EndIf
	If $LootCustom == "True" Then
		Call("LootCustom")
	EndIf
	If $LootMagic == "True" Then
		$MagicCount += LootGear(0x6969FF, 2)
	EndIf
	Call("ShowLoot")
EndFunc   ;==>Loot

Func LootGear($color, $tolerance = 2)
	$count = 0
	$Loot = PixelSearch(Round(400 * $x_ratio), 0, Round(1690 * $x_ratio), Round(900 * $y_ratio), $color, $tolerance)
	If Not @error Then
		While Not @error
			$count += 1
			MouseClick('left', $Loot[0], $Loot[1], 1, 3)
			Sleep(Random(800, 1200))
			MouseMove(Round(Random(0, 400) * $x_ratio), Round(Random(700, 1080) * $y_ratio), 3) ;Moves mouse out of the way
			;Run at max 10 times per quality
			If $count >= 10 Then
				ExitLoop
			EndIf
			$Loot = PixelSearch(Round(400 * $x_ratio), 0, Round(1690 * $x_ratio), Round(900 * $y_ratio), $color, $tolerance)
		WEnd
	EndIf
	Return $count
EndFunc   ;==>LootGear

Func LootCustom()
	$count = 0
	$gX = 0
	$gY = 0
	For $i = 0 To ($totalItems - 1)
		$array = StringSplit($pick[$i], "|")
		$file = $array[1]
		$accuracy = $array[2]
		$urlString = $pngLoc & $file
		While _ImageSearchArea($pngLoc & $file, 1, 0, 0, @DesktopWidth, @DesktopHeight, $gX, $gY, $accuracy)
			$count += 1
			Sleep(Random(75, 150))
			MouseClick("left", $gX, $gY, 1, 1)
			Sleep(Random(800, 1200))
			MouseMove(Round(Random(0, 400) * $x_ratio), Round(Random(700, 1080) * $y_ratio), 3) ;Moves mouse out of the way
			If $count >= 10 Then
				ExitLoop
			EndIf
		WEnd
	Next
EndFunc   ;==>LootCustom

Func LootGems()
	$count = 0
	$gX = 0
	$gY = 0
	While _ImageSearchArea($pngLoc & "square.png", 1, 0, 0, @DesktopWidth, @DesktopHeight, $gX, $gY, 90)
		$count += 1
		Sleep(Random(75, 150))
		MouseClick("left", $gX, $gY - 3, 1, 3)
		$GemCount += 1
		Sleep(Random(800, 1200))
		MouseMove(Round(Random(0, 400) * $x_ratio), Round(Random(700, 1080) * $y_ratio), 3) ;Moves mouse out of the way
		If $count >= 10 Then
			ExitLoop
		EndIf
	WEnd
EndFunc   ;==>LootGems

Func LootTomes()
	$count = 0
	$gX = 0
	$gY = 0
	While _ImageSearchArea($pngLoc & "tome.png", 1, 0, 0, @DesktopWidth, @DesktopHeight, $gX, $gY, 90)
		$count += 1
		Sleep(Random(75, 150))
		MouseClick("left", $gX, $gY - 3, 1, 3)
		$TomeCount += 1
		Sleep(Random(800, 1200))
		MouseMove(Round(Random(0, 400) * $x_ratio), Round(Random(700, 1080) * $y_ratio), 3) ;Moves mouse out of the way
		If $count >= 10 Then
			ExitLoop
		EndIf
	WEnd
EndFunc   ;==>LootTomes

Func Identify()
	Send("i")
	Sleep(1300)
	While _ImageSearchArea($pngLoc & "unidentified.png", 1, 1400 * $x_ratio, 580 * $y_ratio, 1914 * $x_ratio, 888 * $y_ratio, $gX, $gY, 120)
		GUICtrlSetData($lblStatus, "Status: Identifying")
		Sleep(Random(200, 300))
		MouseClick("right", $gX, $gY, 1)
		MouseMove(Round(Random(0, 400) * $x_ratio), Round(Random(700, 1080) * $y_ratio), 3) ;Moves mouse out of the way
		Sleep(Random(3000, 3500))
	WEnd
	Send("i")
	Sleep(600)
EndFunc   ;==>Identify

Func ClickTab($Tabno)
        if $Tabno = 1 then RandClick("left", Round(517 * $x_ratio), Round(229 * $y_ratio), 3, 4)
        if $Tabno = 2 then RandClick("left", Round(517 * $x_ratio), Round(361 * $y_ratio), 3, 4)
        if $Tabno = 3 then RandClick("left", Round(517 * $x_ratio), Round(486 * $y_ratio), 3, 4)
        Sleep(Random(100, 200))
 
EndFunc   ;==>ClickTab
 
Func UseNextTab()
        if $ItemTab = $NextItemTab then
                $StashLegendary = "False"
                $StashRare = "False"
                $StashMagic = "False"
        Else
                $ItemTab = $NextItemTab
        EndIf
EndFunc   ;==>UseNextTab

Func StashLoot()
        GUICtrlSetData($lblStatus, "Status: Putting Items in Stash")
        Sleep(Random(1000, 1500))
        MouseClick("left", 1064 * $x_ratio, 256 * $y_ratio)
        Sleep(Random(1500, 2000))
 
        ;Legendaries
        If $StashLegendary == "True" then
                ClickTab($ItemTab)
                $sc = 0
                While $sc < 5
                        Sleep(Random(200, 300))
                        $LegendPixel = PixelSearch(1400 * $x_ratio, 580 * $y_ratio, 1914 * $x_ratio, 888 * $y_ratio, 0x4D2C0D, 1)
                        If Not @error Then
                                GUICtrlSetData($lblStatus, "Status: Stashing Legendaries")
                                MouseClick("right", $LegendPixel[0], $LegendPixel[1], 1, 4)
                        Else
                                ExitLoop
                        EndIf
                        $sc += 1
                WEnd
                if $sc = 5 then
                        Call("UseNextTab")
                endif
        EndIf
 
        ;Rares
        if $StashRare == "True" then
                ClickTab($ItemTab)
                $sc = 0
                While $sc < 10
                        Sleep(Random(200, 300))
                        $RarePixel = PixelSearch(1400 * $x_ratio, 580 * $y_ratio, 1914 * $x_ratio, 888 * $y_ratio, 0x4A3C0B, 1)
                        If Not @error Then
                                GUICtrlSetData($lblStatus, "Status: Stashing Rares")
                                MouseClick("right", $RarePixel[0], $RarePixel[1], 1, 4)
                        Else
                                ExitLoop
                        EndIf
                        $sc += 1
                WEnd
                if $sc = 10 then
                        Call("UseNextTab")
                endif
        EndIf
       
        ;Magic
        if $StashMagic == "True" then
                ClickTab($ItemTab)
                $sc = 0
                While $sc < 20
                        Sleep(Random(100, 300))
                        $MagicPixel = PixelSearch(1400 * $x_ratio, 580 * $y_ratio, 1914 * $x_ratio, 888 * $y_ratio, 0x182037, 1)
                        If Not @error Then
                                GUICtrlSetData($lblStatus, "Status: Stashing Magic")
                                MouseClick("right", $MagicPixel[0], $MagicPixel[1], 1, 4)
                        Else
                                ExitLoop
                        EndIf
                        $sc += 1
                WEnd
                if $sc = 20 then
                        Call("UseNextTab")
                endif
        EndIf
 
        ;Tomes
        If $StashTomes == "True" Then
                If _ImageSearchArea($pngLoc & "TomeIcon.png", 1, 1400 * $x_ratio, 580 * $y_ratio, 1914 * $x_ratio, 888 * $y_ratio, $gX, $gY, 140) Then
                        GUICtrlSetData($lblStatus, "Status: Stashing Tomes")
						ClickTab($GemTab)
                        MouseClick("right", $gX, $gY, 1, 4)
                        Sleep(80)
                EndIf
        EndIf
 
        ;Gems (DOESN'T STASH BOTTOM ROW!)
        if $StashGems == "True" Then
                ClickTab($GemTab)
                GUICtrlSetData($lblStatus, "Status: Stashing Gems")
                For $i = 0 To 7
                        If _ImageSearchArea($pngLoc & $gems[$i], 1, 1400 * $x_ratio, 580 * $y_ratio, 1914 * $x_ratio, 820 * $y_ratio, $gX, $gY, 140) Then

                                MouseClick("right", $gX, $gY, 1, 4)
                                Sleep(Random(400, 600))
 
                        EndIf  
                Next 
        EndIf
        Sleep(Random(1000, 3000))
        Send("{SPACE}")
EndFunc   ;==>StashLoot

Func VendorLoot()
	GUICtrlSetData($lblStatus, "Status: Vendoring Items")
	If Not $StashLoot == "True" Then ;Move from TP towards vendor
		Sleep(Random(300, 500))
		MouseClick("middle", 1565 * $x_ratio, 50 * $y_ratio)
	Else ;Move from Stash towards vendor
		Sleep(Random(300, 500))
		MouseClick("middle", 1560 * $x_ratio, 120 * $y_ratio)
	EndIf
	Sleep(3000)
	MouseClick("left", 1030 * $x_ratio, 210 * $y_ratio) ;Talk to vendor
	Sleep(3000)

	;All
	If $vendorAll == "True" Then
		For $c = 1 To $vendorCols
			For $r = 1 To $vendorRows
				RandClick("right", (((($c - 1) * 50) + 32 + 1400) * $x_ratio), (((($r - 1) * 51) + 32 + 580) * $y_ratio), 2, 2, 1, 2.5)
			Next
		Next
	EndIf

	;Rares
	If $VendorRare == "True" Then
		$c = 0
		While $c <= 10
			Sleep(Random(100, 300))
			$RarePixel = PixelSearch(1400 * $x_ratio, 580 * $y_ratio, 1914 * $x_ratio, 888 * $y_ratio, 0x4A3C0B, 1)
			If Not @error Then
				MouseClick("right", $RarePixel[0], $RarePixel[1], 1, 4)
				Sleep(Random(400, 600))
				$c += 1
			Else
				ExitLoop
			EndIf
		WEnd
	EndIf

	;Magic
	If $VendorMagic == "True" Then
		$c = 0
		While $c <= 25
			Sleep(Random(100, 300))
			$MagicPixel = PixelSearch(1400 * $x_ratio, 580 * $y_ratio, 1914 * $x_ratio, 888 * $y_ratio, 0x182037, 1)
			If Not @error Then
				MouseClick("right", $MagicPixel[0], $MagicPixel[1], 1, 4)
				Sleep(Random(400, 600))
				$c += 1
			Else
				ExitLoop
			EndIf
		WEnd
	EndIf

	Sleep(200)
	RandClick("left", Round(521 * $x_ratio), Round(506 * $y_ratio), 1, 1) ;button to open up repair menu
	Sleep(300)
	RandClick("left", Round(260 * $x_ratio), Round(595 * $y_ratio), 1, 1) ;button to pay for repairs
	Sleep(200)
	Sleep(Random(1000, 2000))
	GUICtrlSetData($lblStatus, "Status: Done With Vendor")
	Send("{ESCAPE}")
EndFunc   ;==>VendorLoot

Func DoUpdate()
	$ini = InetGet($VersionsInfo, @ScriptDir & "\version.ini") ;download version.ini
	If $ini = 0 Then ;was the download of version.ini successful?
		MsgBox(16, "Fatal Error", "The server seems to be offline. No update will be done.")
	Else
		$newVersion = IniRead(@ScriptDir & "\version.ini", "Version", "Version", "") ;reads the new version out of version.ini
		If $newVersion = $oldVersion Then ;compare old and new
			;MsgBox (0,"No update","There is no update available!")
			FileDelete(@ScriptDir & "\version.ini")
		Else
			$msg = MsgBox(68, "Update", "A new version is available: " & $newVersion & "! Current version: " & $oldVersion & @CRLF & "Do you want to download the new version?")
			If $msg = 7 Then ;No was pressed
				FileDelete(@ScriptDir & "\version.ini")
			ElseIf $msg = 6 Then ;OK was pressed
				$downloadLink = IniRead(@ScriptDir & "\version.ini", "Version", "download", "NotFound")
				$dlhandle = InetGet($downloadLink, @ScriptDir & "\Update_" & $newVersion & ".zip", 1, 1)
				ProgressOn("Update", "Downloading Updates", "", -1, -1, 16) ;creates a progressbar

				$size = InetGetSize($downloadLink, 1) ;get the size of the update
				While Not InetGetInfo($dlhandle, 2)
					$Percent = Round((InetGetInfo($dlhandle, 0) / $size) * 100)
					ProgressSet($Percent, $Percent & "%") ;update progressbar
					Sleep(1)
				WEnd
				ProgressSet(100, "Done", "Complete") ;show complete progressbar
				Sleep(500)
				ProgressOff() ;close progress window
				IniWrite("updater.ini", "version", "version", $newVersion)
				InetClose($dlhandle)
				$iniMsg = IniRead(@ScriptDir & "\version.ini", "Version", "message", "Exiting...")
				MsgBox(64, "Success", "Download Complete!" & @CRLF & "Please restart the bot by extracting the Au3 from Update_" & $newVersion & ".zip" & @CRLF & $iniMsg)
				FileDelete(@ScriptDir & "\version.ini")
				Exit
			EndIf
		EndIf
	EndIf
	WinSetTitle($title, "", $title & $ver & " - Waiting")
EndFunc   ;==>DoUpdate
Func ReadINI()
	$pngLoc = IniRead($ini, "Custom Loot", "PNG Location", $pngLoc)
	$totalItems = IniRead($ini, "Custom Loot", "Total Items", $totalItems)
	$movementSpeed = IniRead($ini, "Additional", "Movement Speed", $movementSpeed)
	$walktime = IniRead($ini, "Additional", "Walk Time", $walktime)
	$loadtime = IniRead($ini, "Additional", "Load Time", $loadtime)
	$tptime = IniRead($ini, "Additional", "Teleport Time", $tptime)
	$LootSets = IniRead($ini, "Looting", "Sets", $LootSets)
	$LootLegendaries = IniRead($ini, "Looting", "Legendaries", $LootLegendaries)
	$LootRares = IniRead($ini, "Looting", "Rares", $LootRares)
	$LootMagic = IniRead($ini, "Looting", "Magic", $LootMagic)
	$LootGems = IniRead($ini, "Looting", "Gems", $LootGems)
	$LootTomes = IniRead($ini, "Looting", "Tomes", $LootTomes)
	$LootCustom = IniRead($ini, "Looting", "Custom", $LootCustom)
	$mLoot = IniRead($ini, "ManageLoot", "Every", $mLoot)
	$StashLoot = IniRead($ini, "Stashing", "Loot", $StashLoot)
	$StashLegendary = IniRead($ini, "Stashing", "Legendaries", $StashLegendary)
	$StashRare = IniRead($ini, "Stashing", "Rares", $StashRare)
	$StashMagic = IniRead($ini, "Stashing", "Magic", $StashMagic)
	$StashTomes = IniRead($ini, "Stashing", "Tomes", $StashTomes)
	$StashGems = IniRead($ini, "Stashing", "Gems", $StashGems)
	$VendorLoot = IniRead($ini, "Vendoring", "Loot", $VendorLoot)
	$VendorRare = IniRead($ini, "Vendoring", "Rares", $VendorRare)
	$VendorMagic = IniRead($ini, "Vendoring", "Magic", $VendorMagic)
	$vendorAll = IniRead($ini, "Vendoring", "All", $vendorAll)
	$vendorRows = IniRead($ini, "Vendoring", "All-Rows", $vendorRows)
	$vendorCols = IniRead($ini, "Vendoring", "All-Cols", $vendorCols)
	$Timer = IniRead($ini, "Variability", "Timer", $Timer)
	$mLootOff = IniRead($ini, "Variability", "Manage Off By", $mLootOff)
EndFunc   ;==>ReadINI
Func CreateINI()
	IniWrite($ini, "Custom Loot", "PNG Location", $pngLoc)
	IniWrite($ini, "Custom Loot", "Total Items", $totalItems)
	IniWrite($ini, "Additional", "Movement Speed", $movementSpeed)
	IniWrite($ini, "Additional", "Walk Time", $walktime)
	IniWrite($ini, "Additional", "Load Time", $loadtime)
	IniWrite($ini, "Additional", "Teleport Time", $tptime)
	IniWrite($ini, "Looting", "Sets", $LootSets)
	IniWrite($ini, "Looting", "Legendaries", $LootLegendaries)
	IniWrite($ini, "Looting", "Rares", $LootRares)
	IniWrite($ini, "Looting", "Magic", $LootMagic)
	IniWrite($ini, "Looting", "Gems", $LootGems)
	IniWrite($ini, "Looting", "Tomes", $LootTomes)
	IniWrite($ini, "Looting", "Custom", $LootCustom)
	IniWrite($ini, "ManageLoot", "Every", $mLoot)
	IniWrite($ini, "Stashing", "Loot", $StashLoot)
	IniWrite($ini, "Stashing", "Legendaries", $StashLegendary)
	IniWrite($ini, "Stashing", "Rares", $StashRare)
	IniWrite($ini, "Stashing", "Magic", $StashMagic)
	IniWrite($ini, "Stashing", "Tomes", $StashTomes)
	IniWrite($ini, "Stashing", "Gems", $StashGems)
	IniWrite($ini, "Vendoring", "Loot", $VendorLoot)
	IniWrite($ini, "Vendoring", "Rares", $VendorRare)
	IniWrite($ini, "Vendoring", "Magic", $VendorMagic)
	IniWrite($ini, "Vendoring", "All", $vendorAll)
	IniWrite($ini, "Vendoring", "All-Rows", $vendorRows)
	IniWrite($ini, "Vendoring", "All-Cols", $vendorCols)
	IniWrite($ini, "Variability", "Timer", $Timer)
	IniWrite($ini, "Variability", "Manage Off By", $mLootOff)
EndFunc   ;==>CreateINI

Func _ImageSearchArea($findImage, $resultPosition, $x1, $y1, $right, $bottom, ByRef $x, ByRef $y, $tolerance)
	If $tolerance > 0 Then $findImage = "*" & $tolerance & " " & $findImage
	$findImage = "*TRANSBLACK " & $findImage
	If @AutoItX64 Then
		$result = DllCall("ImageSearchDLL_x64.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $findImage)
	Else
		$result = DllCall("ImageSearchDLL.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $findImage)
	EndIf
	If $result = "0" Then
		Return 0
	EndIf

	; Otherwise get the x,y location of the match and the size of the image to
	; compute the centre of search
	$array = StringSplit($result[0], "|")
	If (UBound($array) >= 4) Then
		$x = Int(Number($array[2]))
		$y = Int(Number($array[3]))
		If $resultPosition = 1 Then
			$x = $x + Int(Number($array[4]) / 2)
			$y = $y + Int(Number($array[5]) / 2)
		EndIf
		Return 1
	EndIf
EndFunc   ;==>_ImageSearchArea

Func LeaveGame()
	Call("RandSleep")
	GUICtrlSetData($lblStatus, "Status: Leaving Game")
	Sleep(120)
	Send("{Escape}")
	Sleep(Random(200, 500))
	RandClick("left", Round(956 * $x_ratio), Round(579 * $y_ratio), 120, 20) ;Random Click on the leave button
	RandMove(Round(Random(10, 230) * $x_ratio), Round(Random(11, 286) * $y_ratio), 120, 20)
	Call("CalcTime")
EndFunc   ;==>LeaveGame

Func TownPortal()
	GUICtrlSetData($lblStatus, "Status: Returning to Town")
	Send("t")
	Sleep(Random($tptime, $tptime + 500))
EndFunc   ;==>TownPortal

Func Moving($time)
	Sleep($time / $movementSpeed)
EndFunc   ;==>Moving

Func RandClick($clickType, $xPos, $yPos, $xOff = 10, $yOff = 10, $clicks = 1, $speed = 4)
	If $xOff < 1 Then $xOff = 1
	If $yOff < 1 Then $yOff = 1
	$randX = Round(Random($xPos - ($xOff * $x_ratio), $xPos + ($xOff * $x_ratio)))
	$randY = Round(Random($yPos - ($yOff * $y_ratio), $yPos + ($yOff * $y_ratio)))
	MouseClick($clickType, $randX, $randY, $clicks, $speed)
EndFunc   ;==>RandClick

Func RandMove($xPos, $yPos, $xOff = 20, $yOff = 10)
	$randX = Round(Random($xPos - ($xOff * $x_ratio), $xPos + ($xOff * $x_ratio)))
	$randY = Round(Random($yPos - ($yOff * $y_ratio), $yPos + ($yOff * $y_ratio)))
	MouseMove($randX, $randY)
EndFunc   ;==>RandMove

Func RandSleep($min = 15, $max = 30, $chance = 3)
	$randNum = Round(Random(1, 100))
	If $Timer == "True" And $randNum <= $chance Then
		$sleepTime = Random($min * 1000, $max * 1000)
		GUICtrlSetData($lblStatus, "Status: Random Sleep - " & Round($sleepTime / 1000) & " secs")

		For $c = 0 To 10
			Sleep($sleepTime / 10)
		Next
	EndIf
EndFunc   ;==>RandSleep

;Hotkey Functions

Func Begin()
	$Go = Not $Go
	If Not $Go Then WinSetTitle($title, "", $title & $ver & " - Halted")
EndFunc   ;==>Begin

Func TogglePause()
	$Paused = Not $Paused
	While $Paused
		Sleep(100)
		WinSetTitle($title, "", $title & $ver & " - Paused")
		ToolTip('Script is "Paused"', 0, 0)
	WEnd
	WinSetTitle($title, "", $title & $ver & " - Running")
	ToolTip("")
EndFunc   ;==>TogglePause

Func ShowLoot()
	GUICtrlSetData($lblGear, "Legendary: " & $LegendaryCount & " - Set: " & $SetCount & " - Rare: " & $RareCount)
	GUICtrlSetData($lblItems, "Magic: " & $MagicCount & " - Gems: " & $GemCount & " - Tomes: " & $TomeCount)
EndFunc   ;==>ShowLoot

Func Stop() ;to allow the script to stop
	Exit
EndFunc   ;==>Stop


#142 Foxnet

Foxnet

    Débutant lvl 4

  • Membres
  • 92 messages

Posté 24 June 2012 - 23:59

Petite question.

Ma fenêtre qui nous donne le résumé des loots, runs, etc...est à peine trop petite. A partir de 10 runs, je ne vois plus le nombre de runs avant de faire un manage loot. Y a-t-il un moyen d'agrandir à peine cette fenêtre?

#143 Bidoche

Bidoche

    Newbie lvl 4

  • Membres
  • 31 messages

Posté 25 June 2012 - 00:10

Petite question.

Ma fenêtre qui nous donne le résumé des loots, runs, etc...est à peine trop petite. A partir de 10 runs, je ne vois plus le nombre de runs avant de faire un manage loot. Y a-t-il un moyen d'agrandir à peine cette fenêtre?



En survolant le script rapidement j'ai trouver Func SetupGUI() recherche le avec Notepad++ mais je ne suis pas certain que sa contient les X/y pour la grosseur de la fenêtre...

#144 Foxnet

Foxnet

    Débutant lvl 4

  • Membres
  • 92 messages

Posté 25 June 2012 - 01:57


Petite question.

Ma fenêtre qui nous donne le résumé des loots, runs, etc...est à peine trop petite. A partir de 10 runs, je ne vois plus le nombre de runs avant de faire un manage loot. Y a-t-il un moyen d'agrandir à peine cette fenêtre?



En survolant le script rapidement j'ai trouver Func SetupGUI() recherche le avec Notepad++ mais je ne suis pas certain que sa contient les X/y pour la grosseur de la fenêtre...


Mouais, je me demande si ce n'est pas contrôlé par une dll.

#145 Guest_azenor_*

Guest_azenor_*
  • Invité

Posté 25 June 2012 - 06:22

Plop tous,
Quelqu'un sait comment on rajoute du temps entre le moment où le bot tp en ville et le temps où il quitte la partie ?
Il la quitte tellement vite que mon jeu plante de temps en temps, et le bot ne peux pas le relancer.

#146 cpz38

cpz38

    Fragger débutant

  • Membres
  • 522 messages

Posté 25 June 2012 - 15:49

Configuration de touches: Il faut impérativement configure le raccourci “Se déplacer” (move) avec le 3ème bouton de la souris (Mouse 3). (Différent de « Bouger/Intéragir »).

pas compris :D

5fn9dt.jpg☺☺☺☺☻☻♥☻☻☺☺☺☺ 2irasmd.jpgExpendables 2 de retour le 22 Août 2012 !! avec Chuck Norris :D


#147 Anakha

Anakha

    Khon

  • Admin Gms
  • 3286 messages
  • Location :Grenoble
  • Trade : Mediator

Posté 25 June 2012 - 17:47

Configuration de touches: Il faut impérativement configure le raccourci “Se déplacer” (move) avec le 3ème bouton de la souris (Mouse 3). (Différent de « Bouger/Intéragir »).

pas compris :D


tu vas dans les config diablo, tu configure l'action "Se déplacer" (et non pas l'action "BOuger/intéragir") sur le clique du 3e bouton de la souris (le clique de la molette, mouse 3)
  • cpz38 aime ceci

Aucun support ne sera fait en privé. Si vous avez un problème, faites un post.

 Ne pas hésiter à mettre un petit (+) si mon post vous plait ou vous a servi !

#148 cpz38

cpz38

    Fragger débutant

  • Membres
  • 522 messages

Posté 25 June 2012 - 17:54


Configuration de touches: Il faut impérativement configure le raccourci “Se déplacer” (move) avec le 3ème bouton de la souris (Mouse 3). (Différent de « Bouger/Intéragir »).

pas compris :D


tu vas dans les config diablo, tu configure l'action "Se déplacer" (et non pas l'action "BOuger/intéragir") sur le clique du 3e bouton de la souris (le clique de la molette, mouse 3)


+1 for you <3

5fn9dt.jpg☺☺☺☺☻☻♥☻☻☺☺☺☺ 2irasmd.jpgExpendables 2 de retour le 22 Août 2012 !! avec Chuck Norris :D


#149 milo64

milo64

    Newbie lvl 1

  • Membres
  • 1 messages

Posté 25 June 2012 - 20:52

Bonsoir a tous,
Je viens de tout installer, jusque la nickel
Par contre je lance le bot est la rien ne se passe.
Y a 'il des choses a faire en plus ?

#150 Gudei

Gudei

    vermeille ++

  • Membres GMS
  • 3091 messages
  • Location :Disney
  • Trade : Trusted

Posté 25 June 2012 - 21:24

Comme dit dans le tuto tu appuies sur "=" pour lancer.

#151 cpz38

cpz38

    Fragger débutant

  • Membres
  • 522 messages

Posté 25 June 2012 - 21:29

j'ai une erreur

" FATAL ERROR: Cannot find;
C:\users\jeu\appdata\local\Temp\Temp1_NotAres-Sarkoth.zip\NotAres-Sarkoth\pics\MainMenu.png
make sure your directory is set properly in the script

5fn9dt.jpg☺☺☺☺☻☻♥☻☻☺☺☺☺ 2irasmd.jpgExpendables 2 de retour le 22 Août 2012 !! avec Chuck Norris :D


#152 Gudei

Gudei

    vermeille ++

  • Membres GMS
  • 3091 messages
  • Location :Disney
  • Trade : Trusted

Posté 25 June 2012 - 21:31

Problème déjà traité quelques pages avant ton répertoire de PNG est beaucoup trop complexe, il faut privilégier la simplicité exemple: c:/gudei
  • cpz38 aime ceci

#153 cpz38

cpz38

    Fragger débutant

  • Membres
  • 522 messages

Posté 25 June 2012 - 21:33

Problème déjà traité quelques pages avant ton répertoire de PNG est beaucoup trop complexe, il faut privilégier la simplicité exemple: c:/gudei


a ok merci j'avai deja vu mais j'avais pas compris xD :)

+1 for you

5fn9dt.jpg☺☺☺☺☻☻♥☻☻☺☺☺☺ 2irasmd.jpgExpendables 2 de retour le 22 Août 2012 !! avec Chuck Norris :D


#154 Gudei

Gudei

    vermeille ++

  • Membres GMS
  • 3091 messages
  • Location :Disney
  • Trade : Trusted

Posté 25 June 2012 - 21:51

C'est donc régler ?

#155 Anakha

Anakha

    Khon

  • Admin Gms
  • 3286 messages
  • Location :Grenoble
  • Trade : Mediator

Posté 25 June 2012 - 22:00

En même temps, ouvrir les scripts à partir d'une archive et l'exécuter sans l'extraire, c'est pas le mieux :)

Aucun support ne sera fait en privé. Si vous avez un problème, faites un post.

 Ne pas hésiter à mettre un petit (+) si mon post vous plait ou vous a servi !

#156 Gudei

Gudei

    vermeille ++

  • Membres GMS
  • 3091 messages
  • Location :Disney
  • Trade : Trusted

Posté 25 June 2012 - 22:07

Mouarf ! J'avais pas vu mdr !

#157 Hendekk

Hendekk

    Newbie lvl 3

  • Membres
  • 10 messages

Posté 25 June 2012 - 23:56

Pour revenir au problème de la vente des légendaire, le fait de config pour ne pas identifier ne fonctionne pas. Le bot vendra quand même car il considère les légendaires comme des objets magiques donc même si il ne les identifie pas, il va clique droit dessus pour le vendre et donc par conséquent l'identifier et ensuite le vendre 5 runs plutard :(
Donc la seul méthode à suivre reste la tienne Gudei, config pour ne pas ramasser les magiques et ne pas vendre.

#158 Anakha

Anakha

    Khon

  • Admin Gms
  • 3286 messages
  • Location :Grenoble
  • Trade : Mediator

Posté 26 June 2012 - 00:39

Aux dernières nouvelles, clique droit sur un légendaire/rare ou autre lorsqu'on vend, n'identifie pas l'item :o non ?
Fin bon, j'sais pas

Aucun support ne sera fait en privé. Si vous avez un problème, faites un post.

 Ne pas hésiter à mettre un petit (+) si mon post vous plait ou vous a servi !

#159 kaltalo

kaltalo

    Newbie lvl 1

  • Membres
  • 2 messages

Posté 26 June 2012 - 01:52

Bonjour Bonjour !

Mon petit partage pour barb

http://www.ownedcore...20x1080-35.html

Une merveille en 9 heure 3.8m presque 2 page de Storage de rare et 2 legendaire avec 308%GF 121%MF (inferno)

Autre petite contribution a partager si vous avez un moniteur qui ne fais pas le 1920x1080 ou vous voulez avoir votre pc libre pendant le farming voici la solution !!! (sa prend une pc un minimum performant)

http://www.ownedcore...ur-pc-free.html

NB: Le programme est payant


CPU [email protected] 1.32v LLC=Ultra High, offset négatif=0.025v

Heatsink Corsair H60 * MOBO P8P67 Pro (B3) * RAM 16GB DDR3 G-Skill Sniper@2133mhz 10-10-10-24

GPU Asus GTX570 Direct cu2@875/1750/2000mhz * PSU Corsair AX850 Gold * SSD Crucial M4 128GB * HDD1 WD Black 1TB * HDD2 WD Green 2TB

CASE Thermaltake Armor+ * LCD Asus MT276 27P * Logitech G15/Cyborg R.A.T 7 * OS Windows 7 Ultimate x64



T'es un chef ! merci pour ce lien. J'en profite pour partager mon script aménagé :


;=========== DO NOT TOUCH ===========;
#RequireAdmin
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt('MouseCoordMode', 2)
Opt('PixelCoordMode', 2)
Global $size = WinGetClientSize("[CLASS:D3 Main Window Class]"), $ver = "1.9", $ini = "tf-Barbarian.ini", $hFont = 0, $title, $Paused, $Go = False, $i = 0, $gX = 0, $gY = 0, $LegendaryCount = 0, $SetCount = 0, $RareCount = 0, $MagicCount = 0, $GemCount = 0, $TomeCount = 0, $t = TimerInit(), $rt = 0, $run = 0, $yellow = 0xFFF000, $red = 0xD90000, $lblRun, $lblLocation, $lblStatus, $lblLast, $lblRuntime, $lblGear, $lblItems
For $i = 0 To Random(3, 6, 1)
	$title &= Chr(Random(97, 122, 1))
Next
For $i = 0 To Random(4, 8, 1)
	$title &= Chr(Random(65, 90, 1))
Next
$title &= " "
Global $gems[8] = ["Ru1.png", "Ru2.png", "Em1.png", "Em2.png", "To1.png", "To2.png", "Am1.png", "Am2.png"]
If @OSArch = "X64" Then DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1)
If @OSArch = "X64" And Not @AutoItX64 Then MsgBox(16, "ERROR", "Why aren't you running the 64-bit AutoIt??? Expect bugs!")
If $size = 0 Then
	MsgBox(16, "Error", "Diablo III is not running, cannot grab resolution!" & @CRLF & "Exiting...")
	Exit
EndIf
;====================================;

;============= SETTINGS =============;
HotKeySet("=", "Begin") ;script toggled on/off by pressing =
HotKeySet("{PAUSE}", "TogglePause") ;script toggle pause by pressing Pause/Break key
HotKeySet("x", "Stop") ;script stopped by pressing x

$movementSpeed = 0 ;This is the % increase movement speed you have. 25 = 25%, 0 = 0%, 50 = 50%

;Custom Loot
$pngLoc = "C:\Diablo III\pics\" ;Location of the .PNGs (NO SUBFOLDERS - ALL PNGS GO HERE)
$totalItems = 2;Number of items in the pick array
Global $pick[$totalItems] ;DONT CHANGE THIS

;Array of items to loot (GEMS AND TOMES ALREADY INCLUDED)
$pick[0] = "mythic.png|90" ;png|Tolerance
$pick[1] = "gold.png|90"
;$pick[2] = "item3.png|0"

;Looting
$LootSets = "True" ;True if you want to pick up Sets
$LootLegendaries = "True"	;True if you want to pick up Legendaries
$LootRares = "True" ;True if you want to pick up Rares
$LootMagic = "True" ;True if you want to pick up Magic
$LootGems = "True" ;True if you want to pick up Gems
$LootTomes = "True" ;True if you want to pick up Tome of Secrets
$LootCustom = "True" ;True if you want to pick up Custom Items (The items in the $pick array above)

;Manage Loot
$mLoot = 5 ;Nuber of successful runs until Stash and Vendor
$mLootOff = 2 ;Stash and Vendor after mLoot +- X number of runs (Variability)

;Stashing
$StashLoot = "True" ;True if you want to store Items in the stash
$IdentifyItems = "False" ;True if you want to identify Items before stashing
;---
$StashLegendary = "True";True if you want to store Legendary items in the stash
$StashRare = "True" ;True if you want to store Rare items in the stash
$StashMagic = "False" ;True if you want to store Magic items in the stash
$StashTomes = "True" ;True if you want to store Tomes items in the stash
$StashGems = "True" ;True if you want to store Gems items in the stash

$GemTab = 3 ;Tab to put gems and tombs in
$ItemTab = 1 ;Tab to put any items in
$NextItemTab = 2 ;Next Tab to put any items in when first one is full

;Vendoring ==NEW SETTINGS==
$VendorLoot = "True" ;True if you want to vendor anything
;---
$VendorRare = "False" ;True if you want to vendor Rares
$VendorMagic = "True" ;True if you want to vendor Magic
$vendorAll = "False" ;True if you want to right click all items when talking to vendor
$vendorRows = 6 ;# of rows to vendor, starting from the top (default = 5: bottom row is safe)
$vendorCols = 10 ;# of columns to vendor, starting from left

;Variability ==NEW SETTINGS==
$Timer = "True" ;True and the bot will add random sleep intervals
;---
$walktime = 2400 ;Time (in ms) the script waits for you to enter and load the cellar. Slow this down for slower move speeds and loading times
$loadtime = 4000  ;Time (in ms) the script waits for the game to load before it starts pathfinding. Slow this down for slower hard drives
$tptime = 7200 ;Time (in ms) the script waits for teleport before exiting the game
;====================================;

$x_ratio = $size[0] / 1920
$y_ratio = $size[1] / 1080
;If FileExists($ini) Then
	;Call("ReadINI")
	;Call("CreateINI")
;Else
	;Call("CreateINI")
;EndIf

$mLootIn = $mLoot ;DO NOT CHANGE, how many more runs till next manage
$movementSpeed = 1 + ($movementSpeed / 100)
$VersionsInfo = "http://dl.dropbox.com/u/9955791/version.ini"
$oldVersion = IniRead("updater.ini", "Version", "Version", $ver)
$newVersion = "0.0"

If Not FileExists($pngLoc & "MainMenu.png") Then
	MsgBox(16, "Fatal Error", "FATAL ERROR: Cannot find: " & $pngLoc & "MainMenu.png" & @CRLF & "Make sure your directory is set properly in the script")
	Exit
EndIf

Call("SetupGUI")

While 1
		Call("RestartRun")
WEnd
 
Func RestartRun()
   If ($Go) Then
	  $i = 0
	  Send("{SPACE}")
	  Sleep(100)
	  WinSetTitle($title, "", $title & $ver & " - Running")
	  RandMove(Round(Random(10, 230) * $x_ratio), Round(Random(11, 286) * $y_ratio), 120, 20);Moves mouse out of the way

	  ;Checks if the player is Dead/Logout/Window, then in Old Ruins, then if in Main Menu, etc.
	  If CheckDead() Then
		 Return
	  ElseIf CheckFor("OldRuins", "", 1500 * $x_ratio, 0 * $y_ratio, 1920 * $x_ratio, 80 * $y_ratio, 1, 140) Then
		 Call("TownPortal")
		 Call("LeaveGame")
		 Return
	  ElseIf CheckFor("MainMenu", "", Round(40 * $x_ratio), Round(300 * $y_ratio), Round(400 * $x_ratio), Round(450 * $y_ratio), 7, 140) Then
		 GUICtrlSetData($lblRun, "Run Number: " & $run & " - Runs till vendor: " & $mLootIn)
		 GUICtrlSetData($lblLocation, "Location: Main Menu")
		 GUICtrlSetData($lblStatus, "Status: Starting Game")
		 Send("{SPACE}")
		 Sleep(100)
		 RandClick("left", Round(230 * $x_ratio), Round(416 * $y_ratio), 120, 20, 1, 6) ;Random Click on the resume button
		 $rt = TimerInit()
		 $run += 1
	  ElseIf CheckFor("ExitGame", "", Round(700 * $x_ratio), Round(340 * $y_ratio), Round(1200 * $x_ratio), Round(420 * $y_ratio), 1, 140) Then
		 GUICtrlSetData($lblStatus, "Status: Exit window up")
		 MouseClick("left", Round(1064 * $x_ratio), Round(632 * $y_ratio))
		 Sleep(100)
		 Send("{SPACE}")
		 Return
	  ElseIf CheckFor("LimitError", "", Round(700 * $x_ratio), Round(340 * $y_ratio), Round(1200 * $x_ratio), Round(600 * $y_ratio), 1, 140) Then
		 MouseClick("left", Round(960 * $y_ratio), Round(635 * $x_ratio))
		 $rand = Random(40000, 80000)
		 GUICtrlSetData($lblStatus, "Status: Input Limit - Waiting " & Round($rand / 1000) & " seconds.")
		 Sleep($rand)
		 Send("{SPACE}")
		 Return
	  ElseIf CheckFor("Disconnect", "", Round(700 * $x_ratio), Round(340 * $y_ratio), Round(1200 * $x_ratio), Round(600 * $y_ratio), 1, 140) Then
		 GUICtrlSetData($lblStatus, "Status: Network Disconnect window up")
		 MouseClick("left", Round(960 * $x_ratio), Round(632 * $y_ratio))
		 Sleep(100)
		 Send("{SPACE}")
		 Return
	  Else
		 GUICtrlSetData($lblStatus, "ERROR: Cannot find Resume button")
		 Return
	  EndIf
		 
	   ;Make sure we are in the right area before beginning run
	  If CheckFor("OldRuins", "Area", 1500 * $x_ratio, 0 * $y_ratio, 1920 * $x_ratio, 80 * $y_ratio, 6, 180) Then
		 GUICtrlSetData($lblLocation, "Location: Old Ruins")
		 ;Check if player needs to repair
		 Call("CheckRepair")
		 
		 ;Start Run
		 RandClick("middle", Round(587 * $x_ratio),Round(333 * $y_ratio), 2, 2) ;starts the main run
		 Sleep(Random(990,1140))
		 RandMove(Round(96*$x_ratio),Round(383*$y_ratio), 2, 2)
		 Sleep(Random(5, 10))
		 Send("1")
		 Sleep(300)
		 Send("3")
		 Sleep(360)
		 RandClick("right",Round(210*$x_ratio),Round(12*$y_ratio), 10, 10)
		 RandClick("middle", Round(56 * $x_ratio),Round(360 * $y_ratio), 1, 1)
		 Sleep(Random(2300, 2500))		 
		 ;RandMove(Round(348*$x_ratio),Round(179*$y_ratio), 2, 2) ;moves cursor over to the cellar so the proper blue pixel becomes highlighted

		 $celx = 348
		 $cely = 179
		 MouseMove(Round($celx*$x_ratio),Round($cely*$y_ratio), 1) ;moves cursor over to the cellar
		 Sleep(200)              
		 $Pixel2 = PixelSearch(0,0, Round(600*$x_ratio), Round(600*$y_ratio),0x334FB7,3) ;checks for open cellar (in a 600x400 box from the top left - where it should always be)
		 If @error Then
			$celx = 309
			$cely = 224
			MouseMove(Round($celx*$x_ratio),Round($cely*$y_ratio),1) ;moves cursor over to the cellar
			Sleep(200)
			$Pixel2 = PixelSearch(0,0, Round(600*$x_ratio), Round(600*$y_ratio),0x334FB7,3) ;checks for open cellar (in a 600x400 box from the top left - where it should always be)
		 EndIf
		 $celerr = @error 

		 Sleep(10)
		 If Call("CheckDead") Then
			Return
		 EndIf

		 ;Checks if Dank Cellar is Open
		 ;$Pixel2 = PixelSearch(0, 0, Round(600 * $x_ratio), Round(600 * $y_ratio), 0x334FB7, 3)
		 If Not $celerr Then
			GUICtrlSetData($lblStatus, "Status: Cellar - Found")
			Sleep(10)
			RandClick("right",Round(15*$x_ratio),Round(1055*$y_ratio), 10, 10)
			RandClick("left",Round($celx*$x_ratio),Round($cely*$y_ratio), 1) ;Entrance to cellar
			Sleep(Random(1400, 1600))
			Moving($walktime)
		 Else ;ABORT RUN
			GUICtrlSetData($lblStatus, "Status: Cellar - Not Found" & @CRLF)
			Sleep(10)                           
			Send("{SHIFTDOWN}")
			RandClick("left", Round(900*$x_ratio), Round(600*$y_ratio), 100, 100) ;earthquake
			Send("{SHIFTUP}")
			Sleep(620)
			Call("TownPortal")
			If Not Call("CheckDead") Then
			   Call("LeaveGame")
			EndIf
			Return
		 EndIf
	  Else
		 Call("TownPortal")
		 If Not Call("CheckDead") Then
			Call("LeaveGame")
		 EndIf
		 Return
	  EndIf

	  ;Checks that the player is in the Dank Cellar
	  If CheckFor("DankCellar", "Area", 1500 * $x_ratio, 0 * $y_ratio, 1920 * $x_ratio, 80 * $y_ratio, 6, 180) Then
		 GUICtrlSetData($lblLocation, "Location: Dank Cellar")
		 Call("CheckDead")
		 RandClick("middle",Round(80*$x_ratio),Round(830*$y_ratio), 1, 1) ;moves to doorway leading to rare inside cellar
		 Sleep(Random(2000, 2400))
		 GUICtrlSetData($lblStatus, "Status: Attacking Sarkoth")
		 RandMove(Round(350*$x_ratio),Round(60*$y_ratio),1) ;hovers over the rare Sarkoth
		 Send("1")
		 Sleep(200)
		 Send("{SHIFTDOWN}")
		 RandClick("left", Round(11*$x_ratio), Round(1037*$y_ratio), 10, 10) ;earthquake
		 Send("{SHIFTUP}")
		 Sleep(200)
		 Send("{SHIFTDOWN}")
		 RandClick("left", Round(11*$x_ratio), Round(1037*$y_ratio), 10, 10) ;earthquake
		 Send("{SHIFTUP}")
		 Sleep(800)
		 Send("2")
		 Sleep(140)
		 Send("2")
		 Sleep(100)
		 Send("4")
		 Sleep(100)
		 Send("4")
		 Sleep(100)
		 Send("4")
		 Sleep(100)
		 Send("4")
		 Sleep(100)
		 Call("CheckDead")
		 Sleep(Random(2600, 3000))
		 RandClick("middle",Round(730*$x_ratio),Round(585*$y_ratio), 1, 1) ;move to left top corner for gold
		 Sleep(Random(850, 1350))
		 RandClick("middle",Round(1205*$x_ratio),Round(380*$y_ratio), 1, 1) ;move to right top corner for gold
		 Sleep(Random(900, 1400))
		 RandClick("middle",Round(1121*$x_ratio),Round(805*$y_ratio), 1, 1) ;move to middle before looting
		 Sleep(Random(2500, 2820))
		 Call("CheckDead")
		 GUICtrlSetData($lblStatus, "Status: Looting")
		 Call("Loot")
		 RandSleep(0, 5, 25)
		 Call("CheckDead")
		 Call("TownPortal")
	  Else
		 Sleep(10)
		 Send("{SHIFTDOWN}")
		 RandClick("left", Round(900*$x_ratio), Round(600*$y_ratio), 100, 100) ;earthquake
		 Send("{SHIFTUP}")
		 Sleep(620)
		 Call("TownPortal")
		 If Not Call("CheckDead") Then
			Call("LeaveGame")
		 EndIf
		 Return
	  EndIf
	  
	  ;After successful run
	  If Not Call("CheckDead") Then
		 Sleep(600)
		 If $mLootIn = 1 And CheckFor("NewTristram", "Area", 1500 * $x_ratio, 0 * $y_ratio, 1920 * $x_ratio, 80 * $y_ratio, 4, 200) Then ;If its time to manage loot and we are in town
			If $IdentifyItems == "True" Then
			   Call("Identify")
			EndIf
			If $StashLoot == "True" Then
			   Call("StashLoot")
			EndIf
			If $VendorLoot == "True" Then
			   Call("VendorLoot")
			EndIf
			$mLootIn = Round(Random($mLoot - $mLootOff, $mLoot + $mLootOff)) ;Reset Counter
		 ElseIf Not CheckFor("NewTristram", "Area", 1500 * $x_ratio, 0 * $y_ratio, 1920 * $x_ratio, 80 * $y_ratio, 1, 200) Then
			GUICtrlSetData($lblStatus, "Status: Skipping vendor, not in New Tristram")
			Sleep(3000)
		 Else
			$mLootIn -= 1
		 EndIf
		 If Not Call("CheckDead") Then
			Call("LeaveGame")
		 EndIf
		 Return
	  Else
		 Return
	  EndIf
   EndIf
EndFunc   ;==>RestartRun

;Helper Functions
Func SetupGUI()
   $frmBot = GUICreate($title & $ver & " - Updating", 280, 121, Round(1540 * $x_ratio), Round(920 * $y_ratio), -1, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW), 0)
   GUISetBkColor(0xC0C0C0)
   $lblRun = GUICtrlCreateLabel("Run Number: 0 - Runs till vendor: 0", 4, 0, 280, 24)
   GUICtrlSetFont(-1, 10, 600, 0, "Segoe UI")
   GUICtrlSetColor(-1, 0xFF0000)
   $lblLocation = GUICtrlCreateLabel("Location: Main Menu", 12, 20, 240, 17)
   $lblStatus = GUICtrlCreateLabel("Status: ", 12, 35, 240, 17)
   $lblLast = GUICtrlCreateLabel("Last Runtime: 0 seconds", 12, 50, 240, 17)
   $lblRuntime = GUICtrlCreateLabel("Total Runtime: 0 hours, 0 minutes", 12, 65, 240, 17)
   $lblGear = GUICtrlCreateLabel("Legendary: 0 - Set: 0 - Rare: 0", 12, 80, 240, 17)
   $lblItems = GUICtrlCreateLabel("Magic: 0 - Gems: 0 - Tomes: 0", 12, 95, 240, 17)
   GUISetState(@SW_SHOW)
EndFunc   ;==>SetupGUI

Func CheckDead()
   $LogoutTimerCancel = PixelSearch(Round(900 * $x_ratio), Round(240 * $y_ratio), Round(1010 * $x_ratio), Round(290 * $y_ratio), 0x993827) ; checks for cancel button on logout timer
   If Not @error Then
	  GUICtrlSetData($lblStatus, "Status: Logging out")
	  Sleep(11000)
	  Sleep($loadtime)
	  Return 1
   EndIf
   $YouHaveDied = PixelSearch(Round(620 * $x_ratio), Round(325 * $y_ratio), Round(625 * $x_ratio), Round(330 * $y_ratio), 0xFFFFFF) ; checks for white text "YOU HAVE DIED"
   If Not @error Then
	  GUICtrlSetData($lblStatus, "Status: Dead")
	  Call("LeaveGame")
	  Sleep(11000)
	  Sleep($loadtime)
	  Return 1
   Else
	  Return 0
   EndIf
EndFunc   ;==>CheckDead

Func CheckRepair()
   $RepairArea = PixelSearch(Round(1480 * $x_ratio), 0, Round(1570 * $x_ratio), Round(100 * $y_ratio), $yellow)
   If Not @error Then
	  Call("DoRepair")
   EndIf
   $RepairAreaRed = PixelSearch(Round(1480 * $x_ratio), 0, Round(1570 * $x_ratio), Round(100 * $y_ratio), $red)
   If Not @error Then
	  Call("DoRepair")
   EndIf
EndFunc   ;==>CheckRepair

Func DoRepair()
Sleep(Random(75, 150))
   Call("TownPortal")
   If Call("CheckDead") Then
	  Return
   EndIf
   If CheckFor("NewTristram", "Area", 1500 * $x_ratio, 0 * $y_ratio, 1920 * $x_ratio, 80 * $y_ratio, 6, 180) Then
	  RandClick("left", Round(1480 * $x_ratio), Round(281 * $y_ratio), 1, 1) ;begin movement towards merchant
	  Moving(1875)
	  RandClick("left", Round(1316 * $x_ratio), Round(206 * $y_ratio), 1, 1) ;moves to get merchant in screen
	  Moving(1875)
	  RandClick("left", Round(845 * $x_ratio), Round(225 * $y_ratio), 1, 1) ;NPC Merchant to the right of cain's home
	  Sleep(1200)
	  RandClick("left", Round(521 * $x_ratio), Round(506 * $y_ratio), 1, 1) ;button to open up repair menu
	  Sleep(400)
	  RandClick("left", Round(260 * $x_ratio), Round(595 * $y_ratio), 1, 1) ;button to pay for repairs
	  Sleep(Random(1000, 2000))
	  Send("{Escape}")
	  If Not Call("CheckDead") Then
		 Call("LeaveGame")
	  EndIf
   EndIf
EndFunc   ;==>DoRepair

Func CalcTime()
   $srt = TimerDiff($rt)
   GUICtrlSetData($lblLast, "Last Runtime: " & Round($srt / 1000, 2) & " seconds.")
   $trt = TimerDiff($t)
   $total = Round((($trt / 1000) / 60) / 60, 4)
   ;Total runtime calculation.
   $hours = Floor((($trt / 1000) / 60) / 60)
   $minutes = (($trt / 1000) / 60)
   ;trim minutes if runtime is more then 1 hour.
   If $minutes > 60 Then
	  While $minutes > 60
	  $minutes -= 60
	  WEnd
   EndIf
   GUICtrlSetData($lblRuntime, "Total Runtime: " & $hours & " hours, " & Ceiling($minutes) & " minutes")
EndFunc   ;==>CalcTime

Func CheckFor($img, $type = "", $startX = 0, $startY = 0, $endX = @DesktopWidth, $endY = @DesktopHeight, $seconds = 5, $tolerance = 130)
   $c = 0
   $string = $pngLoc & $img & ".png"
   Do
   $c += 1
   Sleep(100)
   If $c > ($seconds * 10) Then ;Make sure we never get stuck here for infinity.
	  If $type = "Area" Then
		 GUICtrlSetData($lblStatus, "Status: Area not found - " & $img)
	  EndIf
	  Return False
   EndIf
   Until _ImageSearchArea($string, 1, $startX, $startY, $endX, $endY, $gX, $gY, $tolerance)
   Return True
EndFunc   ;==>CheckFor

Func Loot()
   Sleep(Random(500, 2000))
   MouseMove(Round(Random(0, 400) * $x_ratio), Round(Random(700, 1080) * $y_ratio), 3) ;Moves mouse out of the way
   If $LootSets == "True" Then
	  GUICtrlSetData($lblStatus, "Status: Looting Sets")
	  $SetCount += LootGear(0x02CE01)
   EndIf
   If $LootLegendaries == "True" Then
	  GUICtrlSetData($lblStatus, "Status: Looting Legends")
	  $LegendaryCount += LootGear(0xBF642F, 0)
   EndIf
   If $LootRares == "True" Then
	  GUICtrlSetData($lblStatus, "Status: Looting Rares")
	  $RareCount += LootGear(0xBBBB00)
   EndIf   
   If $LootMagic == "True" Then
	  GUICtrlSetData($lblStatus, "Status: Looting Magics")
	  $MagicCount += LootGear(0x6969FF)
   EndIf
   If $LootGems == "True" Then
	  GUICtrlSetData($lblStatus, "Status: Looting Gems")
	  Call("LootGems")
   EndIf
   If $LootTomes == "True" Then
	  GUICtrlSetData($lblStatus, "Status: Looting Tomes")
	  Call("LootTomes")
   EndIf
   If $LootCustom == "True" Then
	  GUICtrlSetData($lblStatus, "Status: Looting Custom")
	  Call("LootCustom")
   EndIf  
   Call("ShowLoot")
EndFunc   ;==>Loot

Func LootGear($color, $tolerance = 2)
   $count = 0
   $Loot = PixelSearch(Round(400 * $x_ratio), 0, Round(1690 * $x_ratio), Round(900 * $y_ratio), $color, $tolerance)
   If Not @error Then
	  While Not @error
		 $count += 1
		 MouseClick('left', $Loot[0], $Loot[1], 1, 3)
		 Sleep(Random(800, 1200))
		 MouseMove(Round(Random(0, 400) * $x_ratio), Round(Random(700, 1080) * $y_ratio), 3) ;Moves mouse out of the way
		 ;Run at max 10 times per quality
		 If $count >= 10 Then
			ExitLoop
		 EndIf
		 $Loot = PixelSearch(Round(400 * $x_ratio), 0, Round(1690 * $x_ratio), Round(900 * $y_ratio), $color, $tolerance)
	  WEnd
   EndIf
   Return $count
EndFunc   ;==>LootGear

Func LootCustom()   
   $count = 0
   $gX = 0
   $gY = 0
   For $i = 0 To ($totalItems - 1)
	  $array = StringSplit($pick[$i], "|")
	  $file = $array[1]
	  $accuracy = $array[2]
	  $urlString = $pngLoc & $file
	  While _ImageSearchArea($pngLoc & $file, 1, 0, 0, @DesktopWidth, @DesktopHeight, $gX, $gY, $accuracy)
		 $count += 1
		 Sleep(Random(75, 150))
		 MouseClick("left", $gX, $gY, 1, 1)
		 Sleep(Random(800, 1200))
		 MouseMove(Round(Random(0, 400) * $x_ratio), Round(Random(700, 1080) * $y_ratio), 3) ;Moves mouse out of the way
		 If $count >= 10 Then
			ExitLoop
		 EndIf
	  WEnd
   Next
EndFunc   ;==>LootCustom

Func LootGems()
   $count = 0
   $gX = 0
   $gY = 0
   While _ImageSearchArea($pngLoc & "square.png", 1, 0, 0, @DesktopWidth, @DesktopHeight, $gX, $gY, 90)
	  $count += 1
	  Sleep(Random(75, 150))
	  MouseClick("left", $gX, $gY - 3, 1, 3)
	  $GemCount += 1
	  Sleep(Random(800, 1200))
	  MouseMove(Round(Random(0, 400) * $x_ratio), Round(Random(700, 1080) * $y_ratio), 3) ;Moves mouse out of the way
	  If $count >= 10 Then
		 ExitLoop
	  EndIf
   WEnd
EndFunc   ;==>LootGems


Func LootTomes()
   $count = 0
   $gX = 0
   $gY = 0
   While _ImageSearchArea($pngLoc & "tome.png", 1, 0, 0, @DesktopWidth, @DesktopHeight, $gX, $gY, 90)
	  $count += 1
	  Sleep(Random(75, 150))
	  MouseClick("left", $gX, $gY - 3, 1, 3)
	  $TomeCount += 1
	  Sleep(Random(800, 1200))
	  MouseMove(Round(Random(0, 400) * $x_ratio), Round(Random(700, 1080) * $y_ratio), 3) ;Moves mouse out of the way
	  If $count >= 10 Then
		 ExitLoop
	  EndIf
   WEnd
EndFunc   ;==>LootTomes

Func Identify()
   Send("i")
   Sleep(1300)
   While _ImageSearchArea($pngLoc & "unidentified.png", 1, 1400 * $x_ratio, 580 * $y_ratio, 1914 * $x_ratio, 888 * $y_ratio, $gX, $gY, 120)
	  GUICtrlSetData($lblStatus, "Status: Identifying")
	  Sleep(Random(200, 300))
	  MouseClick("right", $gX, $gY, 1)
	  MouseMove(Round(Random(0, 400) * $x_ratio), Round(Random(700, 1080) * $y_ratio), 3) ;Moves mouse out of the way
	  Sleep(Random(3000, 3500))
   WEnd
   Send("i")
   Sleep(600)
EndFunc   ;==>Identify

Func ClickTab($Tabno)
   if $Tabno = 1 then RandClick("left", Round(517 * $x_ratio), Round(229 * $y_ratio), 3, 4)
   if $Tabno = 2 then RandClick("left", Round(517 * $x_ratio), Round(361 * $y_ratio), 3, 4)
   if $Tabno = 3 then RandClick("left", Round(517 * $x_ratio), Round(486 * $y_ratio), 3, 4)
   Sleep(Random(100, 200))
EndFunc   ;==>ClickTab

Func UseNextTab()
   if $ItemTab = $NextItemTab then
	  $StashLegendary = "False"
	  $StashRare = "False"
	  $StashMagic = "False"
   Else
	  $ItemTab = $NextItemTab
   EndIf
EndFunc   ;==>UseNextTab

Func StashLoot()
   GUICtrlSetData($lblStatus, "Status: Putting Items in Stash")
   Sleep(Random(1000, 1500))
   MouseClick("left", 1064 * $x_ratio, 256 * $y_ratio)
   Sleep(Random(1500, 2000))

   ;Legendaries
   If $StashLegendary == "True" then
	  ClickTab($ItemTab)
	  $sc = 0
	  While $sc < 5
		 Sleep(Random(200, 300))
		 $LegendPixel = PixelSearch(1400 * $x_ratio, 580 * $y_ratio, 1914 * $x_ratio, 888 * $y_ratio, 0x4D2C0D, 1)
		 If Not @error Then
			GUICtrlSetData($lblStatus, "Status: Stashing Legendaries")
			MouseClick("right", $LegendPixel[0], $LegendPixel[1], 1, 4)
		 Else
			ExitLoop
		 EndIf
		 $sc += 1
	  WEnd
	  if $sc = 5 then
		 Call("UseNextTab")
	  endif
   EndIf

   ;Rares
   if $StashRare == "True" then
	  ClickTab($ItemTab)
	  $sc = 0
	  While $sc < 10
		 Sleep(Random(200, 300))
		 $RarePixel = PixelSearch(1400 * $x_ratio, 580 * $y_ratio, 1914 * $x_ratio, 888 * $y_ratio, 0x4A3C0B, 1)
		 If Not @error Then
			GUICtrlSetData($lblStatus, "Status: Stashing Rares")
			MouseClick("right", $RarePixel[0], $RarePixel[1], 1, 4)
		 Else
			ExitLoop
		 EndIf
	  $sc += 1
	  WEnd
	  if $sc = 10 then
		 Call("UseNextTab")
	  endif
   EndIf

   ;Magic
   if $StashMagic == "True" then
	  ClickTab($ItemTab)
	  $sc = 0
	  While $sc < 20
		 Sleep(Random(100, 300))
		 $MagicPixel = PixelSearch(1400 * $x_ratio, 580 * $y_ratio, 1914 * $x_ratio, 888 * $y_ratio, 0x182037, 1)
		 If Not @error Then
			GUICtrlSetData($lblStatus, "Status: Stashing Magic")
			MouseClick("right", $MagicPixel[0], $MagicPixel[1], 1, 4)
		 Else
			ExitLoop
		 EndIf
		 $sc += 1
	  WEnd
	  if $sc = 20 then
		 Call("UseNextTab")
	  endif
   EndIf

   ;Tomes
   If $StashTomes == "True" Then
	  If _ImageSearchArea($pngLoc & "TomeIcon.png", 1, 1400 * $x_ratio, 580 * $y_ratio, 1914 * $x_ratio, 888 * $y_ratio, $gX, $gY, 140) Then
		 GUICtrlSetData($lblStatus, "Status: Stashing Tomes")
		 ClickTab($GemTab)
		 MouseClick("right", $gX, $gY, 1, 4)
		 Sleep(80)
	  EndIf
   EndIf

   ;Gems (DOESN'T STASH BOTTOM ROW!)
   if $StashGems == "True" Then
	  ClickTab($GemTab)
	  GUICtrlSetData($lblStatus, "Status: Stashing Gems")
	  For $i = 0 To 7
		 If _ImageSearchArea($pngLoc & $gems[$i], 1, 1400 * $x_ratio, 580 * $y_ratio, 1914 * $x_ratio, 820 * $y_ratio, $gX, $gY, 140) Then
			MouseClick("right", $gX, $gY, 1, 4)
			Sleep(Random(400, 600))
		 EndIf  
	  Next 
   EndIf
   Sleep(Random(1000, 3000))
   Send("{SPACE}")
EndFunc   ;==>StashLoot

Func VendorLoot()
   GUICtrlSetData($lblStatus, "Status: Vendoring Items")
   If Not $StashLoot == "True" Then ;Move from TP towards vendor
	  Sleep(Random(300, 500))
	  MouseClick("middle", 1565 * $x_ratio, 50 * $y_ratio)
   Else ;Move from Stash towards vendor
	  Sleep(Random(300, 500))
	  MouseClick("middle", 1560 * $x_ratio, 120 * $y_ratio)
   EndIf
   Sleep(3000)
   MouseClick("left", 1030 * $x_ratio, 210 * $y_ratio) ;Talk to vendor
   Sleep(3000)

   ;All
   If $vendorAll == "True" Then
	  For $c = 1 To $vendorCols
		 For $r = 1 To $vendorRows
			RandClick("right", (((($c - 1) * 50) + 32 + 1400) * $x_ratio), (((($r - 1) * 51) + 32 + 580) * $y_ratio), 2, 2, 1, 2.5)
		 Next
	  Next
   EndIf

   ;Rares
   If $VendorRare == "True" Then
	  $c = 0
	  While $c <= 10
		 Sleep(Random(100, 300))
		 $RarePixel = PixelSearch(1400 * $x_ratio, 580 * $y_ratio, 1914 * $x_ratio, 888 * $y_ratio, 0x4A3C0B, 1)
		 If Not @error Then
			MouseClick("right", $RarePixel[0], $RarePixel[1], 1, 4)
			Sleep(Random(400, 600))
			$c += 1
		 Else
			ExitLoop
		 EndIf
	  WEnd
   EndIf

   ;Magic
   If $VendorMagic == "True" Then
	  $c = 0
	  While $c <= 25
		 Sleep(Random(100, 300))
		 $MagicPixel = PixelSearch(1400 * $x_ratio, 580 * $y_ratio, 1914 * $x_ratio, 888 * $y_ratio, 0x182037, 1)
		 If Not @error Then
			MouseClick("right", $MagicPixel[0], $MagicPixel[1], 1, 4)
			Sleep(Random(400, 600))
			$c += 1
		 Else
			ExitLoop
		 EndIf
	  WEnd
   EndIf
   
   Sleep(200)
   RandClick("left", Round(521 * $x_ratio), Round(506 * $y_ratio), 1, 1) ;button to open up repair menu
   Sleep(300)
   RandClick("left", Round(260 * $x_ratio), Round(595 * $y_ratio), 1, 1) ;button to pay for repairs
   Sleep(200)
   Sleep(Random(1000, 2000))
   GUICtrlSetData($lblStatus, "Status: Done With Vendor")
   Send("{ESCAPE}")
EndFunc   ;==>VendorLoot

Func DoUpdate()
   $ini = InetGet($VersionsInfo, @ScriptDir & "\version.ini") ;download version.ini
   If $ini = 0 Then ;was the download of version.ini successful?
	  MsgBox(16, "Fatal Error", "The server seems to be offline. No update will be done.")
   Else
	  $newVersion = IniRead(@ScriptDir & "\version.ini", "Version", "Version", "") ;reads the new version out of version.ini
	  If $newVersion = $oldVersion Then ;compare old and new
		 ;MsgBox (0,"No update","There is no update available!")
		 FileDelete(@ScriptDir & "\version.ini")
	  Else
		 $msg = MsgBox(68, "Update", "A new version is available: " & $newVersion & "! Current version: " & $oldVersion & @CRLF & "Do you want to download the new version?")
		 If $msg = 7 Then ;No was pressed
			FileDelete(@ScriptDir & "\version.ini")
		 ElseIf $msg = 6 Then ;OK was pressed
			$downloadLink = IniRead(@ScriptDir & "\version.ini", "Version", "download", "NotFound")
			$dlhandle = InetGet($downloadLink, @ScriptDir & "\Update_" & $newVersion & ".zip", 1, 1)
			ProgressOn("Update", "Downloading Updates", "", -1, -1, 16) ;creates a progressbar
			$size = InetGetSize($downloadLink, 1) ;get the size of the update
			While Not InetGetInfo($dlhandle, 2)
			   $Percent = Round((InetGetInfo($dlhandle, 0) / $size) * 100)
			   ProgressSet($Percent, $Percent & "%") ;update progressbar
			   Sleep(1)
			WEnd
			ProgressSet(100, "Done", "Complete") ;show complete progressbar
			Sleep(500)
			ProgressOff() ;close progress window
			IniWrite("updater.ini", "version", "version", $newVersion)
			InetClose($dlhandle)
			$iniMsg = IniRead(@ScriptDir & "\version.ini", "Version", "message", "Exiting...")
			MsgBox(64, "Success", "Download Complete!" & @CRLF & "Please restart the bot by extracting the Au3 from Update_" & $newVersion & ".zip" & @CRLF & $iniMsg)
			FileDelete(@ScriptDir & "\version.ini")
			Exit
		 EndIf
	  EndIf
   EndIf
   WinSetTitle($title, "", $title & $ver & " - Waiting")
EndFunc   ;==>DoUpdate

Func _ImageSearchArea($findImage, $resultPosition, $x1, $y1, $right, $bottom, ByRef $x, ByRef $y, $tolerance)
   If $tolerance > 0 Then $findImage = "*" & $tolerance & " " & $findImage
   $findImage = "*TRANSBLACK " & $findImage
   If @AutoItX64 Then
	  $result = DllCall("ImageSearchDLL_x64.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $findImage)
   Else
	  $result = DllCall("ImageSearchDLL.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $findImage)
   EndIf
   If $result = "0" Then
	  Return 0
   EndIf

   ; Otherwise get the x,y location of the match and the size of the image to
   ; compute the centre of search
   $array = StringSplit($result[0], "|")
   If (UBound($array) >= 4) Then
	  $x = Int(Number($array[2]))
	  $y = Int(Number($array[3]))
	  If $resultPosition = 1 Then
		 $x = $x + Int(Number($array[4]) / 2)
		 $y = $y + Int(Number($array[5]) / 2)
	  EndIf
	  Return 1
   EndIf
EndFunc   ;==>_ImageSearchArea

Func LeaveGame()
   Call("RandSleep")
   GUICtrlSetData($lblStatus, "Status: Leaving Game")
   Sleep(120)
   Send("{Escape}")
   Sleep(Random(200, 500))
   RandClick("left", Round(956 * $x_ratio), Round(579 * $y_ratio), 120, 20) ;Random Click on the leave button
   RandMove(Round(Random(10, 230) * $x_ratio), Round(Random(11, 286) * $y_ratio), 120, 20)
   Call("CalcTime")
EndFunc   ;==>LeaveGame

Func TownPortal()
   GUICtrlSetData($lblStatus, "Status: Returning to Town")
   Send("t")
   Sleep(Random($tptime, $tptime + 500))
EndFunc   ;==>TownPortal

Func Moving($time)
   Sleep($time / $movementSpeed)
EndFunc   ;==>Moving

Func RandClick($clickType, $xPos, $yPos, $xOff = 10, $yOff = 10, $clicks = 1, $speed = 4)
   If $xOff < 1 Then $xOff = 1
   If $yOff < 1 Then $yOff = 1
   $randX = Round(Random($xPos - ($xOff * $x_ratio), $xPos + ($xOff * $x_ratio)))
   $randY = Round(Random($yPos - ($yOff * $y_ratio), $yPos + ($yOff * $y_ratio)))
   MouseClick($clickType, $randX, $randY, $clicks, $speed)
EndFunc   ;==>RandClick

Func RandMove($xPos, $yPos, $xOff = 20, $yOff = 10)
   $randX = Round(Random($xPos - ($xOff * $x_ratio), $xPos + ($xOff * $x_ratio)))
   $randY = Round(Random($yPos - ($yOff * $y_ratio), $yPos + ($yOff * $y_ratio)))
   MouseMove($randX, $randY)
EndFunc   ;==>RandMove

Func RandSleep($min = 5, $max = 15, $chance = 3)
   $randNum = Round(Random(1, 100))
   If $Timer == "True" And $randNum <= $chance Then
	  $sleepTime = Random($min * 1000, $max * 1000)
	  GUICtrlSetData($lblStatus, "Status: Random Sleep - " & Round($sleepTime / 1000) & " secs")

	  For $c = 0 To 10
		 Sleep($sleepTime / 10)
	  Next
   EndIf
EndFunc   ;==>RandSleep

;Hotkey Functions
Func Begin()
   $Go = Not $Go
   If Not $Go Then WinSetTitle($title, "", $title & $ver & " - Halted")
EndFunc   ;==>Begin

Func TogglePause()
   $Paused = Not $Paused
   While $Paused
	  Sleep(100)
	  WinSetTitle($title, "", $title & $ver & " - Paused")
	  ToolTip('Script is "Paused"', 0, 0)
   WEnd
   WinSetTitle($title, "", $title & $ver & " - Running")
   ToolTip("")
EndFunc   ;==>TogglePause

Func ShowLoot()
   GUICtrlSetData($lblGear, "Legendary: " & $LegendaryCount & " - Set: " & $SetCount & " - Rare: " & $RareCount)
   GUICtrlSetData($lblItems, "Magic: " & $MagicCount & " - Gems: " & $GemCount & " - Tomes: " & $TomeCount)
EndFunc   ;==>ShowLoot

Func Stop() ;to allow the script to stop
   Exit
EndFunc   ;==>Stop

Avec mes sincères remerciements à la communauté.

Fichier(s) joint(s)

  • Fichier joint  gold.png   1.38 Ko   3 téléchargement(s)


#160 cpz38

cpz38

    Fragger débutant

  • Membres
  • 522 messages

Posté 26 June 2012 - 06:50

nn rien

Modifié par cpz38, 27 June 2012 - 11:33.

5fn9dt.jpg☺☺☺☺☻☻♥☻☻☺☺☺☺ 2irasmd.jpgExpendables 2 de retour le 22 Août 2012 !! avec Chuck Norris :D