Sign in to follow this  
Followers 0
blizzedout

Get position...

17 posts in this topic

#1 ·  Posted (edited)

Ok is there an easier way to make a setup function?

$X = 0
MsgBox(0, "Login Screen", "Please find the login box on the homepage of myspace move the mouse to the top left corner of the little box and press Ctrl when the mouse is in the right spot.", 10)
Do
    
    If _IsPressed('30') Then;Server Busy Box
        $pos = MouseGetPos()
        $var = PixelGetColor($pos[0], $pos[1])
        IniWrite("Random.INI", "PixelSettings", "ServerBusyPosX", "" & $pos[0])
        IniWrite("Random.INI", "PixelSettings", "ServerBusyPosY", "" & $pos[1])
        IniWrite("Random.INI", "PixelSettings", "ServerBusyColor", $var)
    EndIf
    If _IsPressed('31') Then;Cannot Find Server box
        $pos = MouseGetPos()
        $var = PixelGetColor($pos[0], $pos[1])
        IniWrite("Random.INI", "PixelSettings", "CannotFindServerPosX", "" & $pos[0])
        IniWrite("Random.INI", "PixelSettings", "CannotFindServerPosY", "" & $pos[1])
        IniWrite("Random.INI", "PixelSettings", "CannotFindServerColor", $var)
    EndIf
    If _IsPressed('32') Then;ReLogin Box
        $pos = MouseGetPos()
        $var = PixelGetColor($pos[0], $pos[1])
        IniWrite("Random.INI", "PixelSettings", "ReLoginPosX", "" & $pos[0])
        IniWrite("Random.INI", "PixelSettings", "ReLoginPosY", "" & $pos[1])
        IniWrite("Random.INI", "PixelSettings", "ReLoginColor", $var)
    EndIf
    If _IsPressed('33') Then;Send Message Box
        $pos = MouseGetPos()
        $var = PixelGetColor($pos[0], $pos[1])
        IniWrite("Random.INI", "PixelSettings", "SendMessageBoxPosX", "" & $pos[0])
        IniWrite("Random.INI", "PixelSettings", "SendMessageBoxPosY", "" & $pos[1])
        IniWrite("Random.INI", "PixelSettings", "SendMessageBoxColor", $var)
    EndIf
    If _IsPressed('34') Then;No Photo
        $pos = MouseGetPos()
        $var = PixelGetColor($pos[0], $pos[1])
        IniWrite("Random.INI", "PixelSettings", "NoPhotoPosX", "" & $pos[0])
        IniWrite("Random.INI", "PixelSettings", "NoPhotoPosY", "" & $pos[1])
        IniWrite("Random.INI", "PixelSettings", "NoPhotoColor", $var)
    EndIf
    If _IsPressed('35') Then;Must Be Her Friend
        $pos = MouseGetPos()
        $var = PixelGetColor($pos[0], $pos[1])
        IniWrite("Random.INI", "PixelSettings", "MustBeHerFriendPosX", "" & $pos[0])
        IniWrite("Random.INI", "PixelSettings", "MustBeHerFriendPosY", "" & $pos[1])
        IniWrite("Random.INI", "PixelSettings", "MustBeHerFriendColor", $var)
    EndIf
    If _IsPressed('36') Then;Unexpected Error MSG
        $pos = MouseGetPos()
        $var = PixelGetColor($pos[0], $pos[1])
        IniWrite("Random.INI", "PixelSettings", "UnexpectedErrorMSGPosX", "" & $pos[0])
        IniWrite("Random.INI", "PixelSettings", "UnexpectedErrorMSGPosY", "" & $pos[1])
        IniWrite("Random.INI", "PixelSettings", "UnexpectedErrorMSGColor", $var)
    EndIf
    If _IsPressed('37') Then;Private Message Sent
        $pos = MouseGetPos()
        $var = PixelGetColor($pos[0], $pos[1])
        IniWrite("Random.INI", "PixelSettings", "PrivateMessageSentPosX", "" & $pos[0])
        IniWrite("Random.INI", "PixelSettings", "PrivateMessageSentPosY", "" & $pos[1])
        IniWrite("Random.INI", "PixelSettings", "PrivateMessageSentColor", $var)
    EndIf
    If _IsPressed('38') Then;Max Sent
        $pos = MouseGetPos()
        $var = PixelGetColor($pos[0], $pos[1])
        IniWrite("Random.INI", "PixelSettings", "MaxSentPosX", "" & $pos[0])
        IniWrite("Random.INI", "PixelSettings", "MaxSentPosY", "" & $pos[1])
        IniWrite("Random.INI", "PixelSettings", "MaxSentColor", $var)
    EndIf

    If _IsPressed('1B') Then
        $X = 1
    EndIf
    Sleep(100)
Until $X = 1

Func _IsPressed($s_hexKey, $v_dll = 'user32.dll')
    Local $a_R = DllCall($v_dll, "int", "GetAsyncKeyState", "int", '0x' & $s_hexKey)
    If Not @error And BitAND($a_R[0], 0x8000) = 0x8000 Then Return 1
    Return 0
EndFunc ;==>_IsPressed
Edited by blizzedout

Share this post


Link to post
Share on other sites



Not exactly sure what you're doing, but I can simplify the code. Make a function to catch all the IsPressed and INI write things.

Example:

If _IsPressed('38') Then;Max Sent
        GoWrite("MaxSentPosX", "MaxSentPosY", "MaxSentColor")
EndIf
.....
Func GoWrite($IniInfo1, $IniInfo2, $IniInfo3)
        $pos = MouseGetPos()
        $var = PixelGetColor($pos[0], $pos[1])
        IniWrite("Random.INI", "PixelSettings", $IniInfo1, "" & $pos[0])
        IniWrite("Random.INI", "PixelSettings", $IniInfo2, "" & $pos[1])
        IniWrite("Random.INI", "PixelSettings", $IniInfo3, $var)
EndFunc

Share this post


Link to post
Share on other sites

Not exactly sure what you're doing, but I can simplify the code. Make a function to catch all the IsPressed and INI write things.

Example:

If _IsPressed('38') Then;Max Sent
        GoWrite("MaxSentPosX", "MaxSentPosY", "MaxSentColor")
EndIf
.....
Func GoWrite($IniInfo1, $IniInfo2, $IniInfo3)
        $pos = MouseGetPos()
        $var = PixelGetColor($pos[0], $pos[1])
        IniWrite("Random.INI", "PixelSettings", $IniInfo1, "" & $pos[0])
        IniWrite("Random.INI", "PixelSettings", $IniInfo2, "" & $pos[1])
        IniWrite("Random.INI", "PixelSettings", $IniInfo3, $var)
EndFunc
Thats what i was lookin for :o

I sometimes know what im wasteing time typeing these long ass things lol.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Im trying to make a button on my GUI that will let me set up the cords and colors so it will work on anyones comp.

Thanks now it looks like this:

Do
    If _IsPressed('30') Then;Server Busy Box
        GoWrite("ServerBusyPosX", "ServerBusyPosY", "ServerBusyColor")
    EndIf
    If _IsPressed('31') Then;Cannot Find Server box
        GoWrite("CannotFindServerPosX", "CannotFindServerPosY", "CannotFindServerColor")
    EndIf
    If _IsPressed('32') Then;ReLogin Box
        GoWrite("ReLoginPosX", "ReLoginPosY", "ReLoginColor")
    EndIf
    If _IsPressed('33') Then;Send Message Box
        GoWrite("SendMessageBoxPosX", "SendMessageBoxPosY", "SendMessageBoxColor")
    EndIf
    If _IsPressed('34') Then;No Photo
        GoWrite("NoPhotoPosX", "NoPhotoPosY", "NoPhotoColor")
    EndIf
    If _IsPressed('35') Then;Must Be Her Friend
        GoWrite("MustBeHerFriendPosX", "MustBeHerFriendPosY", "MustBeHerFriendColor")
    EndIf
    If _IsPressed('36') Then;Unexpected Error MSG
        GoWrite("UnexpectedErrorMSGPosX", "UnexpectedErrorMSGPosY", "UnexpectedErrorMSGColor")
    EndIf
    If _IsPressed('37') Then;Private Message Sent
        GoWrite("PrivateMessageSentPosX", "PrivateMessageSentPosY", "PrivateMessageSentColor")
    EndIf
    If _IsPressed('38') Then;$Max Sent
        GoWrite("MaxSentPosX", "MaxSentPosY", "MaxSentColor")
    EndIf
    
    If _IsPressed('1B') Then
        $X = 1
    EndIf
    Sleep(100)
Until $X = 1

Func GoWrite($IniInfo1, $IniInfo2, $IniInfo3)
    $pos = MouseGetPos()
    $var = PixelGetColor($pos[0], $pos[1])
    IniWrite("Random.INI", "PixelSettings", $IniInfo1, "" & $pos[0])
    IniWrite("Random.INI", "PixelSettings", $IniInfo2, "" & $pos[1])
    IniWrite("Random.INI", "PixelSettings", $IniInfo3, $var)
EndFunc  ;==>GoWrite

You think you can make my INI read a lil more simple here is what i got...

$ServerBusyPosX = IniRead("Cords.INI", "PixelSettings", "ServerBusyPosX", "NotFound")
    $ServerBusyPosY = IniRead("Cords.INI", "PixelSettings", "ServerBusyPosY", "NotFound")
    $ServerBusyColor = IniRead("Cords.INI", "PixelSettings", "ServerBusyColor", "NotFound")
    
    $CannotFindServerPosX = IniRead("Cords.INI", "PixelSettings", "CannotFindServerPosX", "NotFound")
    $CannotFindServerPosY = IniRead("Cords.INI", "PixelSettings", "CannotFindServerPosY", "NotFound")
    $CannotFindServerColor = IniRead("Cords.INI", "PixelSettings", "CannotFindServerColor", "NotFound")
    
    $ReLoginPosX = IniRead("Cords.INI", "PixelSettings", "ReLoginPosX", "NotFound")
    $ReLoginPosY = IniRead("Cords.INI", "PixelSettings", "ReLoginPosY", "NotFound")
    $ReLoginColor = IniRead("Cords.INI", "PixelSettings", "ReLoginColor", "NotFound")
    
    $SendMessageBoxPosX = IniRead("Cords.INI", "PixelSettings", "SendMessageBoxPosX", "NotFound")
    $SendMessageBoxPosY = IniRead("Cords.INI", "PixelSettings", "SendMessageBoxPosY", "NotFound")
    $SendMessageBoxColor = IniRead("Cords.INI", "PixelSettings", "SendMessageBoxColor", "NotFound")
    
    $NoPhotoPosX = IniRead("Cords.INI", "PixelSettings", "NoPhotoPosX", "NotFound")
    $NoPhotoPosY = IniRead("Cords.INI", "PixelSettings", "NoPhotoPosY", "NotFound")
    $NoPhotoColor = IniRead("Cords.INI", "PixelSettings", "NoPhotoColor", "NotFound")
    
    $MustBeHerFriendPosX = IniRead("Cords.INI", "PixelSettings", "MustBeHerFriendPosX", "NotFound")
    $MustBeHerFriendPosY = IniRead("Cords.INI", "PixelSettings", "MustBeHerFriendPosY", "NotFound")
    $MustBeHerFriendColor = IniRead("Cords.INI", "PixelSettings", "MustBeHerFriendColor", "NotFound")
    
    $UnexpectedErrorMSGPosX = IniRead("Cords.INI", "PixelSettings", "UnexpectedErrorMSGPosX", "NotFound")
    $UnexpectedErrorMSGPosY = IniRead("Cords.INI", "PixelSettings", "UnexpectedErrorMSGPosY", "NotFound")
    $UnexpectedErrorMSGColor = IniRead("Cords.INI", "PixelSettings", "UnexpectedErrorMSGColor", "NotFound")
    
    $PrivateMessageSentPosX = IniRead("Cords.INI", "PixelSettings", "PrivateMessageSentPosX", "NotFound")
    $PrivateMessageSentY = IniRead("Cords.INI", "PixelSettings", "PrivateMessageSentPosY", "NotFound")
    $PrivateMessageSentColor = IniRead("Cords.INI", "PixelSettings", "PrivateMessageSentColor", "NotFound")
    
    $MaxSentPosX = IniRead("Cords.INI", "PixelSettings", "MaxSentPosX", "NotFound")
    $MaxSentPosY = IniRead("Cords.INI", "PixelSettings", "MaxSentPosY", "NotFound")
    $MaxSentColor = IniRead("Cords.INI", "PixelSettings", "MaxSentColor", "NotFound")
Edited by blizzedout

Share this post


Link to post
Share on other sites

Functions are handy things when you have a lot of code that is similar or identical. When I posted yesterday I was going to suggest using a loop (also another handy thing), but then I realized that you'd still have to know which function call went with which key press, and that wouldn't have been as simple as I thought.

However, now that I brought it up again I have an idea... I'll test it and come back in a few minutes.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

wouldnt this work too for me?

GoWrite("PrivateMessageSent")

Func GoWrite($IniInfo)
    $pos = MouseGetPos()
    $var = PixelGetColor($pos[0], $pos[1])
    IniWrite("Random.INI", "PixelSettings", $IniInfo & "PosX", "" & $pos[0])
    IniWrite("Random.INI", "PixelSettings", $IniInfo & "PosY", "" & $pos[1])
    IniWrite("Random.INI", "PixelSettings", $IniInfo & "Color", $var)
EndFunc ;==>GoWrite

and this:

GoRead("PrivateMessageSent")

Func GoRead($IniInfo1)
    $IniInfo1 & "PosX" = IniRead("Cords.INI", "PixelSettings", $IniInfo1 & "PosX", "NotFound")
    $IniInfo1 & "PosY" = IniRead("Cords.INI", "PixelSettings", $IniInfo1 & "PosY", "NotFound")
    $IniInfo1 & "Color" = IniRead("Cords.INI", "PixelSettings", $IniInfo1 & "Color", "NotFound")
EndFunc ;==>GoRead
Edited by blizzedout

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

The write part would work, but I've improved it anyway. Check this out so far:

Global $IniWriteArray[9][3] = [["ServerBusyPosX", "ServerBusyPosY", "ServerBusyColor"], ["CannotFindServerPosX", "CannotFindServerPosY", "CannotFindServerColor"], _ 
["ReLoginPosX", "ReLoginPosY", "ReLoginColor"], ["SendMessageBoxPosX", "SendMessageBoxPosY", "SendMessageBoxColor"], _ 
["NoPhotoPosX", "NoPhotoPosY", "NoPhotoColor"], ["MustBeHerFriendPosX", "MustBeHerFriendPosY", "MustBeHerFriendColor"], _ 
["UnexpectedErrorMSGPosX", "UnexpectedErrorMSGPosY", "UnexpectedErrorMSGColor"], _ 
["PrivateMessageSentPosX", "PrivateMessageSentPosY", "PrivateMessageSentColor"], ["MaxSentPosX", "MaxSentPosY", "MaxSentColor"]]

While 1
    For $i = 30 To 38
        If _IsPressed ($i) Then
            GoWrite ($IniWriteArray[$i - 30][0], $IniWriteArray[$i - 30][1], $IniWriteArray[$i - 30][2])
        EndIf
    Next
    If _IsPressed('1B') Then
        ExitLoop
    EndIf
    Sleep(100)
WEnd

This uses the same GoWrite function that I initially posted.

Edit - you're right, simplifying the array would help. I'll fix that too.

Edited by greenmachine

Share this post


Link to post
Share on other sites

The write part would work, but I've improved it anyway. Check this out so far:

Global $IniWriteArray[9][3] = [["ServerBusyPosX", "ServerBusyPosY", "ServerBusyColor"], ["CannotFindServerPosX", "CannotFindServerPosY", "CannotFindServerColor"], _ 
["ReLoginPosX", "ReLoginPosY", "ReLoginColor"], ["SendMessageBoxPosX", "SendMessageBoxPosY", "SendMessageBoxColor"], _ 
["NoPhotoPosX", "NoPhotoPosY", "NoPhotoColor"], ["MustBeHerFriendPosX", "MustBeHerFriendPosY", "MustBeHerFriendColor"], _ 
["UnexpectedErrorMSGPosX", "UnexpectedErrorMSGPosY", "UnexpectedErrorMSGColor"], _ 
["PrivateMessageSentPosX", "PrivateMessageSentPosY", "PrivateMessageSentColor"], ["MaxSentPosX", "MaxSentPosY", "MaxSentColor"]]

While 1
    For $i = 30 To 38
        If _IsPressed ($i) Then
            GoWrite ($IniWriteArray[$i - 30][0], $IniWriteArray[$i - 30][1], $IniWriteArray[$i - 30][2])
        EndIf
    Next
    If _IsPressed('1B') Then
        ExitLoop
    EndIf
    Sleep(100)
WEnd

This uses the same GoWrite function that I initially posted.

Edit - you're right, simplifying the array would help. I'll fix that too.

hmm soo what will this one do? lets say i pressed key 7?

on and is there an easy way to do the read one.. Cuz I dont want to have to do all the variables, any way to do mulitple varuables with out writing the whole thing?

Share this post


Link to post
Share on other sites

I'm working on it...

For the keys, that just checks 30-38, and if one is pressed (such as 35), it will run the function on array[5], which has the data for that key.

Share this post


Link to post
Share on other sites

I'm working on it...

For the keys, that just checks 30-38, and if one is pressed (such as 35), it will run the function on array[5], which has the data for that key.

ahh tight, wow i feel like a cave man.. you just reduiced my 100+ lines into like 15

Share this post


Link to post
Share on other sites

It's still going to be shorter, because I'm getting the reading part down to only a few lines as well. But I do need to know this: do you want all the reads to be done at the same time? Like, if I made the iniread function, would it just cycle through all of the things and read in the values, or is it like the write function, where it would only read in certain conditions? I think I already know the answer (common sense says do it all at once), but I want to be sure.

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Oh well, beat you to it. Try this (it's not tested, because I don't have the INI and I didn't want to make one):

Global $IniReadArray[27][2] = [["ServerBusyPosX", 0], ["ServerBusyPosY", 0], ["ServerBusyColor", 0], _ 
["CannotFindServerPosX", 0], ["CannotFindServerPosY", 0], ["CannotFindServerColor", 0], _ 
["ReLoginPosX", 0], ["ReLoginPosY", 0], ["ReLoginColor", 0], ["SendMessageBoxPosX", 0], ["SendMessageBoxPosY", 0], ["SendMessageBoxColor", 0], _ 
["NoPhotoPosX", 0], ["NoPhotoPosY", 0], ["NoPhotoColor", 0], ["MustBeHerFriendPosX", 0], ["MustBeHerFriendPosY", 0], ["MustBeHerFriendColor", 0], _ 
["UnexpectedErrorMSGPosX", 0], ["UnexpectedErrorMSGPosY", 0], ["UnexpectedErrorMSGColor", 0], _ 
["PrivateMessageSentPosX", 0], ["PrivateMessageSentPosY", 0], ["PrivateMessageSentColor", 0], ["MaxSentPosX", 0], ["MaxSentPosY", 0], ["MaxSentColor", 0]]

Global $IniArray[9] = ["ServerBusy", "CannotFindServer", "ReLogin", "SendMessageBox", "NoPhoto", "MustBeHerFriend", _ 
"UnexpectedErrorMSG", "PrivateMessageSent", "MaxSent"]

For $i = 0 To 8
    GoRead ($IniArray[$i], $i)
Next
$msg = ""
For $i = 0 To 26
    $msg &= $IniReadArray[$i][0] & " - " & $IniReadArray[$i][1] & @CRLF
Next
MsgBox (0, "IniRead", $msg)

While 1
    For $i = 30 To 38
        If _IsPressed ($i) Then
            GoWrite ($IniArray[$i - 30])
        EndIf
    Next
    If _IsPressed('1B') Then
        ExitLoop
    EndIf
    Sleep(100)
WEnd

Func GoWrite($IniInfo)
    $pos = MouseGetPos()
    $var = PixelGetColor($pos[0], $pos[1])
    IniWrite("Random.INI", "PixelSettings", $IniInfo & "PosX", "" & $pos[0])
    IniWrite("Random.INI", "PixelSettings", $IniInfo & "PosY", "" & $pos[1])
    IniWrite("Random.INI", "PixelSettings", $IniInfo & "Color", $var)
EndFunc;==>GoWrite

Func GoRead($IniInfo, $Num)
    $IniReadArray[$Num*3][1] = IniRead("Cords.INI", "PixelSettings", $IniInfo & "PosX", "NotFound")
    $IniReadArray[$Num*3 + 1][1] = IniRead("Cords.INI", "PixelSettings", $IniInfo & "PosY", "NotFound")
    $IniReadArray[$Num*3 + 2][1] = IniRead("Cords.INI", "PixelSettings", $IniInfo & "Color", "NotFound")
EndFunc

See if that works how it should.

Edit - it's not going to work.. I changed the Array name.. I need to edit it really quick and it should work.

Edited by greenmachine

Share this post


Link to post
Share on other sites

whats the $msg &= do?

Share this post


Link to post
Share on other sites

I made $msg a blank string "". Then, if you have beta, the $msg &= "stuff" will add "stuff" to whatever is in the string. It's just a simpler and much faster way of saying $msg = $msg & "stuff".

Share this post


Link to post
Share on other sites

For the read im just gonna do:

Func Read($IniRead)
    Global $X = IniRead("Cords.INI", "PixelSettings", $IniRead& "PosX", "NotFound")
    Global $Y = IniRead("Cords.INI", "PixelSettings", $IniRead & "PosY", "NotFound")
    Global $Color = IniRead("Cords.INI", "PixelSettings", $IniRead & "Color", "NotFound")
EndFunc;==>GoRead

and when ever i want to pull the color I will do this:

Read("PrivateMessageSent")
$PriveMsgColor = $color

Share this post


Link to post
Share on other sites

That's a fine idea. One tip though - Au3Check (maybe AutoIt too) doesn't like it when you declare global variables inside functions. So in that case, what I would do is make the var declarations at the top of the script, and just set them equal to 0 to start.

Also what you could do is have it return a small array, so that the syntax would be:

$PrivateMessageInfo = Read("PrivateMessageSent")
; XPos = index 0, YPos = index 1, Color = index 2

Func Read($IniRead)
    Local $a_array[3]
    $a_array[0] = IniRead("Cords.INI", "PixelSettings", $IniRead& "PosX", "NotFound")
    $a_array[1] = IniRead("Cords.INI", "PixelSettings", $IniRead & "PosY", "NotFound")
    $a_array[2] = IniRead("Cords.INI", "PixelSettings", $IniRead & "Color", "NotFound")
    Return $a_array
EndFunc;==>GoRead

It's all up to you how you do it, it's your script. I just like having arrays because it keeps all similar things together, and allows for fewer variables.

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

Worked fine tho. Check it out :o

You need to have beta on:

#include <GUIConstants.au3>
Opt("GUIOnEventMode", 1)
GUICreate("Set Pixels", 317, 461, 192, 125)

Read("CannotFindServer")
GUICtrlCreateGroup("Cannot Find Server", 0, 0, 313, 49)
GUICtrlCreateLabel("Color:", 40, 22, 31, 17)
GUICtrlCreateInput("" & $Color, 72, 19, 65, 19)
GUICtrlCreateLabel("X:", 144, 22, 14, 17)
GUICtrlCreateInput("" & $X, 160, 19, 33, 19)
GUICtrlCreateLabel("Y:", 200, 22, 14, 17)
GUICtrlCreateInput("" & $Y, 216, 19, 33, 19)
$Set_CannotFindServer = GUICtrlCreateButton("Set", 256, 19, 33, 19, 0)
GUICtrlSetOnEvent($Set_CannotFindServer, "Set_CannotFindServer")
GUICtrlCreateGraphic(10, 19, 25, 17)
GUICtrlSetBkColor(-1, $Color)
GUICtrlCreateGroup("", -99, -99, 1, 1)

Read("ReLogin")
GUICtrlCreateGroup("Re-Login", 0, 50, 313, 49)
GUICtrlCreateLabel("Color:", 40, 72, 31, 17)
GUICtrlCreateInput("" & $Color, 72, 69, 65, 19)
GUICtrlCreateLabel("X:", 144, 72, 14, 17)
GUICtrlCreateInput("" & $X, 160, 69, 33, 19)
GUICtrlCreateLabel("Y:", 200, 72, 14, 17)
GUICtrlCreateInput("" & $Y, 216, 69, 33, 19)
$Set_ReLogin = GUICtrlCreateButton("Set", 256, 69, 33, 19, 0)
GUICtrlSetOnEvent($Set_ReLogin, "Set_ReLogin")
GUICtrlCreateGraphic(10, 69, 25, 17)
GUICtrlSetBkColor(-1, $Color)
GUICtrlCreateGroup("", -99, -99, 1, 1)

Read("SendMessageBox")
GUICtrlCreateGroup("Send Message Box", 0, 100, 313, 49)
GUICtrlCreateLabel("Color:", 40, 122, 31, 17)
GUICtrlCreateInput("" & $Color, 72, 119, 65, 19)
GUICtrlCreateLabel("X:", 144, 122, 14, 17)
GUICtrlCreateInput("" & $X, 160, 119, 33, 19)
GUICtrlCreateLabel("Y:", 200, 122, 14, 17)
GUICtrlCreateInput("" & $Y, 216, 119, 33, 19)
$Set_SendMessageBox = GUICtrlCreateButton("Set", 256, 119, 33, 19, 0)
GUICtrlSetOnEvent($Set_SendMessageBox, "Set_SendMessageBox")
GUICtrlCreateGraphic(10, 119, 25, 17)
GUICtrlSetBkColor(-1, $Color)
GUICtrlCreateGroup("", -99, -99, 1, 1)

Read("NoPhoto")
GUICtrlCreateGroup("No Photo", 0, 150, 313, 49)
GUICtrlCreateLabel("Color:", 40, 172, 31, 17)
GUICtrlCreateInput("" & $Color, 72, 169, 65, 19)
GUICtrlCreateLabel("X:", 144, 172, 14, 17)
GUICtrlCreateInput("" & $X, 160, 169, 33, 19)
GUICtrlCreateLabel("Y:", 200, 172, 14, 17)
GUICtrlCreateInput("" & $Y, 216, 169, 33, 19)
$Set_NoPhoto = GUICtrlCreateButton("Set", 256, 169, 33, 19, 0)
GUICtrlSetOnEvent($Set_NoPhoto, "Set_NoPhoto")
GUICtrlCreateGraphic(10, 169, 25, 17)
GUICtrlSetBkColor(-1, $Color)
GUICtrlCreateGroup("", -99, -99, 1, 1)

Read("MustBeHerFriend")
GUICtrlCreateGroup("Must Be Her Friend", 0, 200, 313, 49)
GUICtrlCreateLabel("Color:", 40, 222, 31, 17)
GUICtrlCreateInput("" & $Color, 72, 219, 65, 19)
GUICtrlCreateLabel("X:", 144, 222, 14, 17)
GUICtrlCreateInput("" & $X, 160, 219, 33, 19)
GUICtrlCreateLabel("Y:", 200, 222, 14, 17)
GUICtrlCreateInput("" & $Y, 216, 219, 33, 19)
$Set_MustBeHerFriend = GUICtrlCreateButton("Set", 256, 219, 33, 19, 0)
GUICtrlSetOnEvent($Set_MustBeHerFriend, "Set_MustBeHerFriend")
GUICtrlCreateGraphic(10, 219, 25, 17)
GUICtrlSetBkColor(-1, $Color)
GUICtrlCreateGroup("", -99, -99, 1, 1)

Read("UnexpectedErrorMSG")
GUICtrlCreateGroup("Unexpected Error MSG", 0, 250, 313, 49)
GUICtrlCreateLabel("Color:", 40, 272, 31, 17)
GUICtrlCreateInput("" & $Color, 72, 269, 65, 19)
GUICtrlCreateLabel("X:", 144, 272, 14, 17)
GUICtrlCreateInput("" & $X, 160, 269, 33, 19)
GUICtrlCreateLabel("Y:", 200, 272, 14, 17)
GUICtrlCreateInput("" & $Y, 216, 269, 33, 19)
$Set_UnexpectedErrorMSG = GUICtrlCreateButton("Set", 256, 269, 33, 19, 0)
GUICtrlSetOnEvent($Set_UnexpectedErrorMSG, "Set_UnexpectedErrorMSG")
GUICtrlCreateGraphic(10, 269, 25, 17)
GUICtrlSetBkColor(-1, $Color)
GUICtrlCreateGroup("", -99, -99, 1, 1)

Read("PrivateMessageSent")
GUICtrlCreateGroup("Private Message Sent", 0, 300, 313, 49)
GUICtrlCreateLabel("Color:", 40, 322, 31, 17)
GUICtrlCreateInput("" & $Color, 72, 319, 65, 19)
GUICtrlCreateLabel("X:", 144, 322, 14, 17)
GUICtrlCreateInput("" & $X, 160, 319, 33, 19)
GUICtrlCreateLabel("Y:", 200, 322, 14, 17)
GUICtrlCreateInput("" & $Y, 216, 319, 33, 19)
$Set_PrivateMessageSent = GUICtrlCreateButton("Set", 256, 319, 33, 19, 0)
GUICtrlSetOnEvent($Set_PrivateMessageSent, "Set_PrivateMessageSent")
GUICtrlCreateGraphic(10, 319, 25, 17)
GUICtrlSetBkColor(-1, $Color)
GUICtrlCreateGroup("", -99, -99, 1, 1)

Read("MaxSent")
GUICtrlCreateGroup("Max Sent", 0, 350, 313, 49)
GUICtrlCreateLabel("Color:", 40, 372, 31, 17)
GUICtrlCreateInput("" & $Color, 72, 369, 65, 19)
GUICtrlCreateLabel("X:", 144, 372, 14, 17)
GUICtrlCreateInput("" & $X, 160, 369, 33, 19)
GUICtrlCreateLabel("Y:", 200, 372, 14, 17)
GUICtrlCreateInput("" & $Y, 216, 369, 33, 19)
$Set_MaxSent = GUICtrlCreateButton("Set", 256, 369, 33, 19, 0)
GUICtrlSetOnEvent($Set_MaxSent, "Set_MaxSent")
GUICtrlCreateGraphic(10, 369, 25, 17)
GUICtrlSetBkColor(-1, $Color)
GUICtrlCreateGroup("", -99, -99, 1, 1)

Read("ServerBusy")
GUICtrlCreateGroup("Server Busy", 0, 400, 313, 49)
GUICtrlCreateLabel("Color:", 40, 422, 31, 17)
GUICtrlCreateInput("" & $Color, 72, 419, 65, 19)
GUICtrlCreateLabel("X:", 144, 422, 14, 17)
GUICtrlCreateInput("" & $X, 160, 419, 33, 19)
GUICtrlCreateLabel("Y:", 200, 422, 14, 17)
GUICtrlCreateInput("" & $Y, 216, 419, 33, 19)
$Set_ServerBusy = GUICtrlCreateButton("Set", 256, 419, 33, 19, 0)
GUICtrlSetOnEvent($Set_ServerBusy, "Set_ServerBusy")
GUICtrlCreateGraphic(10, 419, 25, 17)
GUICtrlSetBkColor(-1, $Color)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)


While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case Else
    ;;;;;;;
    EndSelect
WEnd

Func Set_CannotFindServer()
    Do
        If _IsPressed('31') Then
            GoWrite ("CannotFindServer")
        EndIf
        Sleep(100)
    Until _IsPressed('32')
EndFunc ;==>Set_ServerBusy

Func Set_ReLogin()
    Do
        If _IsPressed('31') Then
            GoWrite ("ReLogin")
        EndIf
        Sleep(100)
    Until _IsPressed('32')
EndFunc ;==>Set_ServerBusy

Func Set_SendMessageBox()
    Do
        If _IsPressed('31') Then
            GoWrite ("SendMessageBox")
        EndIf
        Sleep(100)
    Until _IsPressed('32')
EndFunc ;==>Set_ServerBusy

Func Set_NoPhoto()
    Do
        If _IsPressed('31') Then
            GoWrite ("NoPhoto")
        EndIf
        Sleep(100)
    Until _IsPressed('32')
EndFunc ;==>Set_ServerBusy

Func Set_MustBeHerFriend()
    Do
        If _IsPressed('31') Then
            GoWrite ("MustBeHerFriend")
        EndIf
        Sleep(100)
    Until _IsPressed('32')
EndFunc ;==>Set_ServerBusy

Func Set_UnexpectedErrorMSG()
    Do
        If _IsPressed('31') Then
            GoWrite ("UnexpectedErrorMSG")
        EndIf
        Sleep(100)
    Until _IsPressed('32')
EndFunc ;==>Set_ServerBusy

Func Set_PrivateMessageSent()
    Do
        If _IsPressed('31') Then
            GoWrite ("PrivateMessageSent")
        EndIf
        Sleep(100)
    Until _IsPressed('32')
EndFunc ;==>Set_ServerBusy

Func Set_MaxSent()
    Do
        If _IsPressed('31') Then
            GoWrite ("MaxSent")
        EndIf
        Sleep(100)
    Until _IsPressed('32')
EndFunc ;==>Set_ServerBusy


Func Set_ServerBusy()
    Do
        If _IsPressed('31') Then
            GoWrite ("ServerBusy")
            ToolTip("Set INI")
        EndIf
        Sleep(100)
    Until _IsPressed('32')
EndFunc ;==>Set_ServerBusy

Func Read($IniRead)
    Global $X = IniRead("Cords.INI", "PixelSettings", $IniRead & "PosX", "NotFound")
    Global $Y = IniRead("Cords.INI", "PixelSettings", $IniRead & "PosY", "NotFound")
    Global $Color = IniRead("Cords.INI", "PixelSettings", $IniRead & "Color", "NotFound")
EndFunc ;==>Read

Func GoWrite($IniInfo)
    $pos = MouseGetPos()
    $var = PixelGetColor($pos[0], $pos[1])
    IniWrite("Cords.INI", "PixelSettings", $IniInfo & "PosX", "" & $pos[0])
    IniWrite("Cords.INI", "PixelSettings", $IniInfo & "PosY", "" & $pos[1])
    IniWrite("Cords.INI", "PixelSettings", $IniInfo & "Color", $var)
EndFunc;==>GoWrite

Func _IsPressed($s_hexKey, $v_dll = 'user32.dll')
    Local $a_R = DllCall($v_dll, "int", "GetAsyncKeyState", "int", '0x' & $s_hexKey)
    If Not @error And BitAND($a_R[0], 0x8000) = 0x8000 Then Return 1
    Return 0
EndFunc ;==>_IsPressed

you click the SET button then press the 1 key to set the position and press 2 when your done with each. Is there a GUI refresh state ment?

Edited by blizzedout

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0