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

#631
General Discussion / Re: Small BV sofware
January 24, 2014, 12:21:14 AM
Well, it's merely an comparison with previously captured images (i.e. images for 0,1,2,3,4,5,6,7,8,9 + point) and translating them to an integer plus decimal.

My advice is for you to try to get somebody with experience in creating optical readers. I have absolutely no problem in assisting someone who wants to help you if him/her is stuck with the coding, but I just can't commit to another new project until I'm clear of what I have on my plate.

Hint: don't pay for it!

There are many documented ways online to capture the screen, i.e.

http://www.codeproject.com/Articles/5051/Various-methods-for-capturing-the-screen#Capture%20It%20the%20GDI%20way

And even more ways to match images, from simple pixel to pixel comparison to SIFT:

http://www.codeproject.com/Articles/5051/Various-methods-for-capturing-the-screen#Capture%20It%20the%20GDI%20way

Another easy approach would be to let a free and proven OCR do all the recognition job. i.e. Tesseract OCR:

https://code.google.com/p/tesseract-ocr/
#632
Usage support / Re: Trying the 'inner forum'
January 21, 2014, 10:38:18 PM
It's "alive"  :applause:
#633
Quote from: esoito on January 20, 2014, 02:43:28 AM[The Powers of Coding Darkness]

I'm no doctor, but this sure feels like opening up an organism and handling its entrails. Creating something right inside another live project is indeed "gory", in its own coding way...  ^-^
#634
Roulette Xtreme / Re: RX Bot has been released!
January 18, 2014, 05:08:53 PM
In my humble opinion, traditional programming languages are easier than RX coding and those skills can extend to many domains of action, which is a BIG plus... BUT Kudos to them for developing their own programming language.

The more I learn about compiler theory, the more appreciation I have for programming language creators, be it large or small.
#635
General Discussion / Re: Link words to adverts
January 17, 2014, 09:28:48 PM
Quote from: Chrisbis on January 17, 2014, 09:08:06 PMWhen did we bring in the Linked Words to Adverts system?

We didn't!

Your computer is infected with a link-injecting virus such as Ezula/TopText and family  :-\:

http://www.symantec.com/security_response/writeup.jsp?docid=2003-080116-4112-99

Linux recommended  O:-)
#636
Straight-up / Re: Felt pattern matching => STRATEGIES
January 16, 2014, 04:45:21 AM
Intra-dozen Trio + Repeater Duo @ One Cycle

BET SELECTION PROCEDURE:

- "Look back" numbers until there is either a possible intra-dozen trio or repeater duo eligible for betting.

- Bet on it, adding any other eligible number(s) as spins go by.

- Any plus or break even resets the cycle.

- Maximum length = a 37-spin cycle, counting numbers looked back.

- Repeat procedure. This is a loop.
#637
Intra-dozen repeater duo

Two repeaters in the same direction:

[attachimg=1]

[attachimg=2]
#638
Straight-up / Felt pattern matching => STRATEGIES
January 16, 2014, 03:27:02 AM
Series of practical application for felt-based patterns in the accompanying topic:

Felt pattern matching => "Hidden in plain sight"
#639
Intra-dozen trio

It's realized when two formations of three (3) touching numbers repeat within the same dozen.

Numbers can be shared across formations.

Example:

[attachimg=1]

In here #14 is to be bet. Because it enables this:

[attachimg=2]

[attachimg=3]

They are a match.




[attachimg=4]

In here #5 is to be bet. It enables this:

[attachimg=5]

[attachimg=6]
#640
Going to any casino in the world with nothing but a simple roulette felt layout, and "hitting it" without being noticed.

One of the greatest achievements of a roulette player.

Since s/he's not even watching the wheel spin, s/he can't be accused of playing dealer signatures, bias or anything wheel-based. Just being a player who doesn't draw much attention. Hidden in plain sight.






Felt pattern matching is playing a different game which happens to be realized in the roulette felt.

This series visits many of those patterns to match.

It is accompanied of the topic: Felt pattern matching => STRATEGIES where applications of these patterns is discussed.
#641
http://www.youtube.com/watch?v=eO2vmIXeiYY


As you can see, no changes needed on the target program to connect :)
#642
You can check this download to see it in action: [attachmini=1]

(Illustrative video is uploading)
#643
Connectors / [SOURCE] TextBox Connector 20140115
January 15, 2014, 07:24:06 PM
Comm.cs

Code (csharp) Select
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using System.Drawing;
using System.Windows.Forms;
using System.Diagnostics;
using System.Threading;
using System.Runtime.InteropServices;
using System.IO;

namespace TextBox_Connector
{
    public static class Comm
    {
        // Set module Type
        private static string type = "display";

        // Set namespace
        private static string nSpace = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName.Substring(0, System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName.IndexOf('.'));

        // Declare process
        static Process p = new Process();

        // Declare target handle
        static IntPtr target = IntPtr.Zero;
       
        /// <summary>
        /// Delegate for thread enumeration
        /// </summary>
        delegate bool EnumThreadDelegate(IntPtr hWnd, IntPtr lParam);

        /// <summary>
        /// Delegate for child windows enumeration
        /// </summary>
        public delegate bool EnumWindowProc(IntPtr hWnd, IntPtr parameter);

        /// <summary>
        /// Sends custom message to target handle (hWnd)
        /// </summary>
        [System.Runtime.InteropServices.DllImport("user32.dll", CharSet = CharSet.Auto)]
        static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, StringBuilder lParam);
        [System.Runtime.InteropServices.DllImport("user32.dll", SetLastError = true)]
        public static extern IntPtr SendMessage(int hWnd, int Msg, int wparam, int lparam);
        [System.Runtime.InteropServices.DllImport("user32.dll", CharSet = CharSet.Auto)]
        static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, string lParam);

        /// <summary>
        /// Enumerates child windows
        /// </summary>
        [System.Runtime.InteropServices.DllImport("user32")]
        [return: MarshalAs(UnmanagedType.Bool)]
        public static extern bool EnumChildWindows(IntPtr window, EnumWindowProc callback, IntPtr i);

        // Constant for GETTEXT message
        private const uint WM_GETTEXT = 0x000D;

        // Constant for GETTEXTLENGTH message
        private const int WM_GETTEXTLENGTH = 0x000E;

        // Constant for SETTEXT message
        private const uint WM_SETTEXT = 0x000C;

        /// <summary>
        /// Enumerates windows in the thread
        /// </summary>
        [System.Runtime.InteropServices.DllImport("user32.dll")]
        static extern bool EnumThreadWindows(int dwThreadId, EnumThreadDelegate lpfn, IntPtr lParam);

        /// <summary>
        /// Enumerates Handles from a given process
        /// </summary>
        static IEnumerable<IntPtr> EnumerateProcessWindowHandles(int processId)
        {
            var handles = new List<IntPtr>();

            foreach (ProcessThread thread in Process.GetProcessById(processId).Threads)
            {
                EnumThreadWindows(thread.Id, (hWnd, lParam) => { handles.Add(hWnd); return true; }, IntPtr.Zero);
            }

            return handles;
        }

        /// <summary>
        /// Callback for enumerating windows
        /// </summary>
        private static bool EnumWindow(IntPtr handle, IntPtr pointer)
        {
            // Get handle from garbage collector
            GCHandle gch = GCHandle.FromIntPtr(pointer);

            // Declare list
            List<IntPtr> list = gch.Target as List<IntPtr>;
           
            // Check if there's something
            if (list == null)
            {
                // Throw exception
                throw new InvalidCastException("GCHandle Target could not be cast as List<IntPtr>");
            }
           
            // Add to list
            list.Add(handle);
           
            // Exit with true (null would cancel)
            return true;
        }
       
        /// <summary>
        /// Returns list of IntPtr with child windows
        /// </summary>
        public static List<IntPtr> GetChildWindows(IntPtr parent)
        {
            List<IntPtr> result = new List<IntPtr>();
            GCHandle listHandle = GCHandle.Alloc(result);
            try
            {
                EnumWindowProc childProc = new EnumWindowProc(EnumWindow);
                EnumChildWindows(parent, childProc, GCHandle.ToIntPtr(listHandle));
            }
            finally
            {
                if (listHandle.IsAllocated)
                    listHandle.Free();
            }
            return result;
        }

        /// <summary>
        /// Gets text of control by handle
        /// </summary>
        public static string GetControlText(IntPtr hWnd)
        {
            // String builder for title           
            StringBuilder title = new StringBuilder();

            // Size of string for holding title.
            Int32 size = SendMessage((int)hWnd, WM_GETTEXTLENGTH, 0, 0).ToInt32();

            // 0 = no title.
            if (size > 0)
            {
                title = new StringBuilder(size + 1);

                SendMessage(hWnd, (int)WM_GETTEXT, title.Capacity, title);
            }

            // Give control text back
            return title.ToString();
        }

        /// <summary>
        /// Initialization routine
        /// </summary>
        public static string Init(Icon icon)
        {
            // Start process
            try
            {
                // Start
                p.StartInfo.UseShellExecute = false;
                p.StartInfo.FileName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().Location) + ".exe";
                p.Start();

                // Loop until it's loaded
                while (p.MainWindowHandle == IntPtr.Zero)
                {
                    Thread.Sleep(10);
                    p.Refresh();
                }

                // Check for input
                bool inputSolved = false;

                // Resolve input textbox
                while (!inputSolved)
                {
                    foreach (var handle in EnumerateProcessWindowHandles(p.Id))
                    {
                        // Get child windows
                        List<IntPtr> handles = GetChildWindows(handle);

                        // Hunt for "input"
                        foreach (IntPtr h in handles)
                        {
                            if (GetControlText(h).ToLower() == "input")
                            {
                                // Set target
                                target = h;

                                // Clear it
                                SendMessage(target, WM_SETTEXT, IntPtr.Zero, String.Empty);
                               
                                // Set flag
                                inputSolved = true;
                            }
                        }
                    }

                    // Pause
                    Thread.Sleep(25);
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }

            // Exit
            return string.Empty;
        }

        /// <summary>
        /// Receives message from the framework
        /// </summary>
        public static string Receive(string sender, string type, string msg)
        {
            // Split by new line
            string[] input = msg.Split(Environment.NewLine.ToCharArray());

            /* Discriminate message */

            // Check if OK msg
            if (input[0] == "K")
            {
                // TODO: Process it
            }
            else
            {
                // Clear target
                SendMessage(target, WM_SETTEXT, IntPtr.Zero, String.Empty);

                // Send latest message
                SendMessage(target, WM_SETTEXT, IntPtr.Zero, input[0]);
            }

            // Exit
            return string.Empty;
        }

        /// <summary>
        /// Sends message to the framework
        /// </summary>
        public static string Send(string msg)
        {
            // Try to send message
            try
            {
                // Send
                object ret = Assembly.GetEntryAssembly().GetType("BetSoftware_Loader.Comm").GetMethod("Receive", BindingFlags.Static | BindingFlags.Public).Invoke(null, new object[] { nSpace, type, msg });

                // Return
                return (string)ret;
            }
            catch (Exception)
            {
                // Let it fall through           
            }

            return string.Empty;
        }
    }
}
#644
Community Software / Re: Help on VB.net
January 15, 2014, 07:17:36 PM
http://www.youtube.com/watch?v=7vftKmfP1Hg


As you can see, there's no special modification required on the program to interact with the framework when using the TextBox connector.
#645
Community Software / Re: Help on VB.net
January 15, 2014, 07:11:24 PM
You can experience the connector in action by using this attached archive:

[attachmini=1]

(Video to illustrate usage to follow)