• Welcome to #1 Roulette Forum & Message Board | www.RouletteForum.cc.

News:

The only way to beat roulette is by increasing accuracy of predictions (changing the odds). This is possible on many real wheels.

Main Menu
Popular pages:

Roulette System

The Roulette Systems That Really Work

Roulette Computers

Hidden Electronics That Predict Spins

Roulette Strategy

Why Roulette Betting Strategies Lose

Roulette System

The Honest Live Online Roulette Casinos

Tom's RSS Pro for Playtech Tutorial: Using Silver's Scripts.

Started by ThomasGrant, Oct 28, 09:26 AM 2010

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

ThomasGrant

Tom's RSS Pro for Playtech Tutorial: Using Silver's Scripts.

This one will be a big Tutorial...

Lots of stuff to go through.

With a new script from Silver that I paid for.
It answers many of the questions I had.

This will hopefully be a full in depth Tutorial.
Will many of the old stuff covered.
And new stuff added in.

So from Design to getting the bot doing what it is supposed to do.
And that is. To place bets on the roulette table.
With any luck... It may even win a few rounds.
"What we do in life, echoes in eternity"

*Link Removed*  The Roulette Professor. *Link Removed*

ThomasGrant

First thing we do is Design what the bot will look like.

If you haven't already, then I recommend that you should read Design tutorial I did.

link:://rouletteforum.cc/coding-for-roulette/tom%27s-rss-pro-tutorial-v4-%28design%29-in-depth/

Here is the video of the first part of the design.
Just simply adding in a form, and units.
Changing the font, the color, the features of the window.

Tom's RSS Pro for Playtech Tutorial: Using Silver's Scripts. Video 1.
"What we do in life, echoes in eternity"

*Link Removed*  The Roulette Professor. *Link Removed*

ThomasGrant

Ok, we continue with the design.
Adding in the memos.
4 memos are added in.
3 are for the numbers that come in from the casino.
Memo_BN for black numbers.
Memo_0N for the Zero number.
Memo_RN for red numbers.

Memo_Results for the results.

Memo_Results will be used a fair bit for testing and to show what is going on.

Here is the video for it.

Tom's RSS Pro for Playtech Tutorial: Using Silver's Scripts. Video 2.

Here is the code for Unit1
uses                                                       
  Classes, Graphics, Controls, Forms, Dialogs, Unit2, Unit3, Unit4;
var
  MainForm: TForm2;
begin
  MainForm := TForm2.Create(Application);
  MainForm.Show;
end; 


As you can see I have added in Unit3, Unit4;
"What we do in life, echoes in eternity"

*Link Removed*  The Roulette Professor. *Link Removed*

ThomasGrant

Now for the final part of design.

[attachimg=1]

[attachimg=2]

Tom's RSS Pro for Playtech Tutorial: Using Silver's Scripts. Video3.

Now that the main design is done.
We can start coding it.
"What we do in life, echoes in eternity"

*Link Removed*  The Roulette Professor. *Link Removed*

ThomasGrant

"What we do in life, echoes in eternity"

*Link Removed*  The Roulette Professor. *Link Removed*

ThomasGrant

I know I posted this before.
Just wanted to make sure you understood it.
In this video I show the how and why of these two procedures.

Tom's RSS Pro for Playtech Tutorial: Using Silver's Scripts. Video4.

var F : Text;
    S : String;
var i;


{#### Window Operations ##############################################}
procedure close_me;
begin
    if Self.Top<0 then Self.Top:=0;
    if Self.Left<0 then Self.Left:=0;
    AssignFile(F,'c:\rss-data\winpos');
    Rewrite(F);             
    Writeln(F,Self.Top);
    Writeln(F,Self.Left);
    CloseFile(F);
end;

procedure load_winpos;
begin
    AssignFile(F,'c:\rss-data\winpos');{If no file exist. Then you will get an error message}
    Reset(F);{open the file for reading}
    i := 0;
    while not eof(F) do {loop that will repeat until the end of file will be not found}
    begin
        S:=ReadLn(F); {read the first line into "s" variable}
        if i=0 then Self.Top:=s;
        if i=1 then Self.Left:=s;
        i := i+1;
    end;
    CloseFile(F);//close the file
end;
{#### End: Window Operations #########################################}


Just make sure you have this folder on your c: drive.
And all should be ok.

c:\rss-data\
"What we do in life, echoes in eternity"

*Link Removed*  The Roulette Professor. *Link Removed*

ThomasGrant

Ok, in the video.
I show how I put the window position code into the settings window.

It is the same code.
Only the name of the file it saves to is different.

{#### Window Operations ##############################################}
procedure close_me;
begin
    if Self.Top<0 then Self.Top:=0;
    if Self.Left<0 then Self.Left:=0;
    AssignFile(F,'c:\rss-data\s1_winpos');
    Rewrite(F);               
    Writeln(F,Self.Top);
    Writeln(F,Self.Left);
    CloseFile(F);
end;

procedure load_winpos;
begin
    AssignFile(F,'c:\rss-data\s1_winpos');{If no file exist. Then you will get an error message}
    Reset(F);{open the file for reading}
    i := 0;
    while not eof(F) do {loop that will repeat until the end of file will be not found}
    begin
        S:=ReadLn(F); {read the first line into "s" variable}
        if i=0 then Self.Top:=s;
        if i=1 then Self.Left:=s;
        i := i+1;
    end;
    CloseFile(F);//close the file
end;
{#### End: Window Operations #########################################}
"What we do in life, echoes in eternity"

*Link Removed*  The Roulette Professor. *Link Removed*

ThomasGrant

Now we add in memo procedures.
These two simple procedures will put numbers into the marque (Memo_RN,Memo_BN,Memo_0N)
And print info into the Memo_Results.

Add last_nr to the variables.

var last_nr;

{#### Memo Operations ################################################}
procedure marque;
begin
   if number_is(last_nr,'red')then
   begin
       Memo_RN.Lines.Insert(0,last_nr);
       Memo_BN.Lines.Insert(0,'');
       Memo_0N.Lines.Insert(0,'');
   end;
   if number_is(last_nr,'black')then
   begin
       Memo_RN.Lines.Insert(0,'');
       Memo_BN.Lines.Insert(0,last_nr);
       Memo_0N.Lines.Insert(0,'');
   end;
   if number_is(last_nr,'single0')then
   begin
       Memo_RN.Lines.Insert(0,'');
       Memo_BN.Lines.Insert(0,'');
       Memo_0N.Lines.Insert(0,last_nr);
   end;
end;

procedure print_to_memo(arg1);
begin
   Memo_Results.Lines.Add(arg1);
end;
{#### End: Memo Operations ###########################################}
"What we do in life, echoes in eternity"

*Link Removed*  The Roulette Professor. *Link Removed*

ThomasGrant

Now we have some procedures in the code.
Lets add some more that will be used later on.

This is the latest system script that Silver sent me.
And I will try and explain how we will be using this later on.

I wont put the code in the post.
As it is a bit to big.

These are the main procedure that do all the work.

procedure add_system;
Here you can add your own system to the procedure.

procedure el_init(ei_elements; var ei_elements);
This is to initiate the elements in the systems.

procedure el_bet(eb_elements; var eb_elements);
This is used to place bets on the casino table.

procedure stack_array(sa_elements; var sa_elements);
Stacks or counts how many times a systems has not hit, or has hit.

procedure change_it(ci_elements,k,k1,id; var ci_elements);
New one from Silver. Here you can change the different element settings.
I will be modifying this part and showing you how we use it later on.

So I have uploaded where the script for you to read.
"What we do in life, echoes in eternity"

*Link Removed*  The Roulette Professor. *Link Removed*

ThomasGrant

Ok, now I will go into a bit of detail on menus.

And I will add in a menu option so I can chose what chip set to play with.

chips:=[0,0.1,1,5,10,25,100,500];//here you need to specify chip values

Here is a video of it.

Tom's RSS Pro for Playtech Tutorial: Using Silver's Scripts. Video5.

And the code.
procedure MainMenu1_10cClick(Sender: TObject);
begin   
    chips:=[0,0.01,0.1,0.50,1,5,10,25];//here you need to specify chip values
end;

procedure MainMenu1_50cClick(Sender: TObject);
begin
    chips:=[0,0.1,0.50,1,5,10,25,100];//here you need to specify chip values
end;
"What we do in life, echoes in eternity"

*Link Removed*  The Roulette Professor. *Link Removed*

ThomasGrant

Now that we have done a menu option.
Time to get this bot going.

Time for it to start betting.

First we add in a window procdure.
Form2Create

procedure Form2Create(Sender: TObject);
begin
    load_winpos;
end;

And we move the load_winpos; procedure into it.

Then we add these lines to the Form2Activate

procedure Form2Activate(Sender: TObject);
begin
    add_system;
    chips:=[0,0.01,0.1,0.50,1,5,10,25];//here you need to specify chip values
    unit_value:=0.10; //here you need to specify values of 1 unit
    start_amount:=StrToFloat(Edit_Balance.Text);
    amount:=start_amount;
    wish_amount:=amount+StrToFloat(Edit_Profit.Text);
    stop_loss:=StrToFloat(Edit_StopLoss.Text);
    sim_mode:=0;
    total_elements:=0;
    el_init(elements,elements);
    el_init(elements1,elements1);//here we set the elements
    spin_count:=1;
    was_betting:=1;
    fl_stop:=0;
    elements_played:=0;
end;

"What we do in life, echoes in eternity"

*Link Removed*  The Roulette Professor. *Link Removed*

ThomasGrant

Ok, now that we got the basic done.
Lets get this bot doing something.

Here is the start button code.
This will get it cranking.

procedure Button_StartClick(Sender: TObject);
begin                     
   unit_value:=1; //here you need to specify values of 1 unit
   set_roulette_window_name('European Roulette - EuroGrand Casino');
   while amount<wish_amount do begin
  if (was_betting=1)and(sim_mode<>1) then begin ide_delay:=250;click_chip3();click_red();delay(200);click_chip3();click_even();delay(200);click_clear_bets(); end;
  was_betting:=0;

  elements_played:=0;
  el_bet(elements,elements);
  el_bet(elements1,elements1);//here we bet

  if was_betting=0 then ide_delay:=200;//the speed of free spins. Very small value increase the speed but may pause the script itself, you can try 150
  if (fl_stop=1)or(elements_played=total_elements) then break;

  click_spin;
  last_nr:=get_last_number();
  marque;
  stack_array(elements,elements); stack_array(elements1,elements1);
  print_to_memo('Spin count - '+IntToSTr(spin_count)+'. Landed numbrer is '+IntToStr(last_nr)+'. Current amount is $'+FormatFloat('0.##',amount));
  print_to_memo('-------------------------------------------');

  if amount<=stop_loss then break;
  Inc(spin_count);
end;


In the stop button.
I add this very small code to stop the process.
procedure Button_StopClick(Sender: TObject);
begin
  fl_stop:=1;
end;


And in the edit balance field.
I put this in.

procedure Edit_BalanceKeyPress(Sender: TObject; var Key: Char);
begin
if Key = #13 then
    begin           
        Key := #0;
    end;   
end;


Here is video number 6 of it in action.

Tom's RSS Pro for Playtech Tutorial: Using Silver's Scripts. Video6.

Plus the latest project file.
"What we do in life, echoes in eternity"

*Link Removed*  The Roulette Professor. *Link Removed*

ThomasGrant

Check out this video I did.
This is showing RSS Pro running at Playtech at full speed.
And I only have half the bets done so far.

Tom's RSS Pro for Playtech Tutorial: Using Silver's Scripts. Video7.
"What we do in life, echoes in eternity"

*Link Removed*  The Roulette Professor. *Link Removed*

ThomasGrant

I was not to happy with the way this tutorial was going.
But have decided to carry on anyway...

A great deal of time is spent on looking things up.
On how to do things.
Or what does what.

Recently, I have tried to understand more of this amazing software.
Had a look into Databases.
How to create them.
How to send info to them.
Still have no clue...

I delved into Tabs...
How to use them.

I looked into memos.
How to save the info from them.

All sorts of stuff.

There are many problems when trying to code for this software.
1. There is not a great deal of help.
2. I have to constantly look up for help in Delphi webpages.
3. Then I have to convert what I read in Delphi to what I can do in RSS Pro.
4. It takes time.

But enough of me complaining...

And onto some interesting code.

One of my pet peeves is window positions.
When you close the software.
It should, on close. Remember where it was on your screen.
I was having no end of trouble figuring this out.
It works fine for the single window.
Or single form.
But when you try to load a second form.
And have it go to the last saved position where you left it.
Well... it was a nightmare trying to solve it.
First I looked into database.
How to save the window position to the database.
That proved way to hard.
And I still haven't figured out databases.
Maybe one day.
Then I can do a tutorial on that.

Anyway...
Back to window positions on the second form.
Oy veay...
So I went back to my original idea.
There must be a way to save the window position on the other form.
You see it all has to do with Self.Top and Self.Left
Since every form you create has it's own self.top and self.left
But when you close the form.
I sends that info to the first form.
So when you close it.
And open it again.
It opens in a different area.
Maddening...

Now I have posted these before.
But here they are again.

Here is the procedure I use to load the window position.
procedure load_winpos;
begin
    AssignFile(F,'c:\rss-data\winpos');{If no file exist. Then you will get an error message}
    Reset(F);{open the file for reading}
    i := 0;
    while not eof(F) do {loop that will repeat until the end of file will be not found}
    begin
        S:=ReadLn(F); {read the first line into "s" variable}
        if i=0 then Self.Top:=s;
        if i=1 then Self.Left:=s;
        i := i+1;
    end;
    Self.ClientHeight:=368;
    CloseFile(F);//close the file
end;


Fairly straight forward.
Ahh, but then came the awakening...
I had to have that part first.

Then do the save window position like this.
procedure close_me;
begin
    if Self.Top<0 then Self.Top:=0;
    if Self.Left<0 then
    begin
        Self.Left:=0;
        load_winpos;
    end;
    AssignFile(F,'c:\rss-data\winpos');
    Rewrite(F);             
    Writeln(F,Self.Top);
    Writeln(F,Self.Left);
    CloseFile(F);
end;


But that ain't the sneaky part...

This is.
This code is on the second form.
procedure close_me;
begin
    if Self.Top<0 then Self.Top:=0;
    if Self.Left<0 then
    begin
        Self.Left:=0;
        load_winpos;
    end;
    AssignFile(F,'c:\rss-data\set_winpos');
    Rewrite(F);             
    Writeln(F,Self.Top);
    Writeln(F,Self.Left);
    CloseFile(F);
    Self.Left:=-1000;
    Close();
end;
{####

The load_winpos; procedure is the same.
Only the name of the data file to save the position to, is changed.

So what happens in the other close, on the other form is this.
On close.
It moves it's self to the left -1000
Now before it does that.
It saves the original window position.
Then it closes.

Now before you close form2.
It does this.
if Self.Left<0 then
    begin
        Self.Left:=0;
        load_winpos;
    end;


So what it does, is it sees that the Self.Left is less than 0;
So it reloads the original winpos from the file.
Then closes it.

Wow, that took ages to work out.
Probably not the best way to do things.
But since I don't know how to save .ini files for each window.
I have to make do with what I know works for me.

If you know a better way to do this.
Then please tell me.
I have looked.
Believe me.

What works in Delphi.
Does not mean it will work in RSS Pro.
And vice a versa.
Especially when it comes to arrays.

Ohh well...

I just keep plodding along.

Right now I am trying different ways to communicate between forms.
Trying to find the best way for my settings to displayed.
And read. And then modified.

Frak it is hard...
"What we do in life, echoes in eternity"

*Link Removed*  The Roulette Professor. *Link Removed*

ThomasGrant

Hi ho Silver to the rescue...

Silver does it again...

I ask him how to do something.
And he sends me the answer.

What great support.

I asked him how he would do the save window position.
As I was having no end of trouble.
Knew there had to be a better way.

And here is his answer.

procedure Form3Close(Sender: TObject; var Action: TCloseAction);
var x:TForm;
begin
  x:=Sender;
  AssignFile(F,'c:\winpos3');
  Rewrite(F);             
  Writeln(F,x.Top);
  Writeln(F,x.Left);
  CloseFile(F);
end; 


And when you read that.
You can see that x:=Sender;
Comes from the
procedure Form3Close(Sender: TObject; var Action: TCloseAction);
So the information comes from that form.
And not any others.
"What we do in life, echoes in eternity"

*Link Removed*  The Roulette Professor. *Link Removed*

-