Sign in to follow this  
Followers 0
xPloit

Little help displaying combo options

18 posts in this topic

I am trying to make a program that will automatically load any tab/section of hackforums. So, for those of you who dont know, there are several tabs with several sections within each tab. I easily made the tab combo box, but I am having problems with making the section combo box the way I want.

Tab code:

Global $HackForums = GUICtrlCreateButton("Hack Forums",10,10,80,30)
GUICtrlSetOnEvent($HackForums,"_HF")
Global $HFTabs = GUICtrlCreateCombo("Tab",100,15,70,50)
    GUICtrlSetData($HFTabs,"General Topics|Hacking|Computing|Coding|Gaming|VIP Areas|Groups|Webmaster|Graphics|Marketplace")

However, I wanted the section combo box to only show links for what is in the selected tab. So, I tried this:

Global $HFSection = GUICtrlCreateCombo("Section",180,15,70,50)
    If GUICtrlRead($HFTabs) = "General Topics" Then
        GUICtrlSetData($HFSection,"Rules, Announcements, News and Feedback|Introductions|The Lounge|Shopping Deals|Member Contests|Anime Adventures|Monetizing Techniques|Movies, Videos, and Cinema|Science, Religion, Philosophy, and Politics|Melody, Harmony, Rhythm and MP3|The Hack Test|Freaky Files For Fun")
    ElseIf GUICtrlRead($HFTabs) = "Hacking" Then
        GUICtrlSetData($HFSection,"Beginner Hacking|Hacking Tutorials|Website and Forum Hacking|Hacking Tools and Programs|Proxies and Socks|Cryptography, Encryption, and Decryption|Botnets, IRC Bots, and Zombies|Human Manipulation and Social Engineering|Wifi WPA WEP Wireless Hacking|Phreaking Cells Mobiles and PDA's|AIM MSN IRC ICQ and IM Hacks")
    ElseIf GUICtrlRead($HFTabs) = "Computing" Then
        GUICtrlSetData($HFSections,"White Hat Help|Linux, FreeBSD, and Unix Flavors|Microsoft Windows, XP, Vista and Windows 7|Apple Mac and OS X|Virtual Machines|Computer Overclocking, Customizing and Hardware|Miscellaneous Computer Talk|Computer Protection and Security Alerts")
    ElseIf GUICtrlRead($HFTabs) = "Coding" Then
        GUICtrlSetData($HFSections,"Coding and Programming|Visual Basic and .NET Framework|C/C++/Obj-C Programming|Batch ,Shell, Dos and Command Line Interpreters|Java Language, JVM, and the JRE|PHP Development|Pyton|Assembly Language and Programming|Perl Programming|Delphi|Lua Coding")
    ElseIf GUICtrlRead($HFTabs) = "Gaming" Then
        GUICtrlSetData($HFSections,"Console Gamers Haven|Computer and Online Gaming|Xbox 360 and Live Gaming|Playstation 3|Counter Strike and Steam|Habbo Hotel|World of Warcraft|Call of Duty|Nintendo Wii and DS|The Gamers Crew")
    ElseIf GUICtrlRead($HFTabs) = "VIP Area" Then
        GUICtrlSetData($HFSections,"HF l33t VIP Signup")
    ElseIf GUICtrlRead($HFTabs) = "Groups" Then
        GUICtrlSetData($HFSections,"Recruitment")
    ElseIf GUICtrlRead($HFTabs) = "Webmaster" Then
        GUICtrlSetData($HFSections,"Black SEO and Internet Marketing|Website Construction|Website Showcase and Reviews|Social Networking|Hosting|Web Servers and Dedicated Rentals")
    ElseIf GUICtrlRead($HFTabs) = "Graphics" Then
        GUICtrlSetData($HFSections,"Graphics|Rate My Graphic|Graphic Tutorials|Graphic Requests|Graphic Battles|GFX Contests|Video Editing")
    ElseIf GUICtrlRead($HFTabs) = "Marketplace" Then
        GUICtrlSetData($HFSections,"Marketplace Discussions|Premium Sellers Section|Secondary Sellers Market|Buyers Bay|Ebook Bazaar|Service Offerings|VPN Hosting and Services|Hosting Services|Traders Topics|Credit Card, Paypal, Identity, and Bank")
    EndIf

However, every time I select a tab, the section combobox still only has 1 option: "Section" It doesn't display the sections that I want it to...what is the problem here?


00101101011110000101000001101100011011110110100101110100

Share this post


Link to post
Share on other sites



This isn't an answer to your question, but more something for you to think about... do you really want to hard code all of the tabs and section names? then if they make any changes you have to do a rewrite... it's probably worth it to parse out the info you need from the actual site


1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

cameronsdad's answer was so cool I'm gonna post with that style too.

This isn't an answer to your question, but more something for you to think about... Do you really want to update the second combo right when it's created? Wouldn't it make more sense to update it when the first one is changed?

Share this post


Link to post
Share on other sites

@cam: I'm really new to AuI so I dont know how to do that, lol

@admiral: That is what I'm trying to do...If the selected tab is "coding" then I want the 2nd combobox to only display "coding" subforums. The 2nd box options depend on what is selected in the 1st box.


00101101011110000101000001101100011011110110100101110100

Share this post


Link to post
Share on other sites

But you already know how to do that!

You have a GUICtrlSetOnEvent that fires an event when the button is used. You want to do something when the combo is used. Wouldn't the logical thing to do be to put that GUICtrlRead-stuff in a function and add:

GUICtrlSetOnEvent($HFTabs,"_SomeFunc")

Just like the button??

Try it! ;)

Share this post


Link to post
Share on other sites

I see what you're saying...I'll see what I can do

Thanks


00101101011110000101000001101100011011110110100101110100

Share this post


Link to post
Share on other sites

@cam: I'm really new to AuI so I dont know how to do that, lol

Advice you don't know how to follow is the best kind, because it gives you a course to study on. If you're using IE, i would recommend checking out IE.au3. I don't use IE for any normal browsing, but just about any web stuff i want to automate. For parsing out the data, check out StringRegExp()

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

Advice you don't know how to follow is the best kind, because it gives you a course to study on.

But without any form of instruction, it is 100% pointless. "Parse the data" means nothing to mean. I have no idea what to search for, what to google, which commands to look up in the help file, nothing. Your post was useless without some form of example or explanation

On a different note...I still didn't manage to get what Admiral said...this is my code now. I think it's closer, but it still doesn't work...

#Include <GUIConstants.au3>
#Include <IE.au3>
AutoItSetOption("MustDeclareVars",1)
AutoItSetOption("GUIOnEventMode",1)

Global $GUI = GUICreate("xPloit's IE Auto-Navigator",270,200)
GUISetOnEvent($GUI_EVENT_CLOSE,"_Close")

Global $HackForums = GUICtrlCreateButton("Hack Forums",10,10,80,30)
GUICtrlSetOnEvent($HackForums,"_HackForums")
Global $HFTabs = GUICtrlCreateCombo("Tab",100,15,70,50)
    GUICtrlSetData($HFTabs,"General Topics|Hacking|Computing|Coding|Gaming|VIP Areas|Groups|Webmaster|Graphics|Marketplace")
Global $HFSection = GUICtrlCreateCombo("Section",180,15,70,50)
GUICtrlSetOnEvent(GUICtrlRead($HFTabs) = "General Topics","_HFGeneralTopics")
GUICtrlSetOnEvent(GUICtrlRead($HFTabs) = "Hacking","_HFHacking")
GUICtrlSetOnEvent(GUICtrlRead($HFTabs) = "Computing","_HFComputing")
GUICtrlSetOnEvent(GUICtrlRead($HFTabs) = "Coding","_HFCoding")
GUICtrlSetOnEvent(GUICtrlRead($HFTabs) = "Gaming","_HFGaming")
GUICtrlSetOnEvent(GUICtrlRead($HFTabs) = "VIP Areas","_HFVIP")
GUICtrlSetOnEvent(GUICtrlRead($HFTabs) = "Groups","_HFGroups")
GUICtrlSetOnEvent(GUICtrlRead($HFTabs) = "Webmaster","_HFWebmaster")
GUICtrlSetOnEvent(GUICtrlRead($HFTabs) = "Graphics","_HFGraphics")
GUICtrlSetOnEvent(GUICtrlRead($HFTabs) = "Marketplace","_HFMarketplace")

Global $Exit = GUICtrlCreateButton("Exit",200,165,60,25)
GUICtrlSetOnEvent($Exit,"_Close")

GUISetState(1,$GUI)

While 1
    Sleep(10)
WEnd

Func _HFGeneralTopics()
    GUICtrlSetData($HFSections,"Rules, Announcements, News and Feedback|Introductions|The Lounge|Shopping Deals|Member Contests|Anime Adventures|Monetizing Techniques|Movies, Videos, and Cinema|Science, Religion, Philosophy, and Politics|Melody, Harmony, Rhythm and MP3|The Hack Test|Freaky Files For Fun")
EndFunc

Func _HFHacking()
    GUICtrlSetDat($HFSections,"Beginner Hacking|Hacking Tutorials|Website and Forum Hacking|Hacking Tools and Programs|Proxiest and Socks|Cryptography, Encryption, and Decryption|Botnets, IRC Bots, and Zombies|Human Manipulation and Social Engineering|Wifi WPA WEP Wireless Hacking|Phreaking Cells Mobiles and PDA's|AIM MSN IRC ICQ and IM Hacks")
EndFunc

Func _HFComputing()
    GUICtrlSetData($HFSections,"White Hat Halp|Linux, FreeBSD, and Unix Flavors|Microsoft Windows, XP, Vista and Windows 7")
EndFunc

Func _HFCoding()
    GUICtrlSetData($HFSections,"Coding and Programming|Visual Basic and .NET Framework|C/C++/Obj-C Programming|Batch ,Shell, Dos and Command Line Interpreters|Java Language, JVM, and the JRE|PHP Development|Python|Assembly Language and Programming|Perl Programming|Delphi|Lua Coding")
EndFunc

Func _HFGaming()
    GUICtrlSetData($HFSections,"Console Gamers Haven|Computer and Online Gaming|Xbox 360 and Live Gaming|Playstation 3|Counter Strike and Steam|Habbo Hotel|World of Warcraft|Call of Duty|Nintendo Wii and DS|The Gamers Crew")
EndFunc

Func _HFVIP()
    GUICtrlSetData($HFSections,"HF l33t VIP Signup")
EndFunc

Func _HFGroups()
    GUICtrlSetData($HFSections,"Recruitment")
EndFunc

Func _HFWebmaster()
    GUICtrlSetData($HFSections,"Black SEO and Internet Marketing|Website Construction|Website Showcase and Reviews|Social Networking|Hosting|Web Servers and Dedicated Rentals")
EndFunc

Func _HFGraphics()
    GUICtrlSetData($HFSections,"Graphics|Rate My Graphic|Graphic Tutorials|Graphic Requests|Graphic Battles|GFX Contests|Video Editing")
EndFunc

Func _HFMarketplace()
    GUICtrlSetData($HFSections,"Marketplace Discussions|Premium Sellers Section|Secondary Sellers Market|Buyers Bay|Ebook Bazaar|Service Offerings|VPN Hosting and Services|Hosting Services|Traders Topics|Credit Card, Paypal, Identity, and Bank")
EndFunc

Func _HackForums()
    Global $o_IE = _IECreate()
    _IENavigate($o_IE,"http://www.hackforums.net")
    _IELoadWait($o_IE)
    _IELinkClickByText($o_IE,GUICtrlRead($HFTabs))
    _IELoadWait($o_IE)
    _IELinkClickByText($o_IE,GUICtrlRead($HFSections))
    Global $goHF = 0
EndFunc

Func _Close()
    Exit
EndFunc


00101101011110000101000001101100011011110110100101110100

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

But without any form of instruction, it is 100% pointless.

Seeing as i gave you a phrase to look up that would have given you examples, i'd say it was 90% pointless at worst. Factor in the other reference to StringRegExp() and I'd say that my advice is less than half as useless as your script. ;)

***edit***

on rereading this it looks like it may have come across a little more asshole-ish than i'd intended.

Edited by cameronsdad

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

not to mention that you didn't give me the stringregexp() command until your second post...


00101101011110000101000001101100011011110110100101110100

Share this post


Link to post
Share on other sites

not to mention that you didn't give me the stringregexp() command until your second post...

which was still before your response

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

my post was #4 and yours was #7. Last I checked, in math class, 4 came before 7...

anyway. Please stop flaming. Either answer with a response to my newly posted code or gtfo.

Edited by xPloit

00101101011110000101000001101100011011110110100101110100

Share this post


Link to post
Share on other sites

my post was #4 and yours was #7. Last I checked, in math class, 4 came before 7...

The one where you said mine were useless was number 8

anyway. Please stop flaming. Either answer with a response to my newly posted code or gtfo.

not flaming, was trying to help you understand the help that you've already received. also i don't know what gtfo is...

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

The one where you said mine were useless was number 8

The useless post was #2

i don't know what gtfo is...

http://www.google.com/#sclient=psy&hl=en&q=what+does+gtfo+stand+for&aq=f&aqi=g2g-o1&aql=&oq=&gs_rfai=&pbx=1&fp=f82d49f7a278c83c


00101101011110000101000001101100011011110110100101110100

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

Hey you two break that up, a fight is not going to help either of you.

@xPloit

I'm to tired to make an example today. I'll check back some time tomorrow and show you what I meant if no one else have.

;)

Edited by AdmiralAlkex

Share this post


Link to post
Share on other sites

alright, Admiral. Thanks bro


00101101011110000101000001101100011011110110100101110100

Share this post


Link to post
Share on other sites

Well, I finally got it working! Not sure if this is the best way to do it or not, but at least it works, haha!

#Include <GUIConstants.au3>
#Include <IE.au3>
AutoItSetOption("MustDeclareVars",1)
AutoItSetOption("GUIOnEventMode",1)

Global $GUI = GUICreate("xPloit's IE Auto-Navigator",270,200)
GUISetOnEvent($GUI_EVENT_CLOSE,"_Close")

Global $HackForums = GUICtrlCreateButton("Hack Forums",10,10,80,30)
GUICtrlSetOnEvent($HackForums,"_HackForums")
Global $HFTabs = GUICtrlCreateCombo("Tab",100,15,70,50)
    GUICtrlSetData($HFTabs,"General Topics|Hacking|Computing|Coding|Gaming|VIP Areas|Groups|Webmaster|Graphics|Marketplace")
    GUICtrlSetOnEvent($HFTabs,"_HFSectionDisplayer")
Global $HFSection = GUICtrlCreateCombo("Section",180,15,70,50)

Func _HFSectionDisplayer()
    If GUICtrlRead($HFTabs) = "General Topics" Then 
        GUICtrlSetData($HFSection,"")
        GUICtrlSetData($HFSection,"Rules, Announcements, News and Feedback|Introductions|The Lounge|Shopping Deals|Member Contests|Anime Adventures|Monetizing Techniques|Movies, Videos, and Cinema|Science, Religion, Philosophy, and Politics|Melody, Harmony, Rhythm and MP3|The Hack Test|Freaky Files For Fun")
    ElseIf GUICtrlRead($HFTabs) = "Hacking" Then
        GUICtrlSetData($HFSection,"")
        GUICtrlSetData($HFSection,"Beginner Hacking|Hacking Tutorials|Website and Forum Hacking|Hacking Tools and Programs|Proxiest and Socks|Cryptography, Encryption, and Decryption|Botnets, IRC Bots, and Zombies|Human Manipulation and Social Engineering|Wifi WPA WEP Wireless Hacking|Phreaking Cells Mobiles and PDA's|AIM MSN IRC ICQ and IM Hacks")
    ElseIf GUICtrlRead($HFTabs) = "Computing" Then
        GUICtrlSetData($HFSection,"")
        GUICtrlSetData($HFSection,"White Hat Halp|Linux, FreeBSD, and Unix Flavors|Microsoft Windows, XP, Vista and Windows 7")
    ElseIf GUICtrlRead($HFTabs) = "Coding" Then
        GUICtrlSetData($HFSection,"")
        GUICtrlSetData($HFSection,"Coding and Programming|Visual Basic and .NET Framework|C/C++/Obj-C Programming|Batch ,Shell, Dos and Command Line Interpreters|Java Language, JVM, and the JRE|PHP Development|Python|Assembly Language and Programming|Perl Programming|Delphi|Lua Coding")
    ElseIf GUICtrlRead($HFTabs) = "Gaming" Then
        GUICtrlSetData($HFSection,"")
        GUICtrlSetData($HFSection,"Console Gamers Haven|Computer and Online Gaming|Xbox 360 and Live Gaming|Playstation 3|Counter Strike and Steam|Habbo Hotel|World of Warcraft|Call of Duty|Nintendo Wii and DS|The Gamers Crew")
    ElseIf GUICtrlRead($HFTabs) = "VIP Areas" Then
        GUICtrlSetData($HFSection,"")
        GUICtrlSetData($HFSection,"HF l33t VIP Signup")
    ElseIf GUICtrlRead($HFTabs) = "Groups" Then
        GUICtrlSetData($HFSection,"")
        GUICtrlSetData($HFSection,"Recruitment")
    ElseIf GUICtrlRead($HFTabs) = "Webmaster" Then
        GUICtrlSetData($HFSection,"")
        GUICtrlSetData($HFSection,"Black SEO and Internet Marketing|Website Construction|Website Showcase and Reviews|Social Networking|Hosting|Web Servers and Dedicated Rentals")
    ElseIf GUICtrlRead($HFTabs) = "Graphics" Then
        GUICtrlSetData($HFSection,"")
        GUICtrlSetData($HFSection,"Graphics|Rate My Graphic|Graphic Tutorials|Graphic Requests|Graphic Battles|GFX Contests|Video Editing")
    ElseIf GUICtrlRead($HFTabs) = "Marketplace" Then
        GUICtrlSetData($HFSection,"")
        GUICtrlSetData($HFSection,"Marketplace Discussions|Premium Sellers Section|Secondary Sellers Market|Buyers Bay|Ebook Bazaar|Service Offerings|VPN Hosting and Services|Hosting Services|Traders Topics|Credit Card, Paypal, Identity, and Bank")
    Else
        GUICtrlSetData($HFSection,"")
    EndIf
EndFunc

Global $Exit = GUICtrlCreateButton("Exit",200,165,60,25)
GUICtrlSetOnEvent($Exit,"_Close")

GUISetState(1,$GUI)

While 1
    Sleep(10)
WEnd

Func _HackForums()
    If GUICtrlRead($HFTabs) = "Tab" Then
        MsgBox(0,"ERROR","You must select a tab to load!")
        Return
    ElseIf GUICtrlRead($HFSection) = "" Then
        MsgBox(0,"ERROR","You must select a forum to view!")
        Return
    EndIf
    Global $o_IE = _IECreate()
    _IENavigate($o_IE,"http://www.hackforums.net")
    _IELoadWait($o_IE)
    _IELinkClickByText($o_IE,GUICtrlRead($HFTabs))
    _IELoadWait($o_IE)
    _IELinkClickByText($o_IE,GUICtrlRead($HFSection))
    Global $goHF = 0
EndFunc

Func _Close()
    Exit
EndFunc


00101101011110000101000001101100011011110110100101110100

Share this post


Link to post
Share on other sites

Well, I finally got it working! Not sure if this is the best way to do it or not, but at least it works, haha!

good job man. I took a look at the forum that you're automating too, it looks like the Tabs atleast are part of an unordered list with an ID. If you decide to populate your combo's dynamically, you'll probably not have too hard of a time doing it with IE.au3 and StringRegExp

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

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