Jump to content

Making a newegg computer builder


 Share

Recommended Posts

Ok, so I decided that in order to help me make custom computer builds from newegg, I would create a GUI with groups and would have a function that would add parts to the groups, and it would have a button at the bottom that would copy the url to create the shopping cart. Unfortunately, as far as I can tell, I'd need a 3d matrix to do this, and I'm sure there's a better way. Here's the pile of crap that is my code:

CODE
#include <GuiConstants.au3> ;Include GUI functions

#include <Array.au3> ;array funcs

Dim $parts

$parts = _ArrayCreate("case", "mobo", "cpu", "memory", "gpu", "hdd", "psu", "optical", "misc")

#cs

$parts[0] is case

$parts[1] is mobo

$parts[2] is cpu

$parts[3] is memory

$parts[4] is gpu

$parts[5] is hdd

$parts[6] is psu

$parts[7] is optical

$parts[8] is misc

#ce

;now to define some helper functions

;example url cart:

;http://secure.newegg.com/NewVersion/shopping/AddtoCart.asp?Submit=ADD&itemList=N82E16813157108%7C1,N82E16827101131%7C1,N82E16811119068%7C1,N82E16819103747%7C1,N82E16820231098%7C1,N82E16822136062%7C1,N82E16817153023%7C1,N82E16814102079%7C1&preitemList=

Func AddPart($group, $name, $price, $url)

_ArrayInsert($parts[$group], 0, $name)

_ArrayInsert($parts[$group], 1, $price)

_ArrayInsert($parts[$group], 2, $url)

EndFunc ;==>AddPart

AddPart(3, "cheap ram", 19.99, "N82E16813157108")

_ArrayDisplay($parts, "Parts")

#cs

GuiCreate("Newegg computer builder", 400, 300)

GUICtrlCreateGroup("Case", 5, 5, 390,

GuiSetState()

While 1

$msg = GuiGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case Else

;incase we do something

EndSelect

WEnd

#ce

#cs

Func AreYouSure() ;1=yes, 0=no, 2=user clicked exit

$sure = MsgBox(0, "Newegg PC builder", "Are you sure?")

If $sure = 6 Then

Return 1

ElseIf $sure = 7 Then

Return 0

ElseIf $sure = 2 Then

Return 2

EndIf

EndFunc

#ce

I'm getting so confused, there doesn't seem to be an easy way to do this. Any help at all/suggestions are greatly appreciated. If you don't understand something, just ask and I'll try to explain.

Link to comment
Share on other sites

Although it's doable, you'll take a long time to create such GUI since the NewEgg website is so deep, you'll need tons of arrays and switches. Also you need to some how know when NewEgg made an update so that you can update your GUI also, else you may be adding obsolete parts into your GUI Shopping Cart.

Besides, what's wrong with the NewEgg's shopping cart? :)

[font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version

Link to comment
Share on other sites

Although it's doable, you'll take a long time to create such GUI since the NewEgg website is so deep, you'll need tons of arrays and switches. Also you need to some how know when NewEgg made an update so that you can update your GUI also, else you may be adding obsolete parts into your GUI Shopping Cart.

Besides, what's wrong with the NewEgg's shopping cart? :)

No, it's not that complicated. What you can do is put in a bunch of product IDs (like in the example link in the code) in that format in a url, then it will automatically generate the shopping cart from those product IDs.
Link to comment
Share on other sites

No, it's not that complicated. What you can do is put in a bunch of product IDs (like in the example link in the code) in that format in a url, then it will automatically generate the shopping cart from those product IDs.

Unless you have an access to NewEgg's database, you'll have to propagate your GUI manually.

Out of curiosity, take your $parts[0] for example, how do you plan to propagate that array if not manually? :)

[font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version

Link to comment
Share on other sites

Unless you have an access to NewEgg's database, you'll have to propagate your GUI manually.

Out of curiosity, take your $parts[0] for example, how do you plan to propagate that array if not manually? :)

I intend on having categories, which are arrays, for memory, motherboards, etc, and those categories have the data such as price and URL which I will use to generate the GUI.
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...