Sign in to follow this  
Followers 0
BoD

Simple Problem (not sure how to explain)

5 posts in this topic

#1 ·  Posted (edited)

Hey

I am very bad at coding, i have just modified code i found on this site

()

My code is this

#cs ----------------------------------------------------------------------------

 Author:         Aaron Marsh (modifed by BoD)

 Script:        Sets the F9 Key to a word

#ce ----------------------------------------------------------------------------
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <ButtonConstants.au3>
#include <WindowsConstants.au3>
#NoTrayIcon

Local $getword
;Function
HotKeySet("{f9}", "capturef9")
Func capturef9()
    HotKeySet("{f9}")
    Send($getword)
    HotKeySet("{f9}", "capturef9")
EndFunc

HotKeySet("+!9", "menuf9")
Func menuf9()
    HotKeySet("+!9")
$form = GuiSetState(@SW_SHOW)
    HotKeySet("+!9", "menuf9")
EndFunc

;Gui
$form = GUICreate("Main Menu", 430, 364, 677, 324)

$title = GUICtrlCreateLabel("Choose an item to assign to F9", 16, 24, 394, 22)
GUICtrlSetFont(-1, 12, 400, 0, "Courier New")

$checkbox1 = GUICtrlCreateCheckbox("Armor + Sword", 48, 72, 153, 17)
GUICtrlSetFont(-1, 12, 400, 0, "Courier New")

$checkbox2 = GUICtrlCreateCheckbox("Tools", 48, 104, 169, 17)
GUICtrlSetFont(-1, 12, 400, 0, "Courier New")

$checkbox3 = GUICtrlCreateCheckbox("Minecart", 48, 136, 193, 17)
GUICtrlSetFont(-1, 12, 400, 0, "Courier New")

$checkbox4 = GUICtrlCreateCheckbox("Torches", 48, 168, 193, 17)
GUICtrlSetFont(-1, 12, 400, 0, "Courier New")

$checkbox5 = GUICtrlCreateCheckbox("Glass", 48, 200, 193, 17)
GUICtrlSetFont(-1, 12, 400, 0, "Courier New")

$checkbox6 = GUICtrlCreateCheckbox("Tracks", 48, 232, 193, 17)
GUICtrlSetFont(-1, 12, 400, 0, "Courier New")


$setbutton = GUICtrlCreateButton("Set", 76, 294, 81, 33, $WS_GROUP)
$closebutton = GUICtrlCreateButton("Close", 172, 294, 81, 33, $WS_GROUP)
$quitbutton = GUICtrlCreateButton("Quit", 268, 294, 81, 33, $WS_GROUP)

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
$form = GuiSetState(@SW_HIDE)
EndSwitch
Select
    Case $nMsg = $setbutton
            If GUICtrlRead($checkbox1) = $GUI_CHECKED Then
            $getword = "t/give $bod 310 1{ENTER}111111111111111t/give bod 311 1{ENTER}111111111111111t/give bod 312 1{ENTER}111111111111111t/give bod 313 1{ENTER}111111111111111t/give bod 276 1{ENTER}"
TrayTip("", "F9 has been set to " & $getword, 5)
EndIf

If GUICtrlRead($checkbox2) = $GUI_CHECKED Then
            $getword = "t/give bod 277 1{ENTER}111111111111111t/give bod 278 1{ENTER}111111111111111t/give bod 279 1{ENTER}"
TrayTip("", "F9 has been set to " & $getword, 5)
EndIf

If GUICtrlRead($checkbox3) = $GUI_CHECKED Then
            $getword = "t/give bod 328 1{ENTER}"
TrayTip("", "F9 has been set to " & $getword, 5)
EndIf

If GUICtrlRead($checkbox4) = $GUI_CHECKED Then
            $getword = "t/give bod 50 64{ENTER}"
TrayTip("", "F9 has been set to " & $getword, 5)
EndIf

If GUICtrlRead($checkbox5) = $GUI_CHECKED Then
            $getword = "t/give bod 20 64{ENTER}"
TrayTip("", "F9 has been set to " & $getword, 5)
EndIf

If GUICtrlRead($checkbox6) = $GUI_CHECKED Then
            $getword = "t/give bod 66 64{ENTER}"
TrayTip("", "F9 has been set to " & $getword, 5)
EndIf

    Case $nMsg = $closebutton
        $form = GuiSetState(@SW_HIDE)

    Case $nMsg = $quitbutton
            Exit
EndSelect

WEnd

Basically, if i have 2 boxes checked, i want it to do one then the other.

Also, for

send ("blah blah blah")

How would i make that send multi lined

the 111111111111111 is just for a short delay, im sure there is a better way to do it then that

Thanks

BoD

edit: this is for a game, but it just makes my life easier then typing things out over and over, doesn't actually give any advantage then a time saver

Edited by BoD

Share this post


Link to post
Share on other sites



Hi and Welcome to the forums!

We can't help you with this, see the announcement about game automation.

Fair enough

Thanks any way

Its too late now, but if i rephrased it as server administration would that have helped?

Share this post


Link to post
Share on other sites

Fair enough

Thanks any way

Its too late now, but if i rephrased it as server administration would that have helped?

Like a game-server? Don't know. Maybe. I answered your question in the other thread.

Share this post


Link to post
Share on other sites

Like a game-server? Don't know. Maybe. I answered your question in the other thread.

Thanks heaps for that by the way.

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