title: Why does this VBS code fail with a "Type mismatch: 'CInt'" error?
body: <p>I am experiencing difficulty with the following VBS code. It works only sometimes, and even then it fails quickly. Why?</p>
  
  <pre><code>Dim Butt
  Set Butt = CreateObject("InternetExplorer.application")
  Butt.visible = True
  Butt2 = InputBox("Put the link to one hat you would like to snipe.", "Hat Selection")
  Butt3 = InputBox("Enter the maximum amount of Robux you will spend on this hat.", "Maximum Payment")
  Dim Proace
  Set Proace = CreateObject("Microsoft.XMLHTTP")
  Proace.Open "GET", "http://www.roblox.com", False
  Proace.Send
  Do
  Do While Butt.Busy
  WScript.sleep 200
  Loop
  St00f = CInt(Replace(Mid(St00f, (InStr(St00f, "&gt;R$")+3), 8), "&lt;/b&gt;", ""))
  If St00f &lt;= CInt(Butt3) Then
  Butt.Navigate "javascript:WebForm_DoPostBackWithOptions(new%20WebForm_PostBackOptions(""ctl00$cphRoblox$TabbedInfo$UserSalesTab$lstItemsForResale$ctrl0$lnkBuyNow"",%20"""",%20true,%20"""",%20"""",%20false,%20true))"
  Exit Do
  End If
  Loop
  Do While Butt.Busy
  WScript.sleep 200
  Loop
  MsgBox("Congratulations! Your snipe was successful! You sniped "&amp;Butt2&amp;" for "&amp;Butt3&amp;" Robux!")
  Butt.Quit
  Set Butt = Nothing
  Set Proace = Nothing
  WScript.Quit
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>Script:   C:\Users\John\Downloads\SingleHatSniper.vbs  
  Line:     14
  Char:     1
  Error:    Type mismatch: 'CInt'
  Code:     800A000D
  Source:   Microsoft VBScript runtime error
  </code></pre>
  
  <p>Please help me, I'm not that great with VBS. That much is clear, my friend helped me write this.</p>