Jump to content

AHK user looking to convert


 Share

Recommended Posts

thanks again robjong that worked out nicely does this look right?

If IsChecked($Maxx_Boost) Then $Maxx_Boost_value = '1'
IniWrite('settings.ini', $car, '$Maxx_Boost',$Maxx_Boost_value)

its for the save function, it was working and writing to the ini file then all of a sudden it stopped and keeps coming up with an unknown function

Link to comment
Share on other sites

figured id post the entire script so far

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Global $A_Space = " " ; used as default value for the IniRead's in _CarSelect
Global $Windows = "" ; holds window titles for the combo, get updated in _UpdateWindowList
#Region - Main GUI
$Form1 = GUICreate("Seths - Desktop v1.001", 281, 293, 206, 131)
$Window = GUICtrlCreateCombo("", 8, 8, 177, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL,$CBS_UPPERCASE))
$Save = GUICtrlCreateButton("Save", 216, 48, 57, 25)
$Name1 = GUICtrlCreateLabel("Car Select", 8, 32, 53, 17)
$CarSelect = GUICtrlCreateCombo("", 8, 48, 129, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "07 Stang|RSX|C6")
$Label1 = GUICtrlCreateLabel("2-Step", 152, 32, 35, 17)
$MaxBoost = GUICtrlCreateInput("", 152, 48, 57, 21)
$Update = GUICtrlCreateButton("Update", 200, 8, 75, 25)
$Bracket = GUICtrlCreateGroup("Bracket", 8, 72, 129, 65)
$Maxx_Boost = GUICtrlCreateCheckbox("Maxx Boost", 16, 88, 97, 17)
$Label7 = GUICtrlCreateLabel("Dial-In", 16, 112, 34, 17)
$Dial_In = GUICtrlCreateInput("", 64, 112, 65, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$H2H = GUICtrlCreateGroup("H2H", 8, 136, 129, 89)
$Roll_Start = GUICtrlCreateCheckbox("Roll Start", 16, 176, 97, 17)
$Delayt = GUICtrlCreateLabel("Delay", 16, 200, 31, 17)
$Delay = GUICtrlCreateInput("", 64, 200, 65, 21)
$Brake_N_G0 = GUICtrlCreateCheckbox("Brake N Go", 16, 152, 97, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Gears = GUICtrlCreateGroup("Gears", 152, 72, 121, 153)
$Start_Shift = GUICtrlCreateCheckbox("Start Shift", 160, 88, 97, 17)
$Label2 = GUICtrlCreateLabel("2nd", 160, 104, 22, 17)
$second = GUICtrlCreateInput("", 192, 104, 57, 21)
$Label3 = GUICtrlCreateLabel("3rd", 160, 128, 19, 17)
$third = GUICtrlCreateInput("", 192, 128, 57, 21)
$Label4 = GUICtrlCreateLabel("4th", 160, 152, 19, 17)
$fourth = GUICtrlCreateInput("", 192, 152, 57, 21)
$Label5 = GUICtrlCreateLabel("5th", 160, 176, 19, 17)
$fifth = GUICtrlCreateInput("", 192, 176, 57, 21)
$Label6 = GUICtrlCreateLabel("6th", 160, 200, 19, 17)
$sixth = GUICtrlCreateInput("", 192, 200, 57, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Tournament = GUICtrlCreateGroup("Tournament", 8, 224, 265, 57)
$Amature = GUICtrlCreateRadio("Amature", 16, 240, 65, 17)
$Pro = GUICtrlCreateRadio("Pro", 16, 256, 57, 17)
$Label8 = GUICtrlCreateLabel("# of Races", 104, 232, 57, 17)
$RaceCount = GUICtrlCreateInput("", 104, 248, 57, 21)
$Start = GUICtrlCreateButton("Start", 184, 248, 75, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion - Main GUI
;########################################################################################################
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
  Exit
Case $Update ; update button was pressed
_UpdateWindowList() ; update the combo
Case $CarSelect
CarLoad()
Case $Save
Save()
EndSwitch
WEnd
;########################################################################################################
Func _UpdateWindowList()
    Local $restore_datasep = AutoItSetOption("GUIDataSeparatorChar", @LF) ; to avoid titles with a | in them getting split, we change the data sepatator char
    Local $aWinList = WinList()
GUICtrlSetData($Window, "") ; empty the combo
    $Windows = "" ; this is a global variable, so we need to reset it
    For $i = 1 To $aWinList[0][0]
        If $aWinList[$i][0] <> "" And BitAND(WinGetState($aWinList[$i][1]), 2) Then
            $Windows &= $aWinList[$i][0] & @LF
        EndIf
    Next
    $Windows = StringTrimRight($Windows, 1) ; strip trailing @LF
    GUICtrlSetData($Window, $Windows)
    AutoItSetOption("GUIDataSeparatorChar", $restore_datasep) ; restore data sepatator character
EndFunc
;########################################################################################################
Func CarLoad()
$car = GUICtrlRead($CarSelect)
$Maxx_Boost_value = IniRead('settings.ini', $car, '$Maxx_Boost','')
If $Maxx_Boost_value = '1' Then
GUICtrlSetState($Maxx_Boost, $GUI_CHECKED)
Else
GUICtrlSetState($Maxx_Boost, $GUI_UNCHECKED)
EndIf
$Dial_In_value = IniRead('settings.ini', $car, '$DialIn','')
GUICtrlSetData($Dial_In, $Dial_In_value)
$MaxBoost_value = IniRead('settings.ini', $car, '$MaxBoost','')
GUICtrlSetData($MaxBoost, $MaxBoost_value)
$Brake_N_G0_value = Iniread('settings.ini', $car, '$Brake_N_G0','')
If $Brake_N_G0_value = '1' Then
GUICtrlSetState($Brake_N_G0, $GUI_CHECKED)
Else
GUICtrlSetState($Brake_N_G0, $GUI_UNCHECKED)
EndIf
$Roll_Start_value = IniRead('settings.ini', $car, '$Roll_Start','')
If $Roll_Start_value = '1' Then
GUICtrlSetState($Roll_Start, $GUI_CHECKED)
Else
GUICtrlSetState($Roll_Start, $GUI_UNCHECKED)
EndIf
$Delay_value = IniRead('settings.ini', $car, '$Delay','')
GUICtrlSetData($Delay, $Delay_value)
$Start_Shift_value = IniRead('settings.ini', $car, '$Start_Shift','')
If $Start_Shift_value = '1' Then
GUICtrlSetState($Start_Shift, $GUI_CHECKED)
Else
GUICtrlSetState($Start_Shift, $GUI_UNCHECKED)
EndIf
$second_value = IniRead('settings.ini', $car, '$second','')
GUICtrlSetData($second, $second_value)
$third_value = IniRead('settings.ini', $car, '$third','')
GUICtrlSetData($third, $third_value)
$fourth_value = IniRead('settings.ini', $car, '$fourth','')
GUICtrlSetData($fourth, $fourth_value)
$fifth_value = IniRead('settings.ini', $car, '$fifth','')
GUICtrlSetData($fifth, $fifth_value)
$sixth_value = IniRead('settings.ini', $car, '$sixth','')
GUICtrlSetData($sixth, $sixth_value)
EndFunc
;########################################################################################################
Func Save()
Local $Maxx_Boost_value = '0'
$car = GUICtrlRead($CarSelect)
If IsChecked($Maxx_Boost) Then $Maxx_Boost_value = '1'
IniWrite('settings.ini', $car, '$Maxx_Boost',$Maxx_Boost_value)
$Dial_In_value = GUICtrlRead($Dial_In)
IniWrite('settings.ini', $car, '$DialIn',$Dial_In_value)
$MaxBoost_value = GUICtrlRead($MaxBoost)
IniWrite('settings.ini', $car, '$MaxBoost',$MaxBoost_value)
Local $Brake_N_G0_value = '0'
If IsChecked($Brake_N_G0) Then $Brake_N_G0_value = '1'
IniWrite('settings.ini', $car, '$Brake_N_G0',$Brake_N_G0_value)
Local $Roll_Start_value = '0'
If IsChecked($Roll_Start) Then $Roll_Start_value = '1'
IniWrite('settings.ini', $car, '$Roll_Start',$Roll_Start_value)
$Delay_value = GUICtrlRead($Delay)
IniWrite('settings.ini', $car, '$Delay',$Delay_value)
Local $Start_Shift_value = '0'
If IsChecked($Start_Shift) Then $Start_Shift_value = '1'
IniWrite('settings.ini', $car, '$Start_Shift',$Start_Shift_value)
$second_value = GUICtrlRead($second)
IniWrite('settings.ini', $car, '$second',$second_value)
$third_value = GUICtrlRead($third)
IniWrite('settings.ini', $car, '$third',$third_value)
$fourth_value = GUICtrlRead($fourth)
IniWrite('settings.ini', $car, '$fourth',$fourth_value)
$fifth_value = GUICtrlRead($fifth)
IniWrite('settings.ini', $car, '$fifth',$fifth_value)
$sixth_value = GUICtrlRead($sixth)
IniWrite('settings.ini', $car, '$sixth',$sixth_value)
EndFunc
#cs
NOTES:
#ce
Link to comment
Share on other sites

lol thank you rob i have been reading all the help files and didnt check back here this is what i wrote

If BitAND (GUICtrlRead($Roll_Start), $GUI_CHECKED) Then $Roll_Start_value = '1'
IniWrite('settings.ini', $car, '$Roll_Start',$Roll_Start_value)

i should have just checked here, it was wierd the ischecked worked at first then all of a sudden nothing

Link to comment
Share on other sites

Melba23, I understand what you are saying. However, the key phrase is exactly what you said: DO NOT DISCUSS. Why not? If a user is not arguing and is seeking answers from moderators (I don't take the word of regular users - only moderators or MVPs such as yourself), then why is it so bad to ask a question?

I think discussing subjects like this is better than an iron hand that says "shut up or you will get punished".

When it comes to games... have you read the rules? I actually bothered to provide the rationale why the game automation rule is so draconian. I suggest you read it. I also suggest you give the benefit of the doubt to the people who've been running this forum for the the past 8 years or so. Maybe... just maybe... we know what the fuck we're doing and if we make a decision on something there's a pretty good chance we're right.

Sometimes, the rules are not crystal clear to every person on the planet and they need to be elaborated a bit to be fully understood.

The only people who don't understand the game automation rule are idiots. It's dead simple. Do not discuss game automation. There's no ambiguity in that. There's no room for failure to understand. If you wish to talk about automating a game you are in the wrong place. Full stop.

I hope I don't cause too much unrest. I'm just stating my true feelings.

Your "true" feelings are not truth at all. As Melba has already pointed out your perspective on why and how you were banned was entirely fabricated. If that is how you view the situation then your true feelings are nothing more than convenient lies (perhaps to yourself as much as anybody). To the rest of us we know what the truth of the matter is.

The game rules are bs even if they are simple and needed.

My opinion is irrelevant and it's not my given right to be a member of the forums, it's a privilege which can be revoked at any time.

Yeah I'm an "enthusiastically stupid user wishes to challenge the status quo", so revoke my privilege permanently please.

As I can't beat it and I don't want to bow to it and I'm definitely not joining it.

Farewell.

You cannot simultaneously call a rule bullshit and state that is is needed. Rules labeled as bullshit tend to be unnecessary. You basically invalidated the rest of your post even before your little tantrum.

I'm also amused that you would punish yourself based on nothing more than principle. I love principles. It's fun to see what sort of asinine behavior people will go to over arbitrarily drawn lines in the sand. It's people like you with your absurd principles that make me really think the Assassins had it figured out nearly a millennia ago: "Nothing is true, everything is permitted".

Link to comment
Share on other sites

I didnt mean to start such a dramatic thread, the first one I started was completely correct in being banned. I honestly didnt read the rules i just click through that crap :) thank you valik for allowing the loosely slack given here and understand where your coming from. by the way I have learned so much and there is nothing more i can post here that wont get lost in the drama if you want to lock this you are more than welcome.

Link to comment
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
 Share

  • Recently Browsing   0 members

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