Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
Value from both WebBrowser and TextBox in VB
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="flyest" data-source="post: 353203" data-attributes="member: 29020"><p>Thank you, kind sir! I tried a couple of combinations with And but it didn't work out for me. I just had to change the & in your code and now it works perfectly. <img src="/styles/default/xenforo/smilies/emojione/smile.png" class="smilie" loading="lazy" alt=":)" title="Smile :)" data-shortname=":)" /></p><p>[doublepost=1444484321,1444482500][/doublepost]The reason I had to do it that way is because if the application only reads "You lost", it will jump to the maximum bet (TextBox1.Text * "4096").</p><p>Any idea how I make it know that if it loses the first time it will double the first bet (TextBox1.Text * "2") and so on?</p><p>[SPOILER="How it works"][CODE] If WebBrowser1.DocumentText.Contains(TextBox3.Text) Then</p><p> WebBrowser1.Document.GetElementById(TextBox6.Text).SetAttribute("value", TextBox4.Text * "2")</p><p> For Each el As HtmlElement In elc</p><p> If el.GetAttribute("type").Equals("submit") Then</p><p> el.InvokeMember("Click")</p><p> End If</p><p> Next</p><p> End If</p><p> If WebBrowser1.DocumentText.Contains(TextBox3.Text) Then</p><p> WebBrowser1.Document.GetElementById(TextBox6.Text).SetAttribute("value", TextBox4.Text * "4")</p><p> For Each el As HtmlElement In elc</p><p> If el.GetAttribute("type").Equals("submit") Then</p><p> el.InvokeMember("Click")</p><p> End If</p><p> Next</p><p> End If</p><p> If WebBrowser1.DocumentText.Contains(TextBox3.Text) Then</p><p> WebBrowser1.Document.GetElementById(TextBox6.Text).SetAttribute("value", TextBox4.Text * "8")</p><p> For Each el As HtmlElement In elc</p><p> If el.GetAttribute("type").Equals("submit") Then</p><p> el.InvokeMember("Click")</p><p> End If</p><p> Next</p><p> End If</p><p> If WebBrowser1.DocumentText.Contains(TextBox3.Text) Then</p><p> WebBrowser1.Document.GetElementById(TextBox6.Text).SetAttribute("value", TextBox4.Text * "16")</p><p> For Each el As HtmlElement In elc</p><p> If el.GetAttribute("type").Equals("submit") Then</p><p> el.InvokeMember("Click")</p><p> End If</p><p> Next</p><p> End If</p><p> If WebBrowser1.DocumentText.Contains(TextBox3.Text) Then</p><p> WebBrowser1.Document.GetElementById(TextBox6.Text).SetAttribute("value", TextBox4.Text * "32")</p><p> For Each el As HtmlElement In elc</p><p> If el.GetAttribute("type").Equals("submit") Then</p><p> el.InvokeMember("Click")</p><p> End If</p><p> Next</p><p> End If</p><p> If WebBrowser1.DocumentText.Contains(TextBox3.Text) Then</p><p> WebBrowser1.Document.GetElementById(TextBox6.Text).SetAttribute("value", TextBox4.Text * "64")</p><p> For Each el As HtmlElement In elc</p><p> If el.GetAttribute("type").Equals("submit") Then</p><p> el.InvokeMember("Click")</p><p> End If</p><p> Next</p><p> End If</p><p> If WebBrowser1.DocumentText.Contains(TextBox3.Text) Then</p><p> WebBrowser1.Document.GetElementById(TextBox6.Text).SetAttribute("value", TextBox4.Text * "128")</p><p> For Each el As HtmlElement In elc</p><p> If el.GetAttribute("type").Equals("submit") Then</p><p> el.InvokeMember("Click")</p><p> End If</p><p> Next</p><p> End If</p><p> If WebBrowser1.DocumentText.Contains(TextBox3.Text) Then</p><p> WebBrowser1.Document.GetElementById(TextBox6.Text).SetAttribute("value", TextBox4.Text * "256")</p><p> For Each el As HtmlElement In elc</p><p> If el.GetAttribute("type").Equals("submit") Then</p><p> el.InvokeMember("Click")</p><p> End If</p><p> Next</p><p> End If</p><p> If WebBrowser1.DocumentText.Contains(TextBox3.Text) Then</p><p> WebBrowser1.Document.GetElementById(TextBox6.Text).SetAttribute("value", TextBox4.Text * "512")</p><p> For Each el As HtmlElement In elc</p><p> If el.GetAttribute("type").Equals("submit") Then</p><p> el.InvokeMember("Click")</p><p> End If</p><p> Next</p><p> End If</p><p> If WebBrowser1.DocumentText.Contains(TextBox3.Text) Then</p><p> WebBrowser1.Document.GetElementById(TextBox6.Text).SetAttribute("value", TextBox4.Text * "1024")</p><p> For Each el As HtmlElement In elc</p><p> If el.GetAttribute("type").Equals("submit") Then</p><p> el.InvokeMember("Click")</p><p> End If</p><p> Next</p><p> End If</p><p> If WebBrowser1.DocumentText.Contains(TextBox3.Text) Then</p><p> WebBrowser1.Document.GetElementById(TextBox6.Text).SetAttribute("value", TextBox4.Text * "2048")</p><p> For Each el As HtmlElement In elc</p><p> If el.GetAttribute("type").Equals("submit") Then</p><p> el.InvokeMember("Click")</p><p> End If</p><p> Next</p><p> End If</p><p> If WebBrowser1.DocumentText.Contains(TextBox3.Text) Then</p><p> WebBrowser1.Document.GetElementById(TextBox6.Text).SetAttribute("value", TextBox4.Text * "4096")</p><p> For Each el As HtmlElement In elc</p><p> If el.GetAttribute("type").Equals("submit") Then</p><p> el.InvokeMember("Click")</p><p> End If</p><p> Next</p><p> End If[/CODE]</p><p>[/SPOILER]</p></blockquote><p></p>
[QUOTE="flyest, post: 353203, member: 29020"] Thank you, kind sir! I tried a couple of combinations with And but it didn't work out for me. I just had to change the & in your code and now it works perfectly. :) [doublepost=1444484321,1444482500][/doublepost]The reason I had to do it that way is because if the application only reads "You lost", it will jump to the maximum bet (TextBox1.Text * "4096"). Any idea how I make it know that if it loses the first time it will double the first bet (TextBox1.Text * "2") and so on? [SPOILER="How it works"][CODE] If WebBrowser1.DocumentText.Contains(TextBox3.Text) Then WebBrowser1.Document.GetElementById(TextBox6.Text).SetAttribute("value", TextBox4.Text * "2") For Each el As HtmlElement In elc If el.GetAttribute("type").Equals("submit") Then el.InvokeMember("Click") End If Next End If If WebBrowser1.DocumentText.Contains(TextBox3.Text) Then WebBrowser1.Document.GetElementById(TextBox6.Text).SetAttribute("value", TextBox4.Text * "4") For Each el As HtmlElement In elc If el.GetAttribute("type").Equals("submit") Then el.InvokeMember("Click") End If Next End If If WebBrowser1.DocumentText.Contains(TextBox3.Text) Then WebBrowser1.Document.GetElementById(TextBox6.Text).SetAttribute("value", TextBox4.Text * "8") For Each el As HtmlElement In elc If el.GetAttribute("type").Equals("submit") Then el.InvokeMember("Click") End If Next End If If WebBrowser1.DocumentText.Contains(TextBox3.Text) Then WebBrowser1.Document.GetElementById(TextBox6.Text).SetAttribute("value", TextBox4.Text * "16") For Each el As HtmlElement In elc If el.GetAttribute("type").Equals("submit") Then el.InvokeMember("Click") End If Next End If If WebBrowser1.DocumentText.Contains(TextBox3.Text) Then WebBrowser1.Document.GetElementById(TextBox6.Text).SetAttribute("value", TextBox4.Text * "32") For Each el As HtmlElement In elc If el.GetAttribute("type").Equals("submit") Then el.InvokeMember("Click") End If Next End If If WebBrowser1.DocumentText.Contains(TextBox3.Text) Then WebBrowser1.Document.GetElementById(TextBox6.Text).SetAttribute("value", TextBox4.Text * "64") For Each el As HtmlElement In elc If el.GetAttribute("type").Equals("submit") Then el.InvokeMember("Click") End If Next End If If WebBrowser1.DocumentText.Contains(TextBox3.Text) Then WebBrowser1.Document.GetElementById(TextBox6.Text).SetAttribute("value", TextBox4.Text * "128") For Each el As HtmlElement In elc If el.GetAttribute("type").Equals("submit") Then el.InvokeMember("Click") End If Next End If If WebBrowser1.DocumentText.Contains(TextBox3.Text) Then WebBrowser1.Document.GetElementById(TextBox6.Text).SetAttribute("value", TextBox4.Text * "256") For Each el As HtmlElement In elc If el.GetAttribute("type").Equals("submit") Then el.InvokeMember("Click") End If Next End If If WebBrowser1.DocumentText.Contains(TextBox3.Text) Then WebBrowser1.Document.GetElementById(TextBox6.Text).SetAttribute("value", TextBox4.Text * "512") For Each el As HtmlElement In elc If el.GetAttribute("type").Equals("submit") Then el.InvokeMember("Click") End If Next End If If WebBrowser1.DocumentText.Contains(TextBox3.Text) Then WebBrowser1.Document.GetElementById(TextBox6.Text).SetAttribute("value", TextBox4.Text * "1024") For Each el As HtmlElement In elc If el.GetAttribute("type").Equals("submit") Then el.InvokeMember("Click") End If Next End If If WebBrowser1.DocumentText.Contains(TextBox3.Text) Then WebBrowser1.Document.GetElementById(TextBox6.Text).SetAttribute("value", TextBox4.Text * "2048") For Each el As HtmlElement In elc If el.GetAttribute("type").Equals("submit") Then el.InvokeMember("Click") End If Next End If If WebBrowser1.DocumentText.Contains(TextBox3.Text) Then WebBrowser1.Document.GetElementById(TextBox6.Text).SetAttribute("value", TextBox4.Text * "4096") For Each el As HtmlElement In elc If el.GetAttribute("type").Equals("submit") Then el.InvokeMember("Click") End If Next End If[/CODE] [/SPOILER] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
Value from both WebBrowser and TextBox in VB
Top