bagohan Posted July 7, 2008 Share Posted July 7, 2008 anyone can check my script..... i got error in _start... but i think its correct but please check it and correct me if im wrong thanx in advance............. expandcollapse popup#include <file.au3> #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Global $ListView1, $Combo1, $Combo2, $Combo3, $Combo4, $Combo5, $Combo6, $sItems, $Profile $ProfileDirectory = @ScriptDir & "\PriceSettings" Opt("GUIOnEventMode", 1) GUICreate("AutoSell", 195, 564, 193, 115) GUISetIcon("C:\Program Files\GameHI\Dekaron\ATTOBOT\dekaron.ico") GUISetCursor (2) GUISetBkColor(0xA6CAF0) GUICtrlCreatePic("C:\Program Files\GameHI\Dekaron\ATTOBOT\dekaron.jpg", 0, 0, 193, 113, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) GUICtrlCreateGroup("PriceSettings", 0, 280, 193, 169) $Combo1 = GUICtrlCreateCombo("", 48, 296, 137, 25) GUICtrlSetData(-1, "90000|100000|150000|200000|250000|300000|350000|400000|450000|500000|550000|600000|650000|700000 |750000|800000|850000|900000|950000|1000000|1100000|1200000|1300000|1400000|1500000|1600000|1700000| 1800000|1900000|2000000||") GUICtrlCreateLabel("Item1", 8, 304, 30, 17) $Combo2 = GUICtrlCreateCombo("", 48, 320, 137, 25) GUICtrlSetData(-1, "90000|100000|150000|200000|250000|300000|350000|400000|450000|500000|550000|600000|650000|700000 |750000|800000|850000|900000|950000|1000000|1100000|1200000|1300000|1400000|1500000|1600000|1700000| 1800000|1900000|2000000") GUICtrlCreateLabel("Item2", 8, 304, 30, 17) $Combo3 = GUICtrlCreateCombo("", 48, 344, 137, 25) GUICtrlSetData(-1, "90000|100000|150000|200000|250000|300000|350000|400000|450000|500000|550000|600000|650000|700000 |750000|800000|850000|900000|950000|1000000|1100000|1200000|1300000|1400000|1500000|1600000|1700000| 1800000|1900000|2000000") GUICtrlCreateLabel("Item3", 8, 304, 30, 17) $Combo4 = GUICtrlCreateCombo("", 48, 368, 137, 25) GUICtrlSetData(-1, "90000|100000|150000|200000|250000|300000|350000|400000|450000|500000|550000|600000|650000|700000 |750000|800000|850000|900000|950000|1000000|1100000|1200000|1300000|1400000|1500000|1600000|1700000| 1800000|1900000|2000000") GUICtrlCreateLabel("Item4", 8, 304, 30, 17) $Combo5 = GUICtrlCreateCombo("", 48, 392, 137, 25) GUICtrlSetData(-1, "90000|100000|150000|200000|250000|300000|350000|400000|450000|500000|550000|600000|650000|700000 |750000|800000|850000|900000|950000|1000000|1100000|1200000|1300000|1400000|1500000|1600000|1700000| 1800000|1900000|2000000") GUICtrlCreateLabel("Item5", 8, 304, 30, 17) $Combo6 = GUICtrlCreateCombo("", 48, 416, 137, 25) GUICtrlSetData(-1, "90000|100000|150000|200000|250000|300000|350000|400000|450000|500000|550000|600000|650000|700000 |750000|800000|850000|900000|950000|1000000|1100000|1200000|1300000|1400000|1500000|1600000|1700000| 1800000|1900000|2000000") GUICtrlCreateLabel("Item6", 8, 304, 30, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateButton("StartSell", 8, 456, 83, 25, 0) GUICtrlSetOnEvent(-1 "_StartSell") GUICtrlCreateButton("RemoveItems", 104, 456, 83, 25, 0) GUICtrlSetOnEvent(-1 "_Remove") GUICtrlCreateButton("SAVE", 0, 488, 193, 33, 0) GUICtrlSetOnEvent(-1 "_Profile") GUICtrlSetFont(-1, 12, 800, 0, "Courier New") GUICtrlCreateButton("EXIT", 0, 528, 193, 33, 0) GUICtrlSetOnEvent(-1 "_EXIT") $ListView1 = GUICtrlCreateListView("", 0, 120, 193, 161) GUICtrlSetOnEvent(-1, "_LoadProfile") _GenerateList($ListView1, $ProfileDirectory) GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func _GenerateList($hListToUse, $vDirectoryToSearch) $aFileList = _FileListToArray($vDirectoryToSearch, "*.ini") For $i = 1 To UBound($aFileList) -1 GUICtrlSetData($hListToUse, $aFileList[$i]) Next EndFunc Func _LoadProfile() $aItems = _GUICtrlListBox_GetSelItemsText($ListView1) For $iI = 1 To $aItems[0] $sItems &= $aItems[$iI]) Next $Yourini = @ScriptDir & "\PriceSettings\" & $sItems GUICtrlSetData($Combo1, IniRead($YourIni, "Prices", "Item1", "")) GUICtrlSetData($Combo2, IniRead($YourIni, "Prices", "Item2", "")) GUICtrlSetData($Combo3, IniRead($YourIni, "Prices", "Item3", "")) GUICtrlSetData($Combo4, IniRead($YourIni, "Prices", "Item4", "")) GUICtrlSetData($Combo5, IniRead($YourIni, "Prices", "Item5", "")) GUICtrlSetData($Combo6, IniRead($YourIni, "Prices", "Item6", "")) EndFunc Func _StartSell() EndFunc Func _Remove() EndFunc Func _Profile() GUICreate("PriceSettings", 195, 140, 193, 125) GUICtrlCreateLabel("SettingsName:", 40, 24, 114, 20) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $Profile = GUICtrlCreateInput("", 24, 56, 145, 21) GUICtrlCreateButton("Save", 96, 96, 75, 25, 0) GUICtrlSetOnEvent(-1, "_Save") GUISetState(@SW_SHOW) EndFunc Func _Save() GUIDelete("") $temp = GUICtrlRead($Profile) $name = @ScriptDir & "\PriceSettings\" & $temp & ".ini" IniWrite($name, "Prices", "Item1", GUICtrlRead($Combo1)) IniWrite($name, "Prices", "Item2", GUICtrlRead($Combo2)) IniWrite($name, "Prices", "Item3", GUICtrlRead($Combo3)) IniWrite($name, "Prices", "Item4", GUICtrlRead($Combo4)) IniWrite($name, "Prices", "Item5", GUICtrlRead($Combo5)) IniWrite($name, "Prices", "Item6", GUICtrlRead($Combo6)) _GenerateList($ListView1, $ProfileDirectory) EndFunc Func _Exit() Exit EndFunc Link to comment Share on other sites More sharing options...
martin Posted July 7, 2008 Share Posted July 7, 2008 (edited) expandcollapse popup#include <file.au3> #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <guilistbox.au3> Global $ListView1, $Combo1, $Combo2, $Combo3, $Combo4, $Combo5, $Combo6, $sItems, $Profile $ProfileDirectory = @ScriptDir & "\PriceSettings" Opt("GUIOnEventMode", 1) GUICreate("AutoSell", 195, 564, 193, 115) GUISetIcon("C:\Program Files\GameHI\Dekaron\ATTOBOT\dekaron.ico") GUISetCursor (2) GUISetBkColor(0xA6CAF0) GUICtrlCreatePic("C:\Program Files\GameHI\Dekaron\ATTOBOT\dekaron.jpg", 0, 0, 193, 113, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) GUICtrlCreateGroup("PriceSettings", 0, 280, 193, 169) $Combo1 = GUICtrlCreateCombo("", 48, 296, 137, 25) GUICtrlSetData(-1, "90000|100000|150000|200000|250000|300000|350000|400000|450000|500000|550000|600000|650000|700000 |750000|800000|850000|900000|950000|1000000|1100000|1200000|1300000|1400000|1500000|1600000|1700000| 1800000|1900000|2000000||") GUICtrlCreateLabel("Item1", 8, 304, 30, 17) $Combo2 = GUICtrlCreateCombo("", 48, 320, 137, 25) GUICtrlSetData(-1, "90000|100000|150000|200000|250000|300000|350000|400000|450000|500000|550000|600000|650000|700000 |750000|800000|850000|900000|950000|1000000|1100000|1200000|1300000|1400000|1500000|1600000|1700000| 1800000|1900000|2000000") GUICtrlCreateLabel("Item2", 8, 304, 30, 17) $Combo3 = GUICtrlCreateCombo("", 48, 344, 137, 25) GUICtrlSetData(-1, "90000|100000|150000|200000|250000|300000|350000|400000|450000|500000|550000|600000|650000|700000 |750000|800000|850000|900000|950000|1000000|1100000|1200000|1300000|1400000|1500000|1600000|1700000| 1800000|1900000|2000000") GUICtrlCreateLabel("Item3", 8, 304, 30, 17) $Combo4 = GUICtrlCreateCombo("", 48, 368, 137, 25) GUICtrlSetData(-1, "90000|100000|150000|200000|250000|300000|350000|400000|450000|500000|550000|600000|650000|700000 |750000|800000|850000|900000|950000|1000000|1100000|1200000|1300000|1400000|1500000|1600000|1700000| 1800000|1900000|2000000") GUICtrlCreateLabel("Item4", 8, 304, 30, 17) $Combo5 = GUICtrlCreateCombo("", 48, 392, 137, 25) GUICtrlSetData(-1, "90000|100000|150000|200000|250000|300000|350000|400000|450000|500000|550000|600000|650000|700000 |750000|800000|850000|900000|950000|1000000|1100000|1200000|1300000|1400000|1500000|1600000|1700000| 1800000|1900000|2000000") GUICtrlCreateLabel("Item5", 8, 304, 30, 17) $Combo6 = GUICtrlCreateCombo("", 48, 416, 137, 25) GUICtrlSetData(-1, "90000|100000|150000|200000|250000|300000|350000|400000|450000|500000|550000|600000|650000|700000 |750000|800000|850000|900000|950000|1000000|1100000|1200000|1300000|1400000|1500000|1600000|1700000| 1800000|1900000|2000000") GUICtrlCreateLabel("Item6", 8, 304, 30, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateButton("StartSell", 8, 456, 83, 25, 0) GUICtrlSetOnEvent(-1 ,"_StartSell") GUICtrlCreateButton("RemoveItems", 104, 456, 83, 25, 0) GUICtrlSetOnEvent(-1, "_Remove") GUICtrlCreateButton("SAVE", 0, 488, 193, 33, 0) GUICtrlSetOnEvent(-1, "_Profile") GUICtrlSetFont(-1, 12, 800, 0, "Courier New") GUICtrlCreateButton("EXIT", 0, 528, 193, 33, 0) GUICtrlSetOnEvent(-1, "_EXIT") $ListView1 = GUICtrlCreateListView("", 0, 120, 193, 161) GUICtrlSetOnEvent(-1, "_LoadProfile") _GenerateList($ListView1, $ProfileDirectory) GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func _GenerateList($hListToUse, $vDirectoryToSearch) $aFileList = _FileListToArray($vDirectoryToSearch, "*.ini") For $i = 1 To UBound($aFileList) -1 GUICtrlSetData($hListToUse, $aFileList[$i]) Next EndFunc Func _LoadProfile() $aItems = _GUICtrlListBox_GetSelItemsText($ListView1) For $iI = 1 To $aItems[0] $sItems &= $aItems[$iI] Next $Yourini = @ScriptDir & "\PriceSettings\" & $sItems GUICtrlSetData($Combo1, IniRead($YourIni, "Prices", "Item1", "")) GUICtrlSetData($Combo2, IniRead($YourIni, "Prices", "Item2", "")) GUICtrlSetData($Combo3, IniRead($YourIni, "Prices", "Item3", "")) GUICtrlSetData($Combo4, IniRead($YourIni, "Prices", "Item4", "")) GUICtrlSetData($Combo5, IniRead($YourIni, "Prices", "Item5", "")) GUICtrlSetData($Combo6, IniRead($YourIni, "Prices", "Item6", "")) EndFunc Func _StartSell() EndFunc Func _Remove() EndFunc Func _Profile() GUICreate("PriceSettings", 195, 140, 193, 125) GUICtrlCreateLabel("SettingsName:", 40, 24, 114, 20) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $Profile = GUICtrlCreateInput("", 24, 56, 145, 21) GUICtrlCreateButton("Save", 96, 96, 75, 25, 0) GUICtrlSetOnEvent(-1, "_Save") GUISetState(@SW_SHOW) EndFunc Func _Save() GUIDelete("") $temp = GUICtrlRead($Profile) $name = @ScriptDir & "\PriceSettings\" & $temp & ".ini" IniWrite($name, "Prices", "Item1", GUICtrlRead($Combo1)) IniWrite($name, "Prices", "Item2", GUICtrlRead($Combo2)) IniWrite($name, "Prices", "Item3", GUICtrlRead($Combo3)) IniWrite($name, "Prices", "Item4", GUICtrlRead($Combo4)) IniWrite($name, "Prices", "Item5", GUICtrlRead($Combo5)) IniWrite($name, "Prices", "Item6", GUICtrlRead($Combo6)) _GenerateList($ListView1, $ProfileDirectory) EndFunc Func _Exit() Exit EndFunc You should install SciTE. There are errors which you would have been able to find easily. The GuiSetOnEvent lines have commas missing between parameters, there is an unnecessary closing bracket on one line and an unknown function because you need to add #include <guilistbox.au3> Edited July 7, 2008 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
bagohan Posted July 7, 2008 Author Share Posted July 7, 2008 thanx for that.. anyway i got still error the info i want suppose to save cant save... maybe you can fix it... coz im really confused now i dont know why its not working... thanx again... muttley Link to comment Share on other sites More sharing options...
bagohan Posted July 7, 2008 Author Share Posted July 7, 2008 anyway i got solved how to save it in ini but everytime... i save it an error occured like error in function.... heres my script........ expandcollapse popup#include <file.au3> #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Guilistbox.au3> Global $ListView1, $Combo1, $Combo2, $Combo3, $Combo4, $Combo5, $Combo6, $sItems, $Profile, $YourIni $Loaded = 0 $ProfileDirectory = @ScriptDir & "\PriceSettings" $extension = ".ini" DirCreate($ProfileDirectory) Opt("GUIOnEventMode", 1) GUICreate("AutoSell", 195, 564, 193, 115) GUISetIcon("C:\Program Files\GameHI\Dekaron\ATTOBOT\dekaron.ico") GUISetCursor (2) GUISetBkColor(0xA6CAF0) GUICtrlCreatePic("C:\Program Files\GameHI\Dekaron\ATTOBOT\dekaron.jpg", 0, 0, 193, 113, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) GUICtrlCreateGroup("PriceSettings", 0, 280, 193, 169) $Combo1 = GUICtrlCreateCombo("", 48, 296, 137, 25) GUICtrlSetData(-1, "90000|100000|150000|200000|250000|300000|350000|400000|450000|500000|550000|600000|650000|700000 |750000|800000|850000|900000|950000|1000000|1100000|1200000|1300000|1400000|1500000|1600000|1700000| 1800000|1900000|2000000||") GUICtrlCreateLabel("Item1", 8, 304, 30, 17) $Combo2 = GUICtrlCreateCombo("", 48, 320, 137, 25) GUICtrlSetData(-1, "90000|100000|150000|200000|250000|300000|350000|400000|450000|500000|550000|600000|650000|700000 |750000|800000|850000|900000|950000|1000000|1100000|1200000|1300000|1400000|1500000|1600000|1700000| 1800000|1900000|2000000") GUICtrlCreateLabel("Item2", 8, 328, 30, 17) $Combo3 = GUICtrlCreateCombo("", 48, 344, 137, 25) GUICtrlSetData(-1, "90000|100000|150000|200000|250000|300000|350000|400000|450000|500000|550000|600000|650000|700000 |750000|800000|850000|900000|950000|1000000|1100000|1200000|1300000|1400000|1500000|1600000|1700000| 1800000|1900000|2000000") GUICtrlCreateLabel("Item3", 8, 352, 30, 17) $Combo4 = GUICtrlCreateCombo("", 48, 368, 137, 25) GUICtrlSetData(-1, "90000|100000|150000|200000|250000|300000|350000|400000|450000|500000|550000|600000|650000|700000 |750000|800000|850000|900000|950000|1000000|1100000|1200000|1300000|1400000|1500000|1600000|1700000| 1800000|1900000|2000000") GUICtrlCreateLabel("Item4", 8, 376, 30, 17) $Combo5 = GUICtrlCreateCombo("", 48, 392, 137, 25) GUICtrlSetData(-1, "90000|100000|150000|200000|250000|300000|350000|400000|450000|500000|550000|600000|650000|700000 |750000|800000|850000|900000|950000|1000000|1100000|1200000|1300000|1400000|1500000|1600000|1700000| 1800000|1900000|2000000") GUICtrlCreateLabel("Item5", 8, 400, 30, 17) $Combo6 = GUICtrlCreateCombo("", 48, 416, 137, 25) GUICtrlSetData(-1, "90000|100000|150000|200000|250000|300000|350000|400000|450000|500000|550000|600000|650000|700000 |750000|800000|850000|900000|950000|1000000|1100000|1200000|1300000|1400000|1500000|1600000|1700000| 1800000|1900000|2000000") GUICtrlCreateLabel("Item6", 8, 424, 30, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateButton("StartSell", 8, 456, 83, 25, 0) GUICtrlSetOnEvent(-1 ,"_StartSell") GUICtrlCreateButton("RemoveItems", 104, 456, 83, 25, 0) GUICtrlSetOnEvent(-1, "_Remove") GUICtrlCreateButton("SAVE", 0, 488, 193, 33, 0) GUICtrlSetOnEvent(-1, "_Profile") GUICtrlSetFont(-1, 12, 800, 0, "Courier New") GUICtrlCreateButton("EXIT", 0, 528, 193, 33, 0) GUICtrlSetOnEvent(-1, "_EXIT") $ListView1 = GUICtrlCreateListView("", 0, 120, 193, 161) GUICtrlSetOnEvent(-1, "_LoadProfile") _GenerateList($ListView1, $ProfileDirectory) GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func _GenerateList($hListToUse, $vDirectoryToSearch) $aFileList = _FileListToArray($vDirectoryToSearch, "*" & $extension) For $i = 1 To UBound($aFileList) - 1 $removeini = String($aFileList[$i]) $removed = StringTrimRight(removeini, 4) GUICtrlSetData($hListToUse, $removed) Next EndFunc Func _LoadProfile() $Loaded = 1 $File = _GUICtrlListBox_GetText($ListView1, _GUICtrlListBox_GetCurSel($ListView1)) $YourIni = @ScriptDir & "\PriceSettings\" & $File & $extension If Not IniRead($YourIni, "Prices", "Item1", "") = "" Then _GUICtrlComboBoxEx_SetCurSel($Combo1, IniRead($YourIni, "Prices", "Item1", "")) EndIf If Not IniRead($YourIni, "Prices", "Item2", "") = "" Then _GUICtrlComboBoxEx_SetCurSel($Combo2, IniRead($YourIni, "Prices", "Item2", "")) EndIf If Not IniRead($YourIni, "Prices", "Item3", "") = "" Then _GUICtrlComboBoxEx_SetCurSel($Combo3, IniRead($YourIni, "Prices", "Item3", "")) EndIf If Not IniRead($YourIni, "Prices", "Item4", "") = "" Then _GUICtrlComboBoxEx_SetCurSel($Combo4, IniRead($YourIni, "Prices", "Item4", "")) EndIf If Not IniRead($YourIni, "Prices", "Item5", "") = "" Then _GUICtrlComboBoxEx_SetCurSel($Combo5, IniRead($YourIni, "Prices", "Item5", "")) EndIf If Not IniRead($YourIni, "Prices", "Item6", "") = "" Then _GUICtrlComboBoxEx_SetCurSel($Combo6, IniRead($YourIni, "Prices", "Item6", "")) EndIf EndFunc Func _StartSell() EndFunc Func _Remove() EndFunc Func _Profile() If $Loaded = 0 Then GUICreate("PriceSettings", 195, 140, 193, 125) GUISetBkColor(0x00E0FFFF) GUICtrlCreateLabel("SettingsName:", 40, 24, 114, 20) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") $Profile = GUICtrlCreateInput("", 24, 56, 145, 21) GUICtrlCreateButton("Save", 96, 96, 75, 25, 0) GUICtrlSetOnEvent(-1, "_Save") GUISetState(@SW_SHOW) Else _Save() EndIf EndFunc Func _Save() If $Loaded = 0 Then $temp = GUICtrlRead($Profile) GUIDelete("") $name = @ScriptDir & "\PriceSettings\" & $temp & $extension _FileCreate($name) Else $name = $YourIni EndIf IniWrite($name, "Prices", "Item1", GUICtrlRead($Combo1)) IniWrite($name, "Prices", "Item2", GUICtrlRead($Combo2)) IniWrite($name, "Prices", "Item3", GUICtrlRead($Combo3)) IniWrite($name, "Prices", "Item4", GUICtrlRead($Combo4)) IniWrite($name, "Prices", "Item5", GUICtrlRead($Combo5)) IniWrite($name, "Prices", "Item6", GUICtrlRead($Combo6)) _GenerateList($ListView1, $ProfileDirectory) EndFunc Func _Exit() Exit EndFunc Link to comment Share on other sites More sharing options...
smashly Posted July 7, 2008 Share Posted July 7, 2008 Hmm, maybe use scite and run your code and fix the syntax and other errors. As it is your code throws nothing but error after error. Errors range from missing commas, missing include, end bracket added where there shouldn't be.. etc. Cheers Link to comment Share on other sites More sharing options...
bagohan Posted July 7, 2008 Author Share Posted July 7, 2008 i fix it already but i have new error when i finish save it nothing show in my listview.... muttley Link to comment Share on other sites More sharing options...
bagohan Posted July 7, 2008 Author Share Posted July 7, 2008 problem solved but when i clicking the info in my listview.. i still get error.... Link to comment Share on other sites More sharing options...
jerwin Posted July 7, 2008 Share Posted July 7, 2008 problem solved but when i clicking the info in my listview.. i still get error.... If Not IniRead($YourIni, "Prices", "Item1", "") = "" Then _GUICtrlComboBoxEx_SetCurSel($Combo1, IniRead($YourIni, "Prices", "Item1", "")) EndIf it must be _GUICtrlComboBox not _GUICtrlComboBoxEX [font="Arial Black"]Looking for a partner in making Perfect Bot for DEKARONPm me if you wanna join.....[/font] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now