Jump to content

Recommended Posts

Posted

;) It has a nice hotkeyset(). The _ispressed can be expanded. Please try it out

#include <GUIConstants.au3>
#include <misc.au3>
$user32 = ""
$quickmsgs = 7;number of inputs and keys
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Quick Message", 307, 335, 193, 115)
$Button1 = GUICtrlCreateButton(StringUpper(IniRead( @ScriptDir & '\quickmsgdata.ini', 'Keys', '1', 'Set Key' )), 8, 26, 57, 31, 0)
$Button2 = GUICtrlCreateButton(StringUpper(IniRead( @ScriptDir & '\quickmsgdata.ini', 'Keys', '2', 'Set Key' )), 8, 66, 57, 31, 0)
$Button3 = GUICtrlCreateButton(StringUpper(IniRead( @ScriptDir & '\quickmsgdata.ini', 'Keys', '3', 'Set Key' )), 8, 106, 57, 31, 0)
$Button4 = GUICtrlCreateButton(StringUpper(IniRead( @ScriptDir & '\quickmsgdata.ini', 'Keys', '4', 'Set Key' )), 8, 146, 57, 31, 0)
$Button5 = GUICtrlCreateButton(StringUpper(IniRead( @ScriptDir & '\quickmsgdata.ini', 'Keys', '5', 'Set Key' )), 8, 186, 57, 31, 0)
$Button6 = GUICtrlCreateButton(StringUpper(IniRead( @ScriptDir & '\quickmsgdata.ini', 'Keys', '6', 'Set Key' )), 8, 226, 57, 31, 0)
$Button7 = GUICtrlCreateButton(StringUpper(IniRead( @ScriptDir & '\quickmsgdata.ini', 'Keys', '7', 'Set Key' )), 8, 266, 57, 31, 0)
$Label1 = GUICtrlCreateLabel("Hot Key", 8, 7, 58, 17, $SS_CENTER)
$Input1 = GUICtrlCreateInput(IniRead( @ScriptDir & '\quickmsgdata.ini', 'Messages', '1', 'Message Here' ), 72, 30, 225, 21)
$Input2 = GUICtrlCreateInput(IniRead( @ScriptDir & '\quickmsgdata.ini', 'Messages', '2', 'Message Here' ), 72, 70, 225, 21)
$Input3 = GUICtrlCreateInput(IniRead( @ScriptDir & '\quickmsgdata.ini', 'Messages', '3', 'Message Here' ), 72, 110, 225, 21)
$Input4 = GUICtrlCreateInput(IniRead( @ScriptDir & '\quickmsgdata.ini', 'Messages', '4', 'Message Here' ), 72, 150, 225, 21)
$Input5 = GUICtrlCreateInput(IniRead( @ScriptDir & '\quickmsgdata.ini', 'Messages', '5', 'Message Here' ), 72, 190, 225, 21)
$Input6 = GUICtrlCreateInput(IniRead( @ScriptDir & '\quickmsgdata.ini', 'Messages', '6', 'Message Here' ), 72, 230, 225, 21)
$Input7 = GUICtrlCreateInput(IniRead( @ScriptDir & '\quickmsgdata.ini', 'Messages', '7', 'Message Here' ), 72, 270, 225, 21)
$Label2 = GUICtrlCreateLabel("Message To Send", 72, 8, 227, 17, $SS_CENTER)
$Label3 = GUICtrlCreateLabel("Key to open message:", 8, 304, 109, 15, $SS_CENTER)
$Sendkey = GUICtrlCreateInput(IniRead( @ScriptDir & '\quickmsgdata.ini', 'Kendkey', 'Key', 'y' ), 120, 302, 17, 21)
$Save = GUICtrlCreateButton("Save Settings", 146, 301, 72, 25, 0)
$Started = False
$Start = GUICtrlCreateButton("Start", 226, 301, 72, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    If $nMsg = $GUI_EVENT_CLOSE Then Exit
    For $i = 1 To $quickmsgs
        If $nMsg = Eval( "Button" & $i ) Then
            SplashTextOn( "", "Press The To Set", 200, 50, -1, -1, -1, -1, 20 )
            GUISetState( @SW_DISABLE )
            GUICtrlSetData(Eval( "Button" & $i ), getkey())
            SplashOff()
            GUISetState( @SW_ENABLE )
        EndIf
    Next
    If $nMsg = $Save Then
        Save()
        MsgBox(0, "", "Saved!")
    EndIf
    If $nMsg = $Start Then start()
WEnd

Func Save()
    For $i = 1 To $quickmsgs
        IniWrite( @ScriptDir & '\quickmsgdata.ini', 'Keys', $i, StringLower(GUICtrlRead(Eval( "Button" & $i ))))
        IniWrite( @ScriptDir & '\quickmsgdata.ini', 'Messages', $i, GUICtrlRead(Eval( "Input" & $i )))
    Next
    IniWrite( @ScriptDir & '\quickmsgdata.ini', 'Kendkey', 'Key', GUICtrlRead( $Sendkey ))
EndFunc


Func getkey()
    While 1
        for $x = 2 to 7
            for $y = 0 to 15
                $key = hex($x, 1)&hex($y, 1)
                If _IsPressed($key) Then Return chr(dec($key))
            next
        next
    WEnd
EndFunc

Func start()
    If $Started = False Then
        GUICtrlSetData( $Start, "Stop" )
        $Started = True
    Else
        GUICtrlSetData( $Start, "Start" )
        $Started = False
    EndIf
    For $i = 1 To $quickmsgs
        $hotkey = IniRead( @ScriptDir & '\quickmsgdata.ini', 'Keys', $i, '' )
        If StringLen($hotkey) = 1 Then HotKeySet( $hotkey, "key" & $i )
    Next
EndFunc

Func key1()
    $temp = ClipGet()
    ClipPut(IniRead( @ScriptDir & '\quickmsgdata.ini', 'Messages', 1, '' ))
    Send( GUICtrlRead( $Sendkey ) & "^v{Enter}" )
    ClipPut( $temp )
EndFunc
Func key2()
    $temp = ClipGet()
    ClipPut(IniRead( @ScriptDir & '\quickmsgdata.ini', 'Messages', 2, '' ))
    Send( GUICtrlRead( $Sendkey ) & "^v{Enter}" )
    ClipPut( $temp )    
EndFunc
Func key3()
    $temp = ClipGet()
    ClipPut(IniRead( @ScriptDir & '\quickmsgdata.ini', 'Messages', 3, '' ))
    Send( GUICtrlRead( $Sendkey ) & "^v{Enter}" )
    ClipPut( $temp )
EndFunc
Func key4()
    $temp = ClipGet()
    ClipPut(IniRead( @ScriptDir & '\quickmsgdata.ini', 'Messages', 4, '' ))
    Send( GUICtrlRead( $Sendkey ) & "^v{Enter}" )
    ClipPut( $temp )
EndFunc
Func key5()
    $temp = ClipGet()
    ClipPut(IniRead( @ScriptDir & '\quickmsgdata.ini', 'Messages', 5, '' ))
    Send( GUICtrlRead( $Sendkey ) & "^v{Enter}" )
    ClipPut( $temp )
EndFunc
Func key6()
    $temp = ClipGet()
    ClipPut(IniRead( @ScriptDir & '\quickmsgdata.ini', 'Messages', 6, '' ))
    Send( GUICtrlRead( $Sendkey ) & "^v{Enter}" )
    ClipPut( $temp )
EndFunc
Func key7()
    $temp = ClipGet()
    ClipPut(IniRead( @ScriptDir & '\quickmsgdata.ini', 'Messages', 7, '' ))
    Send( GUICtrlRead( $Sendkey ) & "^v{Enter}" )
    ClipPut( $temp )
EndFunc

Sample INI

CODE
[Keys]

1=1

2=2

[Messages]

1=My Steam ID: zerocool6900

2=Check out www.CyberZeroCool.com

3=sdgasfdg

[Kendkey]

Key=y

Check out ConsultingJoe.com
Posted

I havnt tested it yet, but hey i play steam too, Xerobladexhxf is my steam ID.... i can use some of this script like the set your own hotkey, Very nice function!, ive been meaning to make something like this, no need to now!

tolle indicium

Posted

I wont be on steam for a week or so, my computer here is dial-up so i'de have to install update and all that crap, so im gonna wait it out and bring the hard drive here form the other place.

tolle indicium

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...