Spell Finder program source code (VB6), you need 1 text box, 1 web browser control, and one command button on the form. The text box stores the current spell id:
Private Sub Command1_Click()
Dim PostData As String
Dim Headers As String
Dim blnFound As Boolean
Dim strPageText As String
Dim strURL
Dim SpellArray(20) As String
Dim vPost As Variant
Dim vHeader As Variant
Dim startAt
Dim aByte() As byte
startAt = CLng(Me.Text1.Text)
SpellArray(1) = "A confused-looking Kadoatie appears out of thin air, then suddenly vanishes."
SpellArray(2) = "A horrible stench fills the room, and just as quickly vanishes."
SpellArray(3) = "A loud thumping sound reverberates through the halls."
SpellArray(4) = "A mystical howling echoes in the distance."
SpellArray(5) = "A thick cloud of dust appears from nowhere, sending you into a coughing fit."
SpellArray(6) = "A tiny storm cloud forms in the center of the room and rains for a few seconds."
SpellArray(7) = "It is pitch black. You are likely to be eaten by a Grue."
SpellArray(8 ) = "Lightning bolts shoot out from the walls! You barely avoid being incinerated."
SpellArray(9) = "Suddenly, everything appears upside-down to you."
SpellArray(10) = "The ghost of King Coltzan flies through the room!"
SpellArray(11) = "The lights go out for a moment, then flicker back to life."
SpellArray(12) = "The temperature in the room drops by forty degrees."
SpellArray(13) = "The room shakes, then all goes still."
SpellArray(14) = "The stone beneath your feet turns to mud."
SpellArray(15) = "You grow to ten times of one-tenth your normal size!"
SpellArray(16) = "You suddenly feel very dizzy."
SpellArray(17) = "Your hair catches on fire!"
SpellArray(18 ) = "Your pants disappear! Good thing you're alone."
SpellArray(19) = "Your personal gravity field suddenly reverses, and you find yourself standing on the ceiling for a few seconds, before crashing back to the floor."
SpellArray(20) = "Your skin cycles through a dozen random shades before settling back down to its normal colour."
For i = startAt To 52143
Me.Text1.Text = i
PostData = "goarch=YOUR_DATA_HERE&arcx=YOUR_DATA_HERE&arcy=
YOUR_DATA_HERE&read_book=YOUR_DATA_HERE&spell_id=" & i
' VB creates a Unicode string by default so we need to
' convert it back to Single byte character set.
'PostData = StrConv(PostData, vbFromUnicode)
Headers = "Content-Type: application/x-www-form-urlencoded" & _
vbCrLf & "Referer:
http://www.neopets.com/altador/archives.phtml" & _
vbCrLf
vHeader = Headers
ReDim aByte(0) As Byte
PackBytes abyte(), PostData
vPost = abyte
10: Me.WebBrowser1.Navigate "http://www.neopets.com/altador/archives.phtml", 0, "", vPost, vHeader
While Not Me.WebBrowser1.ReadyState = READYSTATE_COMPLETE
DoEvents
Wend
blnFound = False
For j = 1 To 20
If InStr(Me.WebBrowser1.Document.body.innerText, SpellArray(j)) Then
blnFound = True
End If
If Me.WebBrowser1.Document.body.innerText = "" Or InStr(Me.WebBrowser1.Document.body.innerText, "The page cannot be displayed") Then
blnFound = True
GoTo 10
End If
Next j
If blnFound = False Then
MsgBox "Spell ID: " & i
Exit For
End If
Next i
End Sub
Private Sub PackBytes(ByteArray() As Byte, ByVal PostData As String)
Dim iNewBytes As Integer
Dim iCursize As Integer
Dim i As Integer
Dim ch As String
iNewBytes = Len(PostData)
If iNewBytes = 0 Then
Exit Sub
End If
iCursize = UBound(ByteArray) - LBound(ByteArray)
ReDim Preserve ByteArray(iNewBytes + iCursize)
For i = 1 To iNewBytes
ch = Mid(PostData, i, 1)
If ch = Space(1) Then
ch = "+"
End If
ByteArray(i + iCursize - 1) = Asc(ch)
Next
End Sub
SNak Edit: Long Lines stretch the forum! Makes people sad! I italicized the line that was chopped up.