|
02-03-2009, 01:43 AM
|
|
Ezudian
|
|
Join Date: Jul 2008
Location: Wilderness
Posts: 385
Reputation: 345
|
|
[function] Check for gas
This code i used at my ProMiners and it works very well. It check for gas under mouse. Btw... Those random updates.. did they remove gas?? If they did this is pretty useles..
simple example of use
Code:
Sub MyMiningThing()
Do Until Stop=True
MoveToRock
If Not GasFound Then LeftClick
Wait 2000,4000
Loop
End Sub
The function (you have to get all other things you need by yourself :))
Code:
Private Function GasFound(Percents As Integer)
Dim PixelChange As Integer, Xnow As Integer, Ynow As Integer, startX As Integer, startY As Integer
Dim RShdc As Long, x As Long, y As Long, Pixs(0 To 24, 0 To 25) As String
Dim PaintDebug As Integer, PixCount As Integer
PaintDebug = 1
RShdc = GetDC(selWnd)
startX = getx - 12
startY = GetY - 25
Xnow = 0
For x = startX To startX + 24
Ynow = 0
For y = startY To startY + 25
Pixs(Xnow, Ynow) = GetPixel(RShdc, x, y)
'If PaintDebug Then
' If Xnow = 0 Then SetPixel RShdc, x - 1, y, 9090
' If Ynow = 0 Then SetPixel RShdc, x, y - 1, 9090
' If x = startX + 18 Then SetPixel RShdc, x + 1, y, 9090
'If y = startY + 18 Then SetPixel RShdc, x, y + 1, 9090
'End If
PixCount = PixCount + 1
Ynow = Ynow + 1
Next y
Xnow = Xnow + 1
Next x
'Text1.Text = "PixCount " & PixCount & vbCrLf & Text1.Text
WaitMS Rand(30, 100)
Xnow = 0
Ynow = 0
For x = startX To startX + 24
Ynow = 0
For y = startY To startY + 25
If Not GetPixel(RShdc, x, y) = Pixs(Xnow, Ynow) Then PixelChange = PixelChange + 1
Ynow = Ynow + 1
Next y
Xnow = Xnow + 1
Next x
'Text1.Text = "PixelChange " & PixelChange & vbCrLf & Text1.Text
If Not PixelChange = 0 Then
AddToLog "PixelChange: " & Round(((PixelChange / PixCount)) * 100, 1) & "%"
'Text1.Text = "PixelChange " & (Int((PixelChange / PixCount) * 100)) & "%" & vbCrLf & Text1.Text
If Round(((PixelChange / PixCount) * 100), 0) >= Percents Then
GasFound = True
AddToLog "Possible Gas!"
mmouse2 627, 85
If Rand(1, 2) = 1 Then mmouse2 627, 85
WaitMS Rand(20, 150)
LClick
End If
End If
ReleaseDC selWnd, RShdc
End Function
Code:
Public Function GetY()
Dim wndRect As RECT
Dim mousexy As POINTAPI
GetWindowRect selWnd, wndRect
GetCursorPos mousexy
GetY = (mousexy.y - wndRect.Top)
End Function
Public Function GetX()
Dim wndRect As RECT
Dim mousexy As POINTAPI
GetWindowRect selWnd, wndRect
GetCursorPos mousexy
GetX = (mousexy.x - wndRect.Top)
End Function
|
02-05-2009, 03:32 PM
|
Ezudian
|
|
Join Date: Jan 2009
Posts: 7
Reputation: 43
|
|
what was the gas thing? if its what im thinking of is it the thing where stuff comes out of the rock? or is that called something else?
|
02-05-2009, 03:34 PM
|
|
Ex-Staff Member
|
|
Join Date: Jun 2008
Location: Russia
Posts: 1,143
Reputation: 1479
|
|
A.) In English, it is "smoke", "smoking rocks".
B.) When the random update happens, this will be useless.
__________________
|
02-05-2009, 06:10 PM
|
|
Ezudian
|
|
Join Date: Jul 2008
Location: In a van down by the river!
Posts: 153
Reputation: 354
|
|
What language would this be?
__________________
Niggle for life.
JELLO IS GOD
[X][X][X]
Also,
SHAMWOW
|
02-06-2009, 01:58 AM
|
|
Ex-Staff Member
|
|
Join Date: Jun 2008
Location: Russia
Posts: 1,143
Reputation: 1479
|
|
Quote:
Originally Posted by TheGopher
What language would this be?
|
Nunk is Dutch(I think)
If you mean the code, that looks like VB.
__________________
|
02-06-2009, 06:41 AM
|
|
Ezudian
|
|
Join Date: Jul 2008
Location: Wilderness
Posts: 385
Reputation: 345
|
|
Its VB6 code and im from Finland.
|
02-06-2009, 07:26 PM
|
|
Ezudian
|
|
Join Date: Jun 2008
Posts: 232
Reputation: 135
|
|
saatana vittu perkele
__________________
|
02-06-2009, 11:17 PM
|
|
Ezudian
|
|
Join Date: Aug 2008
Location: Australia FTW!!!
Posts: 1,231
Reputation: 1185
|
|
Yes useless after update sorry
__________________
Owned by teh sig?
|
02-07-2009, 01:27 AM
|
|
Ezudian
|
|
Join Date: Jul 2008
Location: Wilderness
Posts: 385
Reputation: 345
|
|
Quote:
Originally Posted by csg999
Yes useless after update sorry
|
Lol not its not. Its good for learning purposes (if it isnt badly done).
|
02-07-2009, 01:41 AM
|
|
Ezudian
|
|
Join Date: Aug 2008
Location: Australia FTW!!!
Posts: 1,231
Reputation: 1185
|
|
Quote:
Originally Posted by Nunk
Lol not its not. Its good for learning purposes (if it isnt badly done).
|
'useless' meaning it wont help in rs
__________________
Owned by teh sig?
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Affiliates: Trik.com
|
|