base Items ?

11/06/2011 03:09 ll33xx#1
whether it is a good idea to download the database ID Items?

Code:
#include <INet.au3>
#Include <IE.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <GuiTab.au3>
#Include <WinAPI.au3>
#include <GUIConstants.au3>
#Include <Process.au3>
#include <File.au3>
#include <Date.au3>
#include <Array.au3>

Global $ItemNazwa, $ItemIni, $PlikItemINI, $ItemN
Global $KatalogINI=@SCRIPTDIR&"\INI\"


for $j = 1 To 50620

$page = _INetGetSource("http://www.pwdatabase.com/pwi/items/"&$j)
$pageArray = StringSplit($page, @CRLF)

	For $i = 1 To $pageArray[0]
		If StringInStr($pageArray[$i], '<th class="itemHeader" colspan="2">') Then $ItemNazwa = StringReplace(StringReplace($pageArray[$i], '<th class="itemHeader" colspan="2">', ""), '☆', "")
		;StringReplace($pageArray[$i], '<th class="itemHeader" colspan="2">', "")
		If StringInStr($pageArray[$i], "Type: <a href='key/3'>") Then $ItemIni="Weapons"
		If StringInStr($pageArray[$i], "Type: <a href='key/6'>") Then $ItemIni="Armors"
		If StringInStr($pageArray[$i], "Type: <a href='key/9'>") Then $ItemIni="Accessory"
		If StringInStr($pageArray[$i], "Type: <a href='key/12'>") Then $ItemIni="Potion"
		If StringInStr($pageArray[$i], "Type: <a href='key/15'>") Then $ItemIni="Materials"
		If StringInStr($pageArray[$i], "Type: <a href='key/17'>") Then $ItemIni="Attack Charms"
		If StringInStr($pageArray[$i], "Type: <a href='key/19'>") Then $ItemIni="Defence Charms"
		If StringInStr($pageArray[$i], "Type: <a href='key/31'>") Then $ItemIni="Projectil"
		If StringInStr($pageArray[$i], "Type: <a href='key/35'>") Then $ItemIni="Soul_Stones_Gems"
		If StringInStr($pageArray[$i], "Type: <a href='key/82'>") Then $ItemIni="Fashion"
		If StringInStr($pageArray[$i], "Type: <a href='shop/1'>") Then $ItemIni="Shop"
		If StringInStr($pageArray[$i], "Type: <a href='shop/2'>") Then $ItemIni="Fashion"
		If StringInStr($pageArray[$i], "Type: <a href='shop/3'>") Then $ItemIni="Firework"
		If StringInStr($pageArray[$i], "Type: <a href='shop/4'>") Then $ItemIni="Flyers"
		If StringInStr($pageArray[$i], "Type: <a href='shop/5'>") Then $ItemIni="Ride"
		If StringInStr($pageArray[$i], "Type: <a href='shop/6'>") Then $ItemIni="Chat"
		If StringInStr($pageArray[$i], "Type: <a href='shop/7'>") Then $ItemIni="Utility"
		If StringInStr($pageArray[$i], "Type: <a href='shop/8'>") Then $ItemIni="Craft"
			
		Next
		if $ItemNazwa <>"" Then 
			$PlikItemINI=$KatalogINI&$ItemIni&".ini"
			FileOpen($PlikItemINI,8)
			FileWrite($PlikItemINI,$j &" :"&$ItemNazwa& @CRLF)
			FileClose($PlikItemINI)
		EndIf
		$ItemNazwa=""
Next
11/06/2011 08:08 Sᴡoosh#2
Sure, why not. Helps if you wanna code a bot.