Our members are dedicated to PASSION and PURPOSE without drama!

Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - VLS

#1516
Tutorials & Snippets / [VB.NET] Clicker
November 26, 2012, 04:10:50 PM
In order to create your clicker in VB.NET you must do the following:

1) Get the handle of the target (casino) window.
2) Create a RECT structure with the coordinates.
3) Move the mouse to the coordinates within the casino window.
4) Perform the actual click operation.

Let's go at it step by step.




NOTE: since we'll use external DLL imports, you must add the line:

Code (vbnet) Select
Imports System.Runtime.InteropServices

To the very top of your VB.NET file.




1) Get the handle of the target (casino) window:

In order to get the handle of the casino window you must use a function that returns this handle based on either the process id OR the window's title. We will use a title-based one, in our case: findWindow.

The declaration is this:
Code (vb.net) Select

<System.Runtime.InteropServices.DllImport("user32.dll")> _
Private Shared Function FindWindow( _
    ByVal lpClassName As String, _
    ByVal lpWindowName As String) As System.IntPtr
End Function


Now we must get the handle into a variable of type intPtr

Code (vbnet) Select
Dim casinoHwnd As IntPtr
casinoHwnd = FindWindow(vbNullString, "Exact casino window title here")


vbNullString means you don't pass the class name of the casino and are only using the title.




2) Create a RECT structure with the coordinates.

First create your RECT structure:

Code (vbnet) Select

'RECT structure
    Structure RECT
        Public Left As Integer
        Public Top As Integer
        Public Right As Integer
        Public Bottom As Integer
    End Structure


Now set a variable with it, passing the casino handle (casinoHwnd) to the GetWindowRect() function.

Code (vbnet) Select

<System.Runtime.InteropServices.DllImport("user32")> _
    Private Shared Function GetWindowRect(ByVal hwnd As IntPtr, ByRef lpRect As Rectangle) As IntPtr
    End Function


And set a variable with it:

Code (vbnet) Select
        Dim stRect As RECT
        GetWindowRect(casinoHwnd, stRect)


We are halfway there!




3) Move the mouse to the coordinates within the casino window.

In order to move the mouse you have to use the  SetCursorPos(x, y) function.

It is declared like this:
Code (vbnet) Select

Public Declare Function SetCursorPos Lib "user32" (ByVal X As Integer, ByVal why As Integer) As Integer


And you simply use the coordinates of the number to click + the coordinates of the casino window, like this:

Let's suppose the #1 is at coordinates x:188, y:352 in the casino window.

In order to move the cursor there you use the .left and .top propierties of the stRect structure and add the coordinates:
Code (vbnet) Select

SetCursorPos(stRect.Left + 188, strRect.Top + 352)


And the cursor is right there focused on the exact number.




4) Perform the actual click operation.

In order to perform the actual click, we must invoke the mouse_event function.

It is declared like this, including the two constants for the down/up event combo to recreate the click:

Code (vbnet) Select

Public Declare Sub mouse_event Lib "user32" Alias "mouse_event" (ByVal dwFlags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal cButtons As Integer, ByVal dwExtraInfo As Integer)

    Public Const MOUSEEVENTF_LEFTDOWN = &H2
    Public Const MOUSEEVENTF_LEFTUP = &H4


And now simply use:

Code (vbnet) Select

        mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
        mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)



Voilá

YOU JUST DID YOUR CLICKER MODULE IN VISUAL BASIC.NET!

Victor
#1517
Archive / Re: [DEV] LastXSplits
November 26, 2012, 02:20:34 AM
Quote from: wannawin on November 25, 2012, 11:14:18 PM
I can give my suggestions if you could explain clearly what the core functionality means.
By core functionality I want to convey aspects related to the tracked criterion itself.

I'm aware menus and other secondary functionality need to be implemented, yet the main body of it is what I need you and the fellows to approve.




Expect upcoming builds with improvements.

Regards.
#1518
Archive / Re: [DEV] LastXSplits
November 26, 2012, 02:15:49 AM
Thanks for your warm and kind words dear Max,

I'm very pleased to know you do appreciate it.

Actually my triumph is the triumph of a whole community. I'm going to act as a "glue" or as an interface in translating simpler instructions into their more expanded versions.

In order to achieve the goals intended with HobbyCode/BetCode, I have to be proficient in several languages / technologies.

PHP - Server/CGI
HTML5+Javascript/AJAX - WebGUI
C++ - WIN32/GTK/QT
C# - .NET/Mono
Java - JavaVM/Android
ObjectiveC - Mac/iOS

I'm glad lending my programming skills to a beginner language will be the base of one of those "silent revolutions"; I know chances are it'll never be taught at MIT, but it will make many non-programmers (beginners) and hobbyists very happy. That's what matters.

Targeting a wide array of platforms with a single, easy-to-learn and use codebase sure gets to paint many smiling faces.

Cheers.
Vic
#1519
Archive / [DEV] LastXSplits
November 25, 2012, 08:46:36 PM
First published development version.

Please provide feedback on core functionality.

Download: [attachmini=1]

[attachimg=2]




Coded in Cross-platform C#

Works on windows (with .NET), Linux/Mac via Mono.

Code (csharp) Select

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;


namespace LastXSplits_0_1
{
    public partial class Form1 : Form
    {
        /// <summary>
        /// Constructor
        /// </summary>
        public Form1()
        {
            // Initialization
            InitializeComponent();
        }


        // History implemented as stack (LIFO)
        Stack<int> history = new Stack<int>();


        // Splits as List of Split class
        List<Split> Splits = new List<Split>() { new Split(1, 0), new Split(2, 0), new Split(3, 0), new Split(1, 2), new Split(1, 4), new Split(2, 3), new Split(2, 5), new Split(3, 6), new Split(4, 5), new Split(4, 7), new Split(5, 6), new Split(5,, new Split(6, 9), new Split(7,, new Split(7, 10), new Split(8, 9), new Split(8, 11), new Split(9, 12), new Split(10, 11), new Split(10, 13), new Split(11, 12), new Split(11, 14), new Split(12, 15), new Split(13, 14), new Split(13, 16), new Split(14, 15), new Split(14, 17), new Split(15, 18), new Split(16, 17), new Split(16, 19), new Split(17, 18), new Split(17, 20), new Split(18, 21), new Split(19, 20), new Split(19, 22), new Split(20, 21), new Split(20, 23), new Split(21, 24), new Split(22, 23), new Split(22, 25), new Split(23, 24), new Split(23, 26), new Split(24, 27), new Split(25, 26), new Split(25, 28), new Split(26, 27), new Split(26, 29), new Split(27, 30), new Split(28, 29), new Split(28, 31), new Split(29, 30), new Split(29, 32), new Split(30, 33), new Split(31, 32), new Split(31, 34), new Split(32, 33), new Split(32, 35), new Split(33, 36), new Split(34, 35), new Split(35, 36) };


        // Counter as BindingList of SplitCount (bound to DataGridView in FormCount)
        BindingList<SplitCount> Counter = new BindingList<SplitCount>();


        // Instantiate history form
        Form fHistory = new FormHistory();


        // Instantiate counter form
        Form fCount = new FormCount();


        // Reference to DataGridView
        DataGridView dgvCount;


        // Reference to History ListBox
        ListBox lbHistory;


        /// <summary>
        /// Program's entrypoint
        /// </summary>
        private void Form1_Load(object sender, EventArgs e)
        {
            // Declare control array
            PictureBox[] pbCtrl = { pb0, pb1, pb2, pb3, pb4, pb5, pb6, pb7, pb8, pb9, pb10, pb11, pb12, pb13, pb14, pb15, pb16, pb17, pb18, pb19, pb20, pb21, pb22, pb23, pb24, pb25, pb26, pb27, pb28, pb29, pb30, pb31, pb32, pb33, pb34, pb35, pb36 };


            // Attach events to each control
            foreach (PictureBox ctrl in pbCtrl)
            {
                // MouseLeave
                ctrl.MouseLeave += new EventHandler(PictureBox_MouseLeave);


                // MouseEnter
                ctrl.MouseEnter += new EventHandler(PictureBox_MouseEnter);


                // MouseDown
                ctrl.MouseDown += new MouseEventHandler(PictureBox_MouseDown);


                // MouseUp
                ctrl.MouseUp += new MouseEventHandler(PictureBox_MouseUp);


                // MouseClick
                ctrl.MouseClick += new MouseEventHandler(PictureBox_MouseClick);
            }


            // Set dgvCount
            dgvCount = (DataGridView)fCount.Controls["dgvCount"];


            // Prevent automatic generation of columns
            dgvCount.AutoGenerateColumns = false;


            // Add shows column
            DataGridViewTextBoxColumn showsColumn = new DataGridViewTextBoxColumn();
            showsColumn.DataPropertyName = "Shows";
            showsColumn.HeaderText = "Shows";
            showsColumn.Width = 50;
            showsColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            showsColumn.DefaultCellStyle.Font = new Font(fileToolStripMenuItem.Font, fileToolStripMenuItem.Font.Style ^ FontStyle.Italic);
            dgvCount.Columns.Add(showsColumn);


            // Add splits column
            DataGridViewTextBoxColumn splitsColumn = new DataGridViewTextBoxColumn();
            splitsColumn.DataPropertyName = "Splits";
            splitsColumn.HeaderText = "Splits";
            showsColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            splitsColumn.DefaultCellStyle.Font = new Font(fileToolStripMenuItem.Font, fileToolStripMenuItem.Font.Style ^ FontStyle.Italic);
            splitsColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            dgvCount.Columns.Add(splitsColumn);


            // Set dgvCount DataSource
            dgvCount.DataSource = Counter;


            // Set lbHistory
            lbHistory = (ListBox)fHistory.Controls["lbHistory"];


            // Show history form
            fHistory.Show();


            // Show counters form
            fCount.Show();
        }


        /// <summary>
        /// MouseEnter handler
        /// </summary>
        private void PictureBox_MouseEnter(object sender, System.EventArgs e)
        {
            // Show alpha-blended image
            ((PictureBox)sender).BackgroundImage = Properties.Resources.yellow_highlight_alpha_38x47;
        }


        /// <summary>
        /// MouseLeave handler
        /// </summary>
        private void PictureBox_MouseLeave(object sender, System.EventArgs e)
        {
            // Remove image
            ((PictureBox)sender).BackgroundImage = null;
        }


        /// <summary>
        /// MouseDown Handler
        /// </summary>
        private void PictureBox_MouseDown(object sender, MouseEventArgs e)
        {
            // Check for left button
            if (e.Button == System.Windows.Forms.MouseButtons.Left)
            {
                // Change cursor to hand
                ((PictureBox)sender).Cursor = Cursors.Hand;


                // Show blue alpha-blended image
                ((PictureBox)sender).BackgroundImage = Properties.Resources.blue_highlight_alpha_38x47;
            }
        }


        /// <summary>
        /// MouseUp Handler
        /// </summary>
        private void PictureBox_MouseUp(object sender, MouseEventArgs e)
        {
            // Show yellow alpha-blended image
            ((PictureBox)sender).BackgroundImage = Properties.Resources.yellow_highlight_alpha_38x47;


            // Change cursor back
            ((PictureBox)sender).Cursor = Cursors.Default;
        }


        /// <summary>
        /// MouseClick handler
        /// </summary>
        private void PictureBox_MouseClick(object sender, MouseEventArgs e)
        {
            /* Right click = UNDO */


            if (e.Button == System.Windows.Forms.MouseButtons.Right)
            {
                // Check there's something
                if (history.Count > 0)
                {
                    // Pop last one
                    history.Pop();


                    // Remove from history ListBox
                    lbHistory.Items.RemoveAt(0);
                }


                // Update
                update();


                // Halt flow
                return;
            }


            // Check sender
            if (!(sender is PictureBox))
            {
                // Halt flow too
                return;
            }


            /* Left click = add to history */


            // Snip number
            int number = Convert.ToInt32(((PictureBox)sender).Name.ToString().Substring(2));


            // Push onto history stack
            history.Push(number);


            // Add to history ListBox
            lbHistory.Items.Insert(0, number);


            // Update
            update();
        }


        /// <summary>
        /// Update procedure
        /// </summary>
        private void update()
        {
            // Set dictionary of int, List<Split>
            Dictionary<int, List<Split>> SpD = new Dictionary<int, List<Split>>();


            // Reset every split counter
            foreach (Split sp in Splits)
            {
                // Zero it
                sp.count = 0;
            }


            // Set a count for iterations
            int iteration = 0;


            // Update X times
            foreach (int currentNumber in history)
            {
                // Rise iteration count
                ++iteration;


                // Update Splits list count
                foreach (Split sp in Splits)
                {
                    // If number in split matches input one
                    if (sp.n1 == currentNumber || sp.n2 == currentNumber)
                    {
                        // Rise one in .count
                        sp.count += 1;
                    }
                }


                // Check if must halt
                if (iteration == nudX.Value)
                {
                    // Time to break
                    break;
                }
            }


            // Set dictionary values
            foreach (Split sp in Splits)
            {
                // Account (or not) for unhit splits
                if (sp.count == 0 && !showUnhitSplitsToolStripMenuItem.Checked)
                {
                    // Unchecked, skip iteration
                    continue;
                }


                // Create dictionary entry if not present
                if (!SpD.ContainsKey(sp.count))
                {
                    // Add new list
                    SpD.Add(sp.count, new List<Split>() { sp });
                }
                else
                {
                    // Add split to index
                    SpD[sp.count].Add(sp);
                }
            }


            // Clear counter
            Counter.Clear();


            // Declare new int list
            List<int> intList = new List<int>();


            // Populate with dictionary keys
            foreach (KeyValuePair<int, List<Split>> kvp in SpD)
            {
                // Add key to list
                intList.Add(kvp.Key);
            }


            // Sort list
            intList.Sort();


            // Sync counter with dictionary using list
            for (int i = 0; i < intList.Count; ++i)
            {
                // Add to Counter
                Counter.Add(new SplitCount(intList[i], SpD[intList[i]]));
            }


            // Update status strip count
            tsslHistory.Text = history.Count.ToString();
        }


        /// <summary>
        /// Launch website in default browser
        /// </summary>
        private void websiteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Open web
            LaunchSite();
        }


        /// <summary>
        /// Open website in default browser
        /// </summary>
        private void LaunchSite()
        {
            // Launch BetSelection.cc
            System.Diagnostics.Process.Start("http://betselection.cc");
        }


        /// <summary>
        /// Show about box
        /// </summary>
        private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Message
            MessageBox.Show("Created for the BetSelection.cc community by: Victor/VLS" + Environment.NewLine + Environment.NewLine + "Point your browser to [url=http://www.BetSelection.cc]www.BetSelection.cc[/url] for more releases!" + Environment.NewLine + Environment.NewLine + "(Nov. 2012)", "About Last X Splits", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
        }


        /// <summary>
        /// Account for unhit splits
        /// </summary>
        private void showUnhitSplitsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Reverse checked status
            showUnhitSplitsToolStripMenuItem.Checked = !showUnhitSplitsToolStripMenuItem.Checked;
        }


        /// <summary>
        /// Act upon change of X
        /// </summary>
        private void nudX_ValueChanged(object sender, EventArgs e)
        {
            // Trigger update
            update();
        }


        /// <summary>
        /// Launch website when form is closed
        /// </summary>
        private void Form1_FormClosed(object sender, FormClosedEventArgs e)
        {
            // Open web
            LaunchSite();
        }
    }


    /// <summary>
    /// Split class
    /// </summary>
    public class Split
    {
        // Count, First and second splits
        public int count, n1, n2;


        // Overloaded constructor
        public Split(int first, int second)
        {
            // Set first number
            n1 = first;


            // Set second number
            n2 = second;
        }
    }


    /// <summary>
    /// SplitCount Class
    /// </summary>
    public class SplitCount
    {
        // Shows
        public int _shows;


        // Splits
        public List<Split> _splits;


        /// <summary>
        /// Overloaded constructor
        /// </summary>
        /// <param name="shows">int for shows</param>
        /// <param name="splits">List of Split</param>
        public SplitCount(int shows, List<Split> splits)
        {
            _shows = shows;
            _splits = splits;
        }


        /// <summary>
        /// Shows property
        /// </summary>
        public int Shows
        {
            get { return _shows; }
            set { _shows = value; }
        }


        /// <summary>
        /// Splits property
        /// </summary>
        public string Splits
        {
            get
            {
                // Splits string
                string splits = "";


                // Populate splits string
                foreach (Split sp in _splits)
                {
                    // First number + second number + comma and space (added after every split for speed)
                    splits += sp.n1 + "-" + sp.n2 + ", ";
                }


                // Strip last comma and space
                splits = splits.Substring(0, splits.Length - 2);


                // Return processed string
                return splits;
            }
        }
    }
}
#1520
Straight-up / Re: "Felt Twins" Evolution
November 25, 2012, 06:22:39 PM
Well, for this we take the word of the math guys who affirm each spin is independent; so as long as it comes from the same quality source (i.e. same wheel) it forms a perfectly valid set of actuals on its own, regardless of any skipping :cheer:
#1521
Straight-up / Re: "Felt Twins" Evolution
November 25, 2012, 08:34:44 AM
I'd like to use actuals from tomorrow's first open table @ wiesbaden for illustration.

These "Twin babies" can have pretty good runs! And I'd like the trial to be as transparent as possible.

...We can't curve-fit actuals from the future, can we?  :D
#1522
Straight-up / "Felt Twins" Evolution
November 25, 2012, 08:25:11 AM
Using the Triple-Felt Matrix.

Remember the "Dozen Twins"? They were bound to the dozens, these ones are "Felt Twins" or better expressed "Free Twins" (in any direction).

Bet is this: You bet to complete three (3) Felt Twins to be symmetrically distanced from each other. Example to follow.
#1523
Meta-selection / Triple-Felt Matrix
November 25, 2012, 08:19:32 AM
This one:


[attachimg=1]


Several interesting approaches such as "Felt Twins" Evolution are based on it.
#1524
Community Software / Re: Clickers
November 24, 2012, 07:55:54 PM
I have already answered via PM my friend, I liked your idea to derive benefit for the forum  ;)


Cheers!
#1525
Mixed / Re: Mixed INTER-SESSION Money Management
November 22, 2012, 06:07:23 PM
Quote from: subby on November 22, 2012, 11:09:34 AM
Interesting

can you elaborate more on the bit underlined?

Sure.

Remember in this inter-session money management there are two types of bankrolls:

1) Attack
2) Reserve

The purpose of the attack bankroll is to grow up to the highest unit value possible, so concatenated winning sessions make the largest dent feasible on casino's bank.

Reserve bankrolls on the other hand are your oxigen.

Units are what allow you to "breathe" in gambling; while you have units to play, you have a chance to continue. The more of these base unit (low value) bankrolls you have in reserve the better. This will enable you to lose the least in bad trams of concatenated sessions and to have enough "hold" to continue in game.


There is a theoretical point in which you have so many of these base units saved in these reserve banks that it realistically gets to take longer than what you can ever play in your entire lifetime to lose them. At this point you are certain to end up a winner.

(It doesn't really matter where such units are: in a bank account netting interests, in gold or under the matress... what's important is that you own them).

Illustrations to follow for better comprehension.

"Over" but not out,
Vic
#1527
Recently I answered a message regarding the free and paid membership levels:

Quotehow can you reconcile the two different groups?

It's mostly a matter of conscience. We aren't making difference in the treatments to each group other than content access. You have most certainly already interacted with both types of members.

Should we treat paying users differently? In the interactions with people we all should be treated the same.

If you would, we currently have not two, but several categories of members:

- Guests: only gets teaser posts and can't access certain areas (i.e. can't even know or see such areas as the private general board and soon the extra software by Ophis or me).

- Registered non-paying member: Can post around but still can't access private sections in full.

- Paying member: access to everything earned by means of the provided financial support.

- Full free member: a member that we'd be honored to have in our ranks offering their quality interactions and bringing activity that pushes the forum forward.

So, there is space for all in our forum. There are no special stars or distinctions under their name for paying or full members. I know for a fact that when such distinctions are in place there are immediate cracks in the group's cohesion and this is why we avoid them, in order to not even have a need to reconcile, because we all understand the most important thing is to support the place together. Technically (features/software), with financial support (subscription price) or with the quality interactions (that keep the forum in good flow).

Receive a big, heartfelt hug.

Victor
#1528
Bottom line is: we are attacking the "Achilles heels" of forum sustainability from the start.

We are building a well-oiled community from every angle: quality content, quality software and internal self-support; a winner for the years to come.

#1529
I'm also take the opportunity to place a subscribe button for those posters who were given the grant but wouldn't matter to put up with subscription price.

It's 100% opt-in of course, I do consider that bringing the main chunk of content to attract other members is already a lot; for instance asking to support with his constant posting AND financially every month I consider it to be over the top and that's why I'm not doing so, just if -and only if- those members want to choose it themselves, they can also have the choice/option.

They are already contributing more value than the one quantified by membership price  :nod:
#1530
Quote from: ewarwoowar on November 22, 2012, 02:39:18 PM
so, not everyone pays a subscription?

No. Those who don't get chopped posts and can't access several sections unless given the grant manually.