Automated bot for betting form

flyest

Doctor
Mar 3, 2013
94
13
Hello.
I'm playing a text based browser game which has a mini-game where the chance to win is approximately 50%.
Does anyone know of a bot that types, submits and doubles the amount I bet if I lose? And if I win, it'll go back to what I first bet?
I bet 100 000 and lose.
I bet 200 000 and lose.
I bet 400 000 and win.
I bet 100 000 and lose.
I bet 200 000 and win.
I bet 100 000 and win.
And so on...
 

Weasel

👄 I'd intercept me
Nov 25, 2011
4,135
2,461
I don't think there is such a specific bot around. Besides that, you are not really clear on what you want exactly.
 

flyest

Doctor
Mar 3, 2013
94
13
There is an example of the concept in the thread.

Let's say you have a billion coins.
You bet 100 000 and lose. Now, if you keep doubling the bet until you eventually win (cause with a chance of 50/50 eventually you will win), you will always have won 100 000.

What I want is a bot that fills out a form automatically and submits it. There's no anti bot or anything.
Just simply type in a number and hit enter which shouldn't be much of a pain.

It's just that I need the bot to understand that if the page says "You lost" it has to double the amount it just bet. And when I win it will start over and bet, as in this example, 100 000.
 

LeChris

https://habbo.codes/
Sep 30, 2013
2,786
1,395
So you need a bot that repetitively doubles the amount bet, until you win than it goes back to 100k
 

flyest

Doctor
Mar 3, 2013
94
13
He wants something that uses the martingale strategy. There are existing bots for certain games (like bitcoin gambling)

Correct. Didn't know the name of it.
 
I managed to make one in Visual Studio which isn't automated (yet). It saves me a lot of time!
This wasn't too hard, but I have to understand the language a little bit more in order to finish it.
xRmtsFW.png
Code:
private void button1_Click(object sender, EventArgs e)
        {
            webBrowser1.Document.GetElementById("bet").SetAttribute("value", "51200000");
            HtmlElementCollection elc = this.webBrowser1.Document.GetElementsByTagName("input");
            foreach (HtmlElement el in elc)
            {
                if (el.GetAttribute("type").Equals("submit"))
                {
                    el.InvokeMember("Click");
                }
            }
        }
If there is anyone who can help me automatize the process, contact me through PM. :)
 

Donkjam

Professional Moderator
Contributor
Nov 20, 2010
1,610
1,605
I'm assuming if you lose it will show 'lose' or something on the page? Try doing on web browser refresh or some function that it enters the numbers depending on 'win' or 'lose' text

It'll be very easy to do in VB, @Sledmore surely you've got code to hand to do this? I've seen you do something similar lol

It's just a simple if statement and store the value in the memory like

If browser.contains('win') then
Go back bla bla

Edit: here's how I'd do it not on computer and don't really do c# however it's basically the principal should be easy to code


First set like an integer for numbers like:
Dim Amount as integer

Then try something along these kind of lines

Amount = '100000'

If WebBrowser1.DocumentText.Contains('win") Then
Amount = amount + '100000'

Then insert button press code here (replace the code for amount text box as The integer (amount)
Else
Amount = '100,000'
Then as above for the button press
 
Last edited:

flyest

Doctor
Mar 3, 2013
94
13
I'm assuming if you lose it will show 'lose' or something on the page? Try doing on web browser refresh or some function that it enters the numbers depending on 'win' or 'lose' text

It'll be very easy to do in VB, @Sledmore surely you've got code to hand to do this? I've seen you do something similar lol

It's just a simple if statement and store the value in the memory like

If browser.contains('win') then
Go back bla bla

Edit: here's how I'd do it not on computer and don't really do c# however it's basically the principal should be easy to code


First set like an integer for numbers like:
Dim Amount as integer

Then try something along these kind of lines

Amount = '100000'

If WebBrowser1.DocumentText.Contains('win") Then
Amount = amount + '100000'

Then insert button press code here (replace the code for amount text box as The integer (amount)
Else
Amount = '100,000'
Then as above for the button press
Thank you so much for this. I will try it out and let you know if it works for me. :)
 
Code:
If WebBrowser1.DocumentText.Contains("win") Then
            WebBrowser1.Document.GetElementById("bet").SetAttribute("value", "200")
        End If
It doesn't catch the You win text or any id.
This is how the div that appears when you win looks like:
HTML:
<div id="wonn">
    <div id="won">You win!</div>
</div>
 
Last edited:

flyest

Doctor
Mar 3, 2013
94
13
I actually got it all working now.
It does the mathematics itself. But since I coded everything inside Button1_Click I have to click it in order for it to make the bet and click 'Enter'.
Not a really big deal though. It should be easy to code.
Code:
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        WebBrowser1.Navigate("http://mafiaenshevn.com/?casino=kronmynt")
        WebBrowser1.ScriptErrorsSuppressed = True
    End Sub

    Private Sub button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        WebBrowser1.Document.GetElementById("innsats").SetAttribute("value", "100000")
        Dim elc As HtmlElementCollection = Me.WebBrowser1.Document.GetElementsByTagName("input")
        For Each el As HtmlElement In elc
            If el.GetAttribute("type").Equals("submit") Then
                el.InvokeMember("Click")
            End If
        Next
        If WebBrowser1.DocumentText.Contains("Du vant") Then
            WebBrowser1.Document.GetElementById("innsats").SetAttribute("value", "100000")
            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("Du tapte 100") Then
            WebBrowser1.Document.GetElementById("innsats").SetAttribute("value", "200000")
            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("Du tapte 200") Then
            WebBrowser1.Document.GetElementById("innsats").SetAttribute("value", "400000")
            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("Du tapte 400") Then
            WebBrowser1.Document.GetElementById("innsats").SetAttribute("value", "800000")
            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("Du tapte 800") Then
            WebBrowser1.Document.GetElementById("innsats").SetAttribute("value", "1600000")
            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("Du tapte 1 600") Then
            WebBrowser1.Document.GetElementById("innsats").SetAttribute("value", "3200000")
            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("Du tapte 3 200") Then
            WebBrowser1.Document.GetElementById("innsats").SetAttribute("value", "6400000")
            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("Du tapte 6 400") Then
            WebBrowser1.Document.GetElementById("innsats").SetAttribute("value", "12800000")
            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("Du tapte 12 800") Then
            WebBrowser1.Document.GetElementById("innsats").SetAttribute("value", "25600000")
            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("Du tapte 25 600") Then
            WebBrowser1.Document.GetElementById("innsats").SetAttribute("value", "51200000")
            For Each el As HtmlElement In elc
                If el.GetAttribute("type").Equals("submit") Then
                    el.InvokeMember("Click")
                End If
            Next
        End If
    End Sub
Thanks to @Donkee for helping me. It was much easier in Visual Basic. :)
 
Last edited:

Donkjam

Professional Moderator
Contributor
Nov 20, 2010
1,610
1,605
P
I actually got it all working now.
It does the mathematics itself. But since I coded everything inside Button1_Click I have to click it in order for it to make the bet and click 'Enter'.
Not a really big deal though. It should be easy to code.
Code:
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        WebBrowser1.Navigate("http://mafiaenshevn.com/?casino=kronmynt")
        WebBrowser1.ScriptErrorsSuppressed = True
    End Sub

    Private Sub button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        WebBrowser1.Document.GetElementById("innsats").SetAttribute("value", "100000")
        Dim elc As HtmlElementCollection = Me.WebBrowser1.Document.GetElementsByTagName("input")
        For Each el As HtmlElement In elc
            If el.GetAttribute("type").Equals("submit") Then
                el.InvokeMember("Click")
            End If
        Next
        If WebBrowser1.DocumentText.Contains("Du vant") Then
            WebBrowser1.Document.GetElementById("innsats").SetAttribute("value", "100000")
            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("Du tapte 100") Then
            WebBrowser1.Document.GetElementById("innsats").SetAttribute("value", "200000")
            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("Du tapte 200") Then
            WebBrowser1.Document.GetElementById("innsats").SetAttribute("value", "400000")
            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("Du tapte 400") Then
            WebBrowser1.Document.GetElementById("innsats").SetAttribute("value", "800000")
            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("Du tapte 800") Then
            WebBrowser1.Document.GetElementById("innsats").SetAttribute("value", "1600000")
            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("Du tapte 1 600") Then
            WebBrowser1.Document.GetElementById("innsats").SetAttribute("value", "3200000")
            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("Du tapte 3 200") Then
            WebBrowser1.Document.GetElementById("innsats").SetAttribute("value", "6400000")
            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("Du tapte 6 400") Then
            WebBrowser1.Document.GetElementById("innsats").SetAttribute("value", "12800000")
            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("Du tapte 12 800") Then
            WebBrowser1.Document.GetElementById("innsats").SetAttribute("value", "25600000")
            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("Du tapte 25 600") Then
            WebBrowser1.Document.GetElementById("innsats").SetAttribute("value", "51200000")
            For Each el As HtmlElement In elc
                If el.GetAttribute("type").Equals("submit") Then
                    el.InvokeMember("Click")
                End If
            Next
        End If
    End Sub
Thanks to @Donkee for helping me. It was much easier in Visual Basic. :)

Great to hear! Glad I could help a little. Yeah VB is easier ha. You could make the button click by itself or via a timer to make it all automated I guess too
 

flyest

Doctor
Mar 3, 2013
94
13
Great to hear! Glad I could help a little. Yeah VB is easier ha. You could make the button click by itself or via a timer to make it all automated I guess too
I am working on it, sir. Do you know how I can make the time depend on a scroll bar (1-10 sec)?
 

Donkjam

Professional Moderator
Contributor
Nov 20, 2010
1,610
1,605
Still not entirely sure however something like this could work?

Add a timer to the form with an interval of like 5000 which would be around 5 seconds. Set the property to false tho

At the top of the button code do like timer1.enabled = false

Then at the end after all the stuff been some etc do timer1.enabled = true

In the timer code (like double click timer) do something like

If timer1.interval = timer1.interval then
Button1.click (forgot what it is. Maybe it's click)
End if
 

flyest

Doctor
Mar 3, 2013
94
13
The reason I needed this is because the website won't let me load more than 50 pages in a minute.
But it was pretty simple. I made a text box instead where I can put in x seconds.
Code:
    Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
        Timer1.Interval = TextBox1.Text * "1000"
    End Sub
 

Users who are viewing this thread

Top