NiceTrybab Posted October 29, 2022 Share Posted October 29, 2022 Hi there! I try to change some codes in file from web. but I not good at coding. So.. help me please ! This is loot helper. first, origin one. expandcollapse popupFunc NewLoot() If WinActive($handle) Then FFSnapShot() Local $ResBlancNoir = FFNearestSpot(2, 10, ($xresolution / 2), ($yresolution / 2), -1, $ShadeVariation, 0, 0, 0, 0, False) If FFGetPixel($xresolution-1, 0) = 0x3B3C3D Or FFGetPixel($xresolution, 0) = 0x3B3C3D Or FFGetPixel(0, $yresolution-1) = 0x373839 Or FFGetPixel(0, $yresolution) = 0x373839 Or FFGetPixel($xresolution-1, 0) = 0x1E1F25 Or FFGetPixel($xresolution-1, 0) = 0x1E1F25 Then Else If (IsArray($ResBlancNoir)) Then If $TeleportState = "ENABLED" Then Global $fDiff = TimerDiff($hTimer) If ($fDiff > 30) Then $hTimer = TimerInit() If $oldCoordsX = $ResBlancNoir[0] And $oldCoordsY = $ResBlancNoir[1] Then Else $oldCoordsX = $ResBlancNoir[0] $oldCoordsY = $ResBlancNoir[1] MouseClick($MOUSE_CLICK_RIGHT, $ResBlancNoir[0], $ResBlancNoir[1], 1, 1) Endif Else EndIf EndIf If $TeleportState = "DISABLED" Then AutoItSetOption("MouseClickDownDelay", 100) ; MouseClick($MOUSE_CLICK_LEFT, $ResBlancNoir[0], $ResBlancNoir[1], 1, 1) AutoItSetOption("MouseClickDownDelay", 1) ; Else AutoItSetOption("MouseClickDownDelay", 1) ; MouseClick($MOUSE_CLICK_LEFT, $ResBlancNoir[0], $ResBlancNoir[1], 1, 1) AutoItSetOption("MouseClickDownDelay", 1) ; EndIf EndIf Endif EndIf EndFunc ;==>NewLoot second, my try expandcollapse popupFunc NewLoot() If WinActive($handle) Then FFSnapShot() Local $ResBlancNoir = FFNearestSpot(2, 10, ($xresolution / 2), ($yresolution / 2), -1, $ShadeVariation, 0, 0, 0, 0, False) If FFGetPixel($xresolution-1, 0) = 0x3B3C3D Or FFGetPixel($xresolution, 0) = 0x3B3C3D Or FFGetPixel(0, $yresolution-1) = 0x373839 Or FFGetPixel(0, $yresolution) = 0x373839 Or FFGetPixel($xresolution-1, 0) = 0x1E1F25 Or FFGetPixel($xresolution-1, 0) = 0x1E1F25 Then Else If (IsArray($ResBlancNoir)) Then If $TeleportState = "ENABLED" Then Global $fDiff = TimerDiff($hTimer) If ($fDiff > 30) Then $hTimer = TimerInit() If $oldCoordsX = $ResBlancNoir[0] And $oldCoordsY = $ResBlancNoir[1] Then Else $oldCoordsX = $ResBlancNoir[0] $oldCoordsY = $ResBlancNoir[1] MouseClick($MOUSE_CLICK_RIGHT, $ResBlancNoir[0], $ResBlancNoir[1], 1, 1) sleep(235) FFSnapShot() Local $ResBlancNoir = FFNearestSpot(2, 10, ($xresolution / 2), ($yresolution / 2), -1, $ShadeVariation, 0, 0, 0, 0, False) ; Ne force pas un nouveau snapShot si il y en a déjà un If FFGetPixel($xresolution-1, 0) = 0x3B3C3D Or FFGetPixel($xresolution, 0) = 0x3B3C3D Or FFGetPixel(0, $yresolution-1) = 0x373839 Or FFGetPixel(0, $yresolution) = 0x373839 Or FFGetPixel($xresolution-1, 0) = 0x1E1F25 Or FFGetPixel($xresolution-1, 0) = 0x1E1F25 Then Else If (IsArray($ResBlancNoir)) Then If $oldCoordsX = $ResBlancNoir[0] And $oldCoordsY = $ResBlancNoir[1] Then Else $oldCoordsX = $ResBlancNoir[0] $oldCoordsY = $ResBlancNoir[1] MouseMove($ResBlancNoir[0], $ResBlancNoir[1], 1) EndIf EndIf EndIf Endif Else EndIf EndIf If $TeleportState = "DISABLED" Then AutoItSetOption("MouseClickDownDelay", 100) ; MouseClick($MOUSE_CLICK_LEFT, $ResBlancNoir[0], $ResBlancNoir[1], 1, 1) AutoItSetOption("MouseClickDownDelay", 1) ; Else AutoItSetOption("MouseClickDownDelay", 1) ; MouseClick($MOUSE_CLICK_LEFT, $ResBlancNoir[0], $ResBlancNoir[1], 1, 1) AutoItSetOption("MouseClickDownDelay", 1) ; EndIf EndIf Endif EndIf EndFunc ;==>NewLoot this logic make me 'teleport' to a item, and pick it up but it is not nice ingame. Unnecessary motion intervenes. So, I want to change code. this is my thought. after teleport, move my mouse point to nearestspot to use "function FFnearestspot" but, after put my script. some times error pop-up. "Subscript used on non-accessible vatiable" how can I fix this problem? thanks Link to comment Share on other sites More sharing options...
Developers Jos Posted October 29, 2022 Developers Share Posted October 29, 2022 Welcome to the AutoIt forum. Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. See you soon with a legitimate question I hope. The Moderation team NiceTrybab 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts