Get Color Function

Getting a color

Page 1 of 1

6 Replies - 3890 Views - Last Post: 26 April 2009 - 03:37 AM Rate Topic: -----

#1 Dazastah  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 32
  • Joined: 15-April 09

Get Color Function

Post icon  Posted 25 April 2009 - 12:50 AM

I neeed something that will Get a color and maybe click a colour, maybe press a key before it.
My idea is
private static byte GetColorComponent(Color pixelColor, int colorComponent){
byte returnValue = 0;
switch(colorComponent){
case 0:
returnValue = pixelColor.R;
break;
case 1:
returnValue = pixelColor.G;
break;
case 2:
returnValue = pixelColor.B;
break;
}
return returnValue;
}

Any help? cheers

Is This A Good Question/Topic? 0
  • +

Replies To: Get Color Function

#2 Asscotte  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 35
  • View blog
  • Posts: 610
  • Joined: 08-February 09

Re: Get Color Function

Posted 25 April 2009 - 10:45 AM

View PostDazastah, on 24 Apr, 2009 - 11:50 PM, said:

I neeed something that will Get a color and maybe click a colour, maybe press a key before it.



erm... get a colour from what?
Was This Post Helpful? 0
  • +
  • -

#3 Dazastah  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 32
  • Joined: 15-April 09

Re: Get Color Function

Posted 25 April 2009 - 10:38 PM

A game, its a client called Endless Online, we have a program called Resource Hacker that allows us to change the gfx, so I need it to be able to click certain colours, Im trying to make something that will Use magic automatically on a patched monster, and relog, and heal, and shit like that. We only need 1 get color function tho
Was This Post Helpful? 0
  • +
  • -

#4 Asscotte  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 35
  • View blog
  • Posts: 610
  • Joined: 08-February 09

Re: Get Color Function

Posted 26 April 2009 - 01:29 AM

View PostDazastah, on 25 Apr, 2009 - 09:38 PM, said:

A game, its a client called Endless Online, we have a program called Resource Hacker that allows us to change the gfx, so I need it to be able to click certain colours, Im trying to make something that will Use magic automatically on a patched monster, and relog, and heal, and shit like that. We only need 1 get color function tho



you might find that quite hard if its a client to an online game as the sever side would not change only the client side would, but to do that you would have to have, a hollow form and some method of selecting pixels or mass selecting them :) and then gettting their html colours from that... then changing them which now i think about it would require your game to change runtime files and therfore qualifying to be a trainer - not many antiviruses will let trainers run due to their trojan like actions. so you would need to find a way round that but yer quite simple really :P

enjoy,
Was This Post Helpful? 0
  • +
  • -

#5 Dazastah  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 32
  • Joined: 15-April 09

Re: Get Color Function

Posted 26 April 2009 - 02:44 AM

Well there is another way called scar divi 3.15 but 3.15 is the more advanced scripting type, but the guy I work with once made an auto clicker that would click a patche item so I dont see how this aint gnna work.
:^: :^: I know there would be someone out there who has a solution, and btw, this guy made it click 100 times per seconds
Was This Post Helpful? 0
  • +
  • -

#6 Aurel300  Icon User is offline

  • D.I.C Head

Reputation: 13
  • View blog
  • Posts: 230
  • Joined: 10-November 07

Re: Get Color Function

Posted 26 April 2009 - 03:32 AM

Hm...
So, first, what is your problem with that function?
I mean... It can theoretically work...
So what do you EXACTLY want from us?

EDIT:
And if you want to get the color from a window at special position...
* getting idea what he wants *
Use this example as a base:

Imports System.Runtime.InteropServices
Imports System.Diagnostics

Public Class MWin
	Private Sub MWin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
		p = Process.GetProcessesByName("Whoop")
		RGfx = Graphics.FromImage(Renderer.Image)
	End Sub

	Private Sub RefreshButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RefreshButton.Click
		p = Process.GetProcessesByName("Whoop")
		RGfx = Graphics.FromImage(Renderer.Image)
	End Sub

	Private Sub RenderTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RenderTimer.Tick
		If (p.Count > 0) Then
			' Do your things here
		End If
	End Sub

	Private RGfx As Graphics
	Private SCapture As New ScreenShot.ScreenCapture
	Private WHandle As String
	Private p As Process()
End Class


- MWin is a form...
- Replace the "Whoop" with "process name" (found easily on Ctrl+Alt+Del, I assume it is "firefox")
- I have got a time "RenderTimer" - enabled, 100 interval
- Button "RefreshButton" - when you turn this on, and firefox isnīt on yet, it does nothing even if you turn it on... So you have to press this in that case.
- And a picture box "Renderer"
!!! Do NOT close firefox (or whatever) first, close it AFTER this VB application !!!
(crashes)

Oh... and you need a class called ScreenShot:
http://www.vbforums....ad.php?t=385497

This post has been edited by Aurel300: 26 April 2009 - 03:39 AM

Was This Post Helpful? 0
  • +
  • -

#7 Asscotte  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 35
  • View blog
  • Posts: 610
  • Joined: 08-February 09

Re: Get Color Function

Posted 26 April 2009 - 03:37 AM

View PostAurel300, on 26 Apr, 2009 - 02:32 AM, said:

Hm...
So, first, what is your problem with that function?
I mean... It can theoretically work...
So what do you EXACTLY want from us?



from what I gathered its getting this to happen in the program whilst this other porgram is running, i still think this is near impossible for vb because you would have to generate sprites and other things but there is no harm in trying :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1