Quote:
Originally Posted by Rodent11
Well, @ [Only registered and activated users can see links. Click Here To Register...], take a look at my attached screenshot (Or this link, since the attached image is small: [Only registered and activated users can see links. Click Here To Register...]). We can see what's different here, mostly the offset value.
I would try out a change like this (replace your v.20's OCInventory function with this, should be line 859 in v.20 source):
Code:
Func OCInventory($open = True)
Local Const $Offset[2] = [-298, 30] ; Offset from reference_inventory to left border of first Inventory Slot. For future use.
Local $IS = False
Local $C[2]
Local $timer = TimerInit()
While Not $IS And $Fish
Sleep(250)
$IS = _ImageSearchArea("res/reference_inventory.bmp", 0, $ResOffset[0], $ResOffset[1], $ResOffset[2], $ResOffset[3], $C[0], $C[1], 15, 0)
Sleep(250)
If $IS = True Then
If $open = True Then
$C[0] += $Offset[0]
$C[1] += $Offset[1]
Return ($C)
ElseIf $open = False Then
CoSe("i")
Sleep(500)
EndIf
ElseIf $IS = False Then
If $open = True Then
CoSe("i")
MouseMove($ResOffset[0] + 30, $ResOffset[1] + 30)
Sleep(500)
ElseIf $open = False Then
SetGUIStatus("Inventory closed")
Return False
EndIf
EndIf
If TimerDiff($timer) / 1000 >= 6 Then
SetGUIStatus("OCInventory Timeout")
Return False
EndIf
WEnd
EndFunc ;==>OCInventory
This pretty much aligns it with how it is in the current version, leave the true/false on line 26 alone, in v.20 it is expecting False. The differences in line 8 and 22 don't matter. Line 8 is just different variable names (they're basically the same value), line 22 is just a different position for the mouse, which is in the top left corner of the game window to make sure it's out of the way.
Let me know if that works, if not, the results of testing from my last post.
|
Nothing changes Scroll down function is not working.. :S maybe its not enough to change only OCInventory maybe we need to change DetectFreeInventory too?
Func DetectFreeInventory()
Local $Free, $IS, $x, $y
SetGUIStatus("Detecting free inventory space")
OCInventory(False)
Local $InvA = OCInventory(True)
If IsArray($InvA) = False Then Return False
For $L = 0 To 2 Step 1
If MouseGetPos(0) >= $InvA[0] And MouseGetPos(0) <= $InvA[0] + 500 And MouseGetPos(1) >= $InvA[1] And MouseGetPos(1) <= $InvA[1] + 500 Then MouseMove($InvA[0] - 50, $InvA[1]) ; Keep mouse out of detection range
For $j = 0 To 7 Step 1
For $i = 0 To 7 Step 1
$IS = _ImageSearchArea("res/reference_empty.bmp", 0, $InvA[0] + $i * 48, $InvA[1] - 24 + $j * 48, $InvA[0] + 48 + $i * 48, $InvA[1] + 24 + $j * 48, $x, $y, 10, 0)
If $IS Then
$Free += 1
EndIf
Next
Next
If $L < 2 Then
MouseMove($InvA[0], $InvA[1])
Sleep(50)
MouseWheel("down", 8)
EndIf
Sleep(150)
Next
OCInventory(False)
SetGUIStatus($Free & " empty slots")
Return ($Free)
EndFunc ;==>DetectFreeInventory