Jump to content

Need help with a few controls


Relive
 Share

Recommended Posts

I've been searching for a while on this problem but it seems like I need to post for help now.

Here's the scenario: I want to select a choice from my combo box, input a number, and click the button to process the inputs to do certain actions. But how do I add this process for every choice of my combo box?

Here the snippet:

$Group1 = GUICtrlCreateGroup("Profession", 136, 128, 281, 57)
$Combo2 = GUICtrlCreateCombo("Mining", 146, 153, 89, 30, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "Opal|Silver |Orihalcon |Amethyst|Steel Plate|Sapphire|Bronze |Adamantium |Mithril|DEX Crystal|Emerald|Gold|Topaz|AquaMarine|Diamond|Power Crystal|Garnet|Dark Crystal|Wisdom Crystal|LUK Crystal|Lidium")
$Button2 = GUICtrlCreateButton("Start", 328, 152, 81, 25)
Global $Input1 = GUICtrlCreateInput("Times", 248, 152, 65, 21)

...Skipping to this stuff now...

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $Button2 ;Profession
            WinActivate(" ")
            If $Combo2 = GUICtrlSetData(-1, "Orihalcon") Then
            ControlSend(" ", " ", "[ID:162]", "{END}+{LSHIFT}+{HOME}" & "Action goes here." & "{ENTER 2}")
            Send("{ENTER " & $Input1 "}")
            EndIf
        EndSwitch
WEnd

I can see I already showed a non-functional mistake there because I'm new to this coding.

Link to comment
Share on other sites

Please read the forum rules if this is connected to game automation.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

Your ComboxBox() looks a little suspicious & the fact you're biting to what I said in my previous post isn't helping your case either.

Edit: Just did a Google search to give you benefit of the doubt & let's just say the results confirmed my initial prediction.

Edited by guinness

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

$Group1 = GUICtrlCreateGroup("Profession", 136, 128, 281, 57)
$Combo2 = GUICtrlCreateCombo("Mining", 146, 153, 89, 30, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "Opal|Silver |Orihalcon |Amethyst|Steel Plate|Sapphire|Bronze |Adamantium |Mithril|DEX Crystal|Emerald|Gold|Topaz|AquaMarine|Diamond|Power Crystal|Garnet|Dark Crystal|Wisdom Crystal|LUK Crystal|Lidium")
$Button2 = GUICtrlCreateButton("Start", 328, 152, 81, 25)
Global $Input1 = GUICtrlCreateInput("Times", 248, 152, 65, 21)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $Button2 ;Profession
            WinActivate(" ")
            If $Combo2 = GUICtrlSetData(-1, "Orihalcon") Then
            ControlSend(" ", " ", "[ID:162]", "{END}+{LSHIFT}+{HOME}" & "Action goes here." & "{ENTER 2}")
            Send("{ENTER " & $Input1 "}")
            EndIf
        EndSwitch
WEnd

Looks like game code to me.

And the fact that you said he asumed it was game automation, instead of telling what it was.

[font="helvetica, arial, sans-serif"]Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.[/font]Scripts:[spoiler]Simple ScreenshotSaves you alot of trouble when taking a screenshot!Don't remember what happened with this, but aperantly the exe is all i got.If you don't want to run it, simply don't._IsRun UDFIt figures out if the script has ben ran before based on the info in a ini file.If you don't want to use exactly what i wrote, you can use it as inspiration.[/spoiler]

Link to comment
Share on other sites

Maybe that's why in the past, people had flamed and were rude here when game automation forums existed. Not one of you are answering my question but instead suspects that it's game automation. So now I have to get my code verified in order to get help? I don't know what kind of privacy this forum is respecting...

Link to comment
Share on other sites

Maybe that's why in the past, people had flamed and were rude here when game automation forums existed. Not one of you are answering my question but instead suspects that it's game automation. So now I have to get my code verified in order to get help? I don't know what kind of privacy this forum is respecting...

I'm sorry if you're offended by the fact that you're asking how to assist yourself in playing a game with AutoIt, even though the forum rules specifically prohibit discussing that here, and you're being told it's against the rules and to desist in asking about it. The code you posted above is clearly for a game as I'm sure there's no such item as Orihalcon or Wisdom Crystals in the "real" world, although they exist in the game world of MapleStory.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

You all don't even know what this is really for so stop assuming that I'm going to automate something. Who knows, I could be using this to organize inventory. This is more fuel to the fire really.

Link to comment
Share on other sites

You are avoding the question instead of telling us what it is for.

I don't think you wouldn't tell us if it was for some inventory organizating program.

[font="helvetica, arial, sans-serif"]Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.[/font]Scripts:[spoiler]Simple ScreenshotSaves you alot of trouble when taking a screenshot!Don't remember what happened with this, but aperantly the exe is all i got.If you don't want to run it, simply don't._IsRun UDFIt figures out if the script has ben ran before based on the info in a ini file.If you don't want to use exactly what i wrote, you can use it as inspiration.[/spoiler]

Link to comment
Share on other sites

You all don't even know what this is really for so stop assuming that I'm going to automate something. Who knows, I could be using this to organize inventory. This is more fuel to the fire really.

You knows and you don`t tell us anything. i preffer honesty that people "playing the victim", yes i am assuming because you let us.

about your privacy, I do not care to much in this case, you want the help so give us an answer please.

I fell morally extortions when spoken to privacy in such threads.

Edited by monoscout999
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...