Sign in to follow this  
Followers 0

Ffxi Mouse Position And Color

16 posts in this topic

Posted

i need help finding the mouse position and pixel color. i am working on a few different bots and need this information. i heard someone say to use the screenshots but i would like to know what programs you use and where you open the screenshots from.

Share this post


Link to post
Share on other sites



Posted

This is a repost of some info that might be useful.

This is written for AutoHotkey but should be easy to translate into AutoIt3:

#z:: ; Win-Z hotkey

MouseGetPos, X, Y

; Move the cursor out of the way so that it doesn't block the pixel we want.

; Move the mouse slowly so that the game can keep up with it:

MouseMove, 0, 0, 3

PixelGetColor, color, %X%, %Y%

MouseMove, %X%, %Y%, 1 ; moving faster seems ok in this case

clipboard = %clipboard%`nX%X% Y%Y% Color = %color%

return

AutoHotkey's PixelSearch now supports shades of variation, which I have also found to be useful for games where the colors aren't always exactly the same (perhaps due to images being overlayed on different colored backgrounds). It might also be possible to use the shades-of-variation feature to write scripts that work regardless of whether it is in full screen or windowed mode.

Share this post


Link to post
Share on other sites

Posted

could anyone tell me maybe if there is a way to view a screenshot in the same size and resolution that you view the game in

Share this post


Link to post
Share on other sites

Posted

I used Fraps [www.fraps.com]

Share this post


Link to post
Share on other sites

Posted

thnx

Share this post


Link to post
Share on other sites

Posted (edited)

I seem to have problems with PixelGetColor. I tried to make the script to logoff my character if I got the "You cannot fish here." or "You can't fish without bait." error messages. I used fraps to take a screenshot and used adobe photoshop to get the EXACT coordinates of a pixel on the text and autoit window spy to get the color. Problem is it just doesn't work, I think the PixelGetColor command sees another color. What do you guys use to get the coordinates of a pixel?

For the "You cannot fish here" error:

If PixelGetColor(71,739) = 3235328 AND PixelGetColor(86,739) = 3235328 AND PixelGetColor(135,742) = 3235328 Then

$logtime = $logtime + 1;

For the "You can't fish without bait" error:

If PixelGetColor(28,735) = 0 AND PixelGetColor(86,735) = 0 AND PixelGetColor(334,745) = 0 Then

$logtime = $logtime + 1;

Edited by ravenfyre

Share this post


Link to post
Share on other sites

Posted

Write a small script that looks at those locations and have it tell what color it sees, then use those colors.

Share this post


Link to post
Share on other sites

Posted

The biggest problem I have is that on PixelGetColor It will not hit enter when the color matches. I have checked and rechecked the pixel colors and locations, Colors are default and even compared screenshots. So far I have stuck to the older "Left click" method of script but getting PixelGetColor to work properly would be much nicer.

Share this post


Link to post
Share on other sites

Posted (edited)

Thanks FFXI Fisherman, that sounds like a good idea but I noticed the color seemed to change slightly of the text that says "You cannot fish here." I just came up with a different approach and now it works. Now my character logs out if I get either the "you cannot fish here" or "you can't fish without bait" error. I posted it in this post HERE

Edited by ravenfyre

Share this post


Link to post
Share on other sites

Posted (edited)

I don't understand the color codes. How can I find out what color "16777215" is, or what number default echo text color is?

Edit: Nevermind, I found it with AutoIt. :whistle:

Edited by HBD

Share this post


Link to post
Share on other sites

Posted

Hi, I upload a script in Yahoo Group (AutoItList), will help you.

I also sometimes use software to capture color.

But, with AutoIt is possible. :whistle:

If you are registered in the Yahoo Group, download this file:

>> PixelColor.zip

Or copy this code,

The script code's looks so:

;// GetPixColor
;// Desc: Capture a color screen's and returns the values in Hexadecimal & RGB formats (especially for webmasters).
;// NOTE: The time to response depend to machine speed's. (SplashText)

; Verify the version
If StringReplace(@AutoItVersion, ".", "") < 3085 then
   msgbox(0, "Error", "Some functions in this script aren't available for your installed version," & @LF & "Please install the latest version of AutoIt3.")
   exit
EndIf

;// You can end the process pressing the keys stored in "$ks".
$ks= "^+Q"
$End= 1
HotKeySet($ks, "ELoop") 
$width_splash= 120
$height_splash= 30

;// A remainder
msgbox(64, "Remember", "To end, press: " & VKEYS($ks))

while $END == 1
  $pix = MouseGetPos()
  $var = PixelGetColor( $pix[0], $pix[1])
  $hex= hex($var, 6)
 ;// Arranging the AutoIt output
  $hexarr= stringright($hex, 2) & stringmid($hex, 3, 2) & stringleft($hex, 2)

;// Intelligent position, move the splash if not visible in Screen
  If $pix[0] < @desktopwidth - $width_splash Then
       $posX= $pix[0]+8
  Else
       $posX= $pix[0] - $width_splash - 8
  EndIf
  If $pix[1] < @desktopheight - $height_splash Then
       $posY= $pix[1]+8
  Else
       $posY= $pix[1] - $height_splash - 8
  EndIf
  SplashTextOn("", "HEX= " & Chr(34) & "#"& $hexarr & Chr(34) & @LF & "RGB= " & RGB($hex), $width_splash, $height_splash, $posX, $posY, 1, "arial", "8", "")
wend

SplashOff()
;// Optional copy the values to clipboard
$op= msgbox(4, "?", "Copy the values color's to clipboard?")
If $op = 6 then ClipPut("HEX= " & Chr(34) & "#"& $hexarr & Chr(34) & " | RGB=" & RGB($hex))
exit

;; SMALL FUNCTIONS
;¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'
;// This little ends the ''while'' loop
Func ELoop()
  $END= 0
EndFunc

;¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'
; Returns the RGB (Red, Green, Blue) values
Func RGB($hex)
Local $val
Local $rgb
$val= StringLower($hex)
Dim $v[7]

For $i=0 to 6
  $v[$i]= GDec(stringmid($val, $i+1, 1))
Next

  $x= ($v[0] * 16) + $v[1]
  $y= ($v[2] * 16) + $v[3]
  $z= ($v[4] * 16) + $v[5]
;; arrange
  $rgb= "(" & $z & ", " & $y & ", " & $x & ")"
Return $rgb
EndFunc

;¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'
;// Convert HEX to DEC
Func GDec($hex)
Local $n
Local $hex
$n= $hex

Select
     Case $hex == "a"
          $n= 10
     Case $hex == "b"
          $n= 11
     Case $hex == "c"
          $n= 12
     Case $hex == "d"
          $n= 13
     Case $hex == "e"
          $n= 14
     Case $hex == "f"
          $n= 15
EndSelect
Return $n
EndFunc

;¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'¯'
;// Verify the keys and returns in text format.
Func VKEYS($kstring)
Local $tx
Local $out
Local $fout
$fout= ""
For $i=1 to StringLen($kstring)
  $tx= StringMid($kstring, $i, 1)
  $out = $tx
  If $out == "!" then $out= "ALT"
  If $out == "+" then $out= "SHIFT"
  If $out == "^" then $out= "CTRL"
  If $i <> StringLen($kstring) then
     $fout= $fout & chr(34) & $out & chr(34) & " + "
  else
     $fout= $fout & chr(34) & $out & chr(34)
  EndIF
Next
Return $fout
EndFunc

Test and see if helps you. B)

Note: Remember this script is for Aut3 v3.0.85 and later.

Share this post


Link to post
Share on other sites

Posted

To anyone having problems with seemingly "shifting" text colors, what kind of chatbox background are you using?

I'm mainly asking because when I first started to play the game I went to config and changed my chatbox background to #5, which is basically a transparent gray. However, I noticed that sometimes in really bright areas like Valkurm or Qufim the text color would get distorted, as the background lighting would bleed through. The same thing would happen in very dark areas as well.

Eventually I changed the background non-transparent scheme (like the stone/gray slate one) and it fixed the problem.

Share this post


Link to post
Share on other sites

Posted

Possibly of interest: AutoHotkey's version of PixelSearch has a shades-of-variation feature that might help with finding colors that vary.

AutoHotkey is especially good for gamers because it allows any key to be a hotkey (even a mouse button if you're using WinNT, 2k, or XP). It may even be able to override game restrictions and built-in keys by use of the keyboard hook.

Share this post


Link to post
Share on other sites

Posted (edited)

Ok even though I found a fix for my previous problem, it will not be good for my new script so I would like to followup on what FFXI Fisherman said.

I have written a script that looks at certain points now I wonder how can I make the script tell me what it sees. Onemethod would definitely be using msgbox, but is there any way to get the script to tell me in game by let's say something like

Send("/say $color1 $color2 $color4");

It doesn't work, would such a thing be possible or am I limited to msgbox?

Edited by ravenfyre

Share this post


Link to post
Share on other sites

Posted

Maybe write it to a log file?

So that $color1 2 3 etc are all saved into a log.

Share this post


Link to post
Share on other sites

Posted (edited)

If you want to see a kind of status window with a message that you update constantly, you could do the following..

Add this function to your script:

Func ShowMenu($msg)
   $Title = "test"
   if winexists($Title,"") then
      controlsettext($title, "", "Static1", $msg)
   else
      SplashTextOn($Title,$msg,300,100,1,1,4,"Courier",10,600)
   endif
EndFunc

Then call it at any place in your script like this:

ShowMenu("/say $color1 $color2 $color4")
Edited by JdeB

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0