image logo
top image
MONEY MAKER MACHINE
mask top 2
rg
maks button orange

RSS Full Guide

 

Roulette Scripter Studio Lessons

 

1. RSS introduction. “Hello world !”. (The basic structure of the script, comments.)

 

2. Variables and Variable types. Printing text. (declaration of variables, assigning values to a variables, print the values of variables.)

 

3. Reserved functions for casino. (placing bets, select chips, using the table.)

 

4. Arithmetic Statements and Operators.

 

5. If, if else, Case, relational operators. Logical Operators and Boolean Expressions.

 

6. For, Repeat ... Until, and While (all about loops).

 

7. First script based on a real system. (Practice in write a real script that work using all information from previous lessons.)

 

8. RSS - secrets (Using Step over, Trace into, Watches, ...).

 

9. Array structures.

 

1. RSS introduction. “Hello world !”. (The basic structure of the script, comments.)

 

So, lets get started with the first RSS language lesson.

0.
First of all read - what is RSS.
http://www.money-maker-machine.com/roulette-scripter-studio-full-guide.htm
http://www.money-maker-machine.com/create-your-roulette-system-using-roulette-scripter-studio.htm

I.
Type in the Code Explorer the following code exactly as you see it:

begin
  print('Hello World !');
end;


Run your script by selecting Run from the Debug-menu (or press F9).
You will notice that the text
Hello world ! appeared in the console.
You have just written your first RSS script!

Let modify your first script:
begin
  print('Hello World !');
  print('Hello Casino - I will bet you soon !');
end;


notes :

  • In order to clear the console - select Clear Console from the View-menu .
  • Using File-menu you can save and open your scripts.
  • The words begin and end followed by a semicolon ( end; ) indicates where the script begin and end.
  • The word print print a text on the console. What is written is whatever you write within the print-command (between the two ' -characters).
  • Semicolon ( ; ) indicates how long the RSS is supposed to translate before beginning with the next command.



II.
The basic structur
e of a RSS script is:

USES (* libraries declarations *)

VAR  (* Variable declarations *)

(* functions and procedures *)

BEGIN
  (* Executable statements *)
END;


The elements of a script must be in the correct order, though some may be omitted if not needed.

Here's a script that does nothing, but has all the required elements:
begin
end;


III.
Comments are things that are used to explain what parts of a script do. Comments are ignored by the RSS and are only there for the people who use the script.
Comments must be put between curly brackets. Also you may use double slash -  in order to comment only one line.
You should always have a comment at the top of your script to say what it does as well as comments for any script that is difficult to understand. Here is an example of how to comment the script we just made:

{This script will print "Hello world !" and will not print "Hello Casino - I will bet you soon !".}
begin
  print('Hello World !');
  //print('Hello Casino - I will bet you soon !');
end;


IV.
Indentation

You will notice that there are 2 spaces in front of some of the commands. This is called indentation and it is used to make a script easier to read. A lot of beginners do not understand the reason for indentation and don't use it but when we start making longer, more complex scripts, you will understand.

The next two scripts runs perfectly. The only difference is: neatness and friendliness of the second.
the first:
begin
  print('Hello World !');
  print('Hello Casino - I will bet you soon !');
end;


the second:
begin print('Hello World !'); print('Hello Casino - I will bet you soon !'); end;

V.
Write a script to print the the following words on the console.
          Hello. What are you doing now?
          I am writing my first RSS script.

 

 2. Variables and Variable types. Printing text. (declaration of variables, assigning values to a variables, print the values of variables.)

 

I.
What are variables?

Variables are names given to blocks of the computer's memory. The names are used to store values in these blocks of memory.

Variables can hold values which are either numbers, strings or Boolean. We already know what numbers are. Strings are made up of letters. Boolean variables can have one of two values, either True or False.

Variables are names that allow you to reference stored values.

Rules for variables:

  • Must begin with a letter from the English alphabet.
  • Can be followed by alphanumeric characters (alphabetic characters and numerals) and possibly the underscore (_).
  • May not contain certain special characters, many of which have special meanings in RSS.
          ~ ! @ # $ % ^ & * ( ) + ` - = { } [ ] : " ; ' < > ? , . / |



Several names are reserved in RSS as syntactical elements. You are not allowed to use these for your variables. These include but are not limited to:
and array begin case const div do downto else end file for forward function goto if in label mod nil not of or packed procedure program record repeat set then to type until var while with

II.
Using variables


Variables store values and information. They allow scripts to perform calculations and store data for later retrieval. Variables store numbers, names, text messages, etc.
RSS supports
FOUR standard variable types, which are

Integer

- store whole numbers

Real or Float

- numbers which include decimal places

String

- store characters

Boolean

- also called logical variables, can only have one of two possible states - true or false



You must always declare a variable before you use it.
As we seen in
Lesson 1 , that we have var section there. That's where we suppose to declare our variables.

Here is an example of how to declare a variable named
start_balance :
var start_balance;
begin
end;


To assign a value to a variable we use
:= .
var start_balance;
begin
    start_balance:=120;
end;


You can create 2 or more variables if you separate their names with commas.
You can also create variables using another
var statement.
When you assign a value to a string variable, you must put it between single quotes.
Boolean variables can only be assigned the values True and False.

var start_balance, stop_loss;
var str1, b, chip1;
begin
    start_balance:=120;
    str1:='Hello';
    b:=True;
    chip1:=0.10;
end;


Here we have start_balance - integer; str1 - string; b - boolean; chip1 - float.

III.
Printing variables or text
on the console is just as easy. If you want to print variables and text - use the command print .

var str1;
begin
    print('------');
    str1:='Hello';
    print(str1);
    str1:='World !';
    print(str1);
end;


var start_balance;
begin
    start_balance:=120;
    print('Start balance is');
    print(start_balance);
end;


or the same, using variable
str1 :

var start_balance, str1;
begin
    start_balance:=120;
    str1:='Start balance is';
    print(str1);
    print(start_balance);
end;

 

3. Reserved functions for casino. (placing bets, select chips, using the table.)

 

I.
RSS can play Online Roulette and this mean it can bet on all roulette elements and can recognize landed numbers.
How it do this? Sure via our roulette routines embeded into RSS.
So after RSS IDE was started the next step is to start the online casino you want to use.

 

 

 

Look on the top left corner of the roulette window and you will see "European Roulette - onlineCasino.com"
This is the roulette window name that point to RSS which roulette window to use because in the same time you
can use more then one roulette window while playing.
Also for other language installations the roulette window name can differ from this one.

So the first procedure you will use in every script will be
set_roulette_window_name('Roulette_Window_Name');
For our example we will have the next code:

begin
set_roulette_window_name('European Roulette - onlineCasino.com');
end;


II.
Another most used procedure will be
click_spin() that will do a free spin.

So now when we know at least 2 procedures let write our first simple code and to run it.

begin
set_roulette_window_name('European Roulette - onlineCasino.com');
click_spin();
end;


note: instead of European Roulette - onlineCasino.com - you may write your casino's window name.

So RSS can perform all possible roulette table clicks.

The most important procedures from RSS are:
  - clicks on buttons;
  - clicks on chips;
  - clicks on table elements;
  - getting the last landed number;

III.
Click on buttons:
click_spin(); - perform roulette spin procedure.
click_clear_bets(); - perform roulette clear bets procedure.
click_rebet(); - perform roulette rebet procedure.

Click on chips:
click_chip1();
click_chip2();
click_chip3();
click_chip4();
click_chip5();
click_chip6();
click_chip7();


Click on table elements:
a) bet on single numbers:

click_straight_up_0();
click_straight_up_1();
click_straight_up_2();
click_straight_up_3();
click_straight_up_4();
click_straight_up_5();
click_straight_up_6();
click_straight_up_7();
click_straight_up_8();
click_straight_up_9();
click_straight_up_10();
click_straight_up_11();
click_straight_up_12();


click_straight_up_13();
click_straight_up_14();
click_straight_up_15();
click_straight_up_16();
click_straight_up_17();
click_straight_up_18();
click_straight_up_19();
click_straight_up_20();
click_straight_up_21();
click_straight_up_22();
click_straight_up_23();
click_straight_up_24();


click_straight_up_25();
click_straight_up_26();
click_straight_up_27();
click_straight_up_28();
click_straight_up_29();
click_straight_up_30();
click_straight_up_31();
click_straight_up_32();
click_straight_up_33();
click_straight_up_34();
click_straight_up_35();
click_straight_up_36();



b) bet on splits

click_split_bet_0_1();
click_split_bet_0_2();
click_split_bet_0_3();
click_split_bet_1_2();
click_split_bet_2_3();
click_split_bet_1_4();
click_split_bet_2_5();
click_split_bet_3_6();
click_split_bet_4_5();
click_split_bet_5_6();
click_split_bet_4_7();
click_split_bet_5_8();
click_split_bet_6_9();
click_split_bet_7_8();
click_split_bet_8_9();

click_split_bet_7_10();
click_split_bet_8_11();
click_split_bet_9_12();
click_split_bet_10_11();
click_split_bet_11_12();
click_split_bet_10_13();
click_split_bet_11_14();
click_split_bet_12_15();
click_split_bet_13_14();
click_split_bet_14_15();
click_split_bet_13_16();
click_split_bet_14_17();
click_split_bet_15_18();
click_split_bet_16_17();
click_split_bet_17_18();

click_split_bet_16_19();
click_split_bet_17_20();
click_split_bet_18_21();
click_split_bet_19_20();
click_split_bet_20_21();
click_split_bet_19_22();
click_split_bet_20_23();
click_split_bet_21_24();
click_split_bet_22_23();
click_split_bet_23_24();
click_split_bet_22_25();
click_split_bet_23_26();
click_split_bet_24_27();
click_split_bet_25_26();
click_split_bet_26_27();

click_split_bet_25_28();
click_split_bet_26_29();
click_split_bet_27_30();
click_split_bet_28_29();
click_split_bet_29_30();
click_split_bet_28_31();
click_split_bet_29_32();
click_split_bet_30_33();
click_split_bet_31_32();
click_split_bet_32_33();
click_split_bet_31_34();
click_split_bet_32_35();
click_split_bet_33_36();
click_split_bet_34_35();
click_split_bet_35_36();



c) bet on Streets:
click_street_bet_0_1_2();
click_street_bet_0_2_3();
click_street_bet_1_2_3();
click_street_bet_4_5_6();
click_street_bet_7_8_9();
click_street_bet_10_11_12();
click_street_bet_13_14_15();
click_street_bet_16_17_18();
click_street_bet_19_20_21();
click_street_bet_22_23_24();
click_street_bet_25_26_27();
click_street_bet_28_29_30();
click_street_bet_31_32_33();
click_street_bet_34_35_36();

d) bet on Corners:

click_corner_bet_1_2_4_5();
click_corner_bet_2_3_5_6();
click_corner_bet_4_5_7_8();
click_corner_bet_5_6_8_9();
click_corner_bet_7_8_10_11();
click_corner_bet_8_9_11_12();
click_corner_bet_10_11_13_14();
click_corner_bet_11_12_14_15();
click_corner_bet_13_14_16_17();
click_corner_bet_14_15_17_18();
click_corner_bet_16_17_19_20();

click_corner_bet_17_18_20_21();
click_corner_bet_19_20_22_23();
click_corner_bet_20_21_23_24();
click_corner_bet_22_23_25_26();
click_corner_bet_23_24_26_27();
click_corner_bet_25_26_28_29();
click_corner_bet_26_27_29_30();
click_corner_bet_28_29_31_32();
click_corner_bet_29_30_32_33();
click_corner_bet_31_32_34_35();
click_corner_bet_32_33_35_36();



e) bet on lines:
click_line_bet_1_2_3_4_5_6();
click_line_bet_4_5_6_7_8_9();
click_line_bet_7_8_9_10_11_12();
click_line_bet_10_11_12_13_14_15();
click_line_bet_13_14_15_16_17_18();
click_line_bet_16_17_18_19_20_21();
click_line_bet_19_20_21_22_23_24();
click_line_bet_22_23_24_25_26_27();
click_line_bet_25_26_27_28_29_30();
click_line_bet_28_29_30_31_32_33();
click_line_bet_31_32_33_34_35_36();

f) bet on dozens:
click_first_dozen_bet();
click_second_dozen_bet();
click_third_dozen_bet();

g) bet on columns:
click_first_column_bet();
click_second_column_bet();
click_third_column_bet();

h) bet on Low/High, Odd/Even, Black/Red and Four bet:
click_low();
click_high();
click_even();
click_odd();
click_black();
click_red();
click_four_bet();

i) getting the last landed number
get_landed_number();

IV.
Examples

Now you will see some examples based on the routines listed above:

a) Ex. that bet 10 units (chip nr.3) on column3 and make a spin.
begin
    set_roulette_window_name('European Roulette - onlineCasino.com');
    click_chip3();
    click_third_column_bet();
    click_spin();
    print('We have bet chip nr.3 on the Third column');
end;


b) Ex. that bet 17 units on column3, 34 units on split 2_5, make a spin and print the landed number.
begin
    set_roulette_window_name('European Roulette - onlineCasino.com');
    click_chip3();
    click_third_column_bet();
    click_chip2();
    click_third_column_bet();
    click_chip1();
    click_third_column_bet();
    click_chip1();
    click_third_column_bet();
    click_chip4();
    click_split_bet_2_5();
    click_chip2();
    click_split_bet_2_5();
    click_chip1();
    click_split_bet_2_5();
    click_chip1();
    click_split_bet_2_5();
    click_chip1();
    click_split_bet_2_5();
    click_chip1();
    click_split_bet_2_5();
    click_spin();
    print('Landed number is:');
    print(get_last_number());
end;


for better look this script may look like this
begin
    set_roulette_window_name('European Roulette - onlineCasino.com');
    click_chip3(); click_third_column_bet();
    click_chip2(); click_third_column_bet();
    click_chip1(); click_third_column_bet();
    click_chip1(); click_third_column_bet();
    click_chip4(); click_split_bet_2_5();
    click_chip2(); click_split_bet_2_5();
    click_chip1(); click_split_bet_2_5();
    click_chip1(); click_split_bet_2_5();
    click_chip1(); click_split_bet_2_5();
    click_chip1(); click_split_bet_2_5();
    click_spin();
    print('Landed number is:');
    print(get_last_number());
end;


c) Ex. that bet 17 units on column3, 17 units on dozen1 make a spin and print the landed number.
Then bet 33 units on split 2_5, 35 units on split 8_9, make a spin and print the landed number.
begin
    set_roulette_window_name('European Roulette - onlineCasino.com');
    click_chip3();
    click_third_column_bet();
    click_first_dozen_bet();
    click_chip2();
    click_third_column_bet();
    click_first_dozen_bet();
    click_chip1();
    click_third_column_bet();
    click_first_dozen_bet();
    click_chip1();
    click_third_column_bet();
    click_first_dozen_bet();
    click_spin();
    print('We have bet 17 on column3 and 17 on dozen1. Landed number is:');
    print(get_last_number());
    click_chip4();
    click_split_bet_2_5();
    click_split_bet_8_9();
    click_chip2();
    click_split_bet_2_5();
    click_chip1();
    click_split_bet_2_5();
    click_chip1();
    click_split_bet_2_5();
    click_chip1();
    click_split_bet_2_5();
    click_chip3();
    click_split_bet_8_9();
    click_spin();
    print('We have bet 33 on split 2_5 and 35 units on split 8_9. Landed number is:');
    print(get_last_number());
end;


for better look this script may look like this
begin
    set_roulette_window_name('European Roulette - onlineCasino.com');
    click_chip3(); click_third_column_bet(); click_first_dozen_bet();
    click_chip2(); click_third_column_bet(); click_first_dozen_bet();
    click_chip1(); click_third_column_bet(); click_first_dozen_bet();
    click_chip1(); click_third_column_bet(); click_first_dozen_bet();
    click_spin();
    print('We have bet 17 on column3 and 17 on dozen1. Landed number is:');
    print(get_last_number());
    click_chip4(); click_split_bet_2_5(); click_split_bet_8_9();
    click_chip2(); click_split_bet_2_5();
    click_chip1(); click_split_bet_2_5();
    click_chip1(); click_split_bet_2_5();
    click_chip1(); click_split_bet_2_5();
    click_chip3(); click_split_bet_8_9();
    click_spin();
    print('We have bet 33 on split 2_5 and 35 units on split 8_9. Landed number is:');
    print(get_last_number());
end;

 

4. Arithmetic Statements and Operators.

 

I.
Once you have declared a variable, stored values in it (lesson 2) - next step is perform calculations.

The arithmetic operators in RSS are:

Operator

Operation

Operands

Result

+

Addition or unary positive

real or integer

real or integer

-

Subtraction or unary negative

real or integer

real or integer

*

Multiplication

real or integer

real or integer

/

Real division

real or integer

real

div

Integer division

integer

integer

mod

Modulus (remainder division)

integer

integer

 

 

 

 



notes:
-
div and mod - only work on integers.
-
/ - works on both reals and integers but will always yield a real answer.
- the other operations work on both reals and integers.
- when mixing integers and reals, the result will always be a real since data loss would result otherwise.
- the value of
x div y is the value of x/y rounded in the direction of zero to the nearest integer.
- the
mod operator returns the remainder obtained by dividing its operands. In other words, x mod y = x – (x div y) * y
- a runtime error occurs when
y is zero in an expression of the form x/y, x div y, or x mod y.

II.
Examples:


a) Addition Example
var number1, number2, result : integer;
begin
    number1 := 10;
    number2 := 20;
    result := number1 + number2;
    print(number1); print('plus'); print(number2);
    print('is'); print(result);
end;


b) Subtraction Example
var number1, number2, result : integer;
begin
    number1 := 15;
    number2 := 2;
    result := number1 - number2;
    print(number1); print('minus'); print(number2);
    print('is'); print(result);
end;


c) Multiplication  Example
var number1, number2, result : integer;
begin
    number1 := 5;
    number2 := 7;
    result := number1 * number2;
    print(number1); print('multiplied by'); print(number2);
    print('is'); print(result);
end;


d) Division Example
var number1, number2, result : integer;
begin
    number1 := 21;
    number2 := 4;
    result := number1 / number2;
    print(number1); print('divided by'); print(number2);
    print('is'); print(result);
end;


e) Integer division Example
var number1, number2, result : integer;
begin
    number1 := 21;
    number2 := 4;
    result := number1 div number2;
    print(number1); print('integer divided by'); print(number2);
    print('is'); print(result);
end;


f) Modulus(remainder division) Example
var number1, number2, result : integer;
begin
    number1 := 21;
    number2 := 4;
    result := number1 mod number2;
    print(number1); print('remainder division by'); print(number2);
    print('is'); print(result);
end;


III. Pay attention

In RSS, the minus sign can be used to make a value negative.

Do not attempt to use two operators side by side, like in:
number := 37.5 * -2;
This may make perfect sense to you, since you're trying to multiply by negative -2. However, RSS will be confused — it won't know whether to multiply or subtract. You can avoid this by using parentheses to clarify:
number := 37.5 * (-2);

The computer follows an order of operations similar to the one that you follow when you do arithmetic. Multiplication and division (* / div mod) come before addition and subtraction (+ -), and parentheses always take precedence. So, for example, the value of: 3.5*(2+3) will be 17.5.

 

Lesson 5. If, if else, Case, relational operators. Logical Operators and Boolean Expressions.

 

I.
IF statement.


The if statement allows a program to make a decision based on a condition. The IF statement allows you to branch based on the result of a Boolean operation.
The one-way branch format is:

if BooleanExpression then StatementIfTrue;

If the Boolean expression evaluates to true, the statement executes. Otherwise, it is skipped.

Ex.5.1: The following example make a spin and tell us if landed number is High:
var landed_number;
begin
    set_roulette_window_name('European Roulette - onlineCasino.com');
    click_spin();
    landed_number:=get_last_number();
    if landed_number >=18 then print('Landed number is High');
end;


In case more than one action is required, you must use a
begin-end to enclose the statements:
if BooleanExpression then begin
  Statement1;
  Statement2;
  ...
end;


Ex.5.2: The following example make a spin, tell us if landed number is High, and in case it is High - will bet chip2 on Low.
var landed_number;
begin
    set_roulette_window_name('European Roulette - onlineCasino.com');
    click_spin();
    landed_number:=get_last_number();
    if landed_number >=18 then begin
      print('Landed number is High');
      print('Will bet chip nr.2 on Low');
      click_chip2();
      click_low();
      click_spin();
    end;
end;


II.
Relational operators.


Here is a table of the operators than can be used in conditions:

  >      Greater than
  <      Less than
  >=    Greater than or equal to
  <=    Less than or equal to
  =      Equal to
  <>    Not equal to

III.
IF with else

The above example 5.1 only tells you if the number is High. If you want it to tell you that it is not High then we use
else .

if BooleanExpression then StatementIfTrue
                                        else StatementIfFalse;

note: When you use else you must not put a semi-colon on the end of the command before it.

Ex.5.3: The following example make a spin and tell us if landed number is High or no:
var landed_number;
begin
    set_roulette_window_name('European Roulette - onlineCasino.com');
    click_spin();
    landed_number:=get_last_number();
    if landed_number >=18 then print('Landed number is High')
                                                else print('Landed number is not High - it is Low or Zero');
end;


In case more than one action is required after else, you use a
begin-end to enclose the statements:

Ex.5.4: The following example make a spin, tell us if landed number is High, and in case it is High - will bet chip2 on Low, in case it is not High - will bet chip2 on High.
var landed_number;
begin
    set_roulette_window_name('European Roulette - onlineCasino.com');
    click_spin();
    landed_number:=get_last_number();
    if landed_number >=18 then begin
      print('Landed number is High');
      print('Will bet chip nr.2 on Low');
      click_chip2();
      click_low();
      click_spin();
    end else begin
      print('Landed number is not High - it is Low or Zero');
      print('Will bet chip nr.2 on High');
      click_chip2();
      click_high();
      click_spin();
    end;
end;


And because the operator click_spin() will e executed anyway - we may write it once instead of write it in 2 positions.
Ex.5.4.1: The following example make a spin, tell us if landed number is High, and in case it is High - will bet chip2 on Low, in case it is not High - will bet chip2 on High.
var landed_number;
begin
    set_roulette_window_name('European Roulette - onlineCasino.com');
    click_spin();
    landed_number:=get_last_number();
    if landed_number >=18 then begin
      print('Landed number is High');
      print('Will bet chip nr.2 on Low');
      click_chip2();
      click_low();
    end else begin
      print('Landed number is not High - it is Low or Zero');
      print('Will bet chip nr.2 on High');
      click_chip2();
      click_high();
    end;
    click_spin();
end;


IV.
Nesting IF statements.

You can also use IF statements inside other IF statements.

if Condition1 then
  Statement1
else
  if Condition2 then
    Statement2
  else
    Statement3;


Be careful with nesting. Sometimes the computer won't do what you want it to do:
if Condition1 then
  if Condition2 then
    Statement2
else
  Statement1;


The else is always matched with the most recent if, so the computer interprets the preceding block of code as:
if Condition1 then
  if Condition2 then
    Statement2
  else
    Statement1;


You can get by with a null statement:
if Condition1 then
  if Condition2 then
    Statement2
  else
else
  Statement1;


or you could use a begin-end block.
if Condition1 then begin
  if Condition2 then Statement2;
end else Statement1;


But the best way to clean up the code would be to rewrite the condition.
if not Condition1 then
  Statement1
else
  if Condition2 then Statement2;


V.
Case..of

The case command is like an if statement but you can have many conditions with actions for each one.

Suppose we have to select what dozen to bet. Say, we have 3 options based on dozen number, and 0 is Zero. The if example would be like this:

if dozen=1 then
  click_first_dozen_bet()
else   { remain dozen2, dozen3 and 0 }
  if dozen=2 then
    click_second_dozen_bet()
  else   { remain dozen3 and 0 }
    if dozen=3 then
      click_third_dozen_bet()
    else   { 0 goes here }
      click_straight_up_0();


This is pretty long. Now see this:

case dozen of
    1: click_first_dozen_bet();
    2: click_second_dozen_bet();
    3: click_third_dozen_bet();
    else click_straight_up_0();
end;

Simple and elegant !

In case more than one action is required, you must use a
begin-end to enclose the statements:

case dozen of
    1: begin
          click_first_dozen_bet();
          click_first_column_bet();
        end;
    2: click_second_dozen_bet();
    3: click_third_dozen_bet();
    else click_straight_up_0();
end;


VI.
Logical Operators

The logical operators are expressions which return a false or true result over a conditional expression. They are also used in assignments (an example of this would be shown later). Such  operators consist of simple logical operators, such as 'Not' or 'And'. They should be used between two conditional expressions ; for example:

If (x = 0) AND (a = 2) then...

note: When combining two Boolean expressions using relational and Boolean operators, be careful to use parentheses.

There are three types of logical operators, each of which are concerned with conditional expressions. These are:

    AND - conjunction
    OR - disjunction
    NOT - negation

All of these logical operators have a different effect on the conditional expressions. Let's see what each of the logical operator does two (or more) conditional expressions...

NOT is a unary operator — it is applied to only one value and inverts it:
    * not true = false
    * not false = true

AND return TRUE only if both values are TRUE:
    * TRUE and FALSE = FALSE
    * TRUE and TRUE = TRUE

OR return TRUE if at least one value is TRUE:
    * TRUE or TRUE = TRUE
    * TRUE or FALSE = TRUE
    * FALSE or TRUE = TRUE
    * FALSE or FALSE = FALSE

Examples:
if (landed_number>=1)and(landed_number<=12) then print('Number is from Dozen1');

if not((landed_number>=1)and(landed_number<=12)) then print('Number is not from Dozen1');

if (landed_number<=12)or(landed_number>=25) then print('Number is from Dozen1 or from Dozen3 or it is Zero');

if ((landed_number<=12)or(landed_number>=25))and(landed_number<>0) then print('Number is from Dozen1 or from Dozen3, and it is not Zero.');

if ((landed_number<=12)or(landed_number>=25))and(landed_number<>0)
  then print('Number is from Dozen1 or from Dozen3, and it is not Zero.')
  else print('Number is from Dozen2.');


VII.
The Boolean Expressions


The boolean expressions are the terms '
true ' and ' false '. These are simply similar to 1's (for true) and 0's(for false). They describe an expression whether it is false or true . The variable types over boolean expressions is the 'boolean' type.

Example: will bet on dozen2 and on dozen3 if landed_number is from dozen1.


var isDozen1, landed_number;
begin
    set_roulette_window_name('European Roulette - onlineCasino.com');
    click_spin();
    landed_number:=get_last_number();
    isDozen1:=False;//any variable must be initialize first
    if ((landed_number>=1)and(landed_number<=12)) then isDozen1:=True;
    if isDozen1 then begin
      click_chip2();
      click_second_dozen_bet();
      click_third_dozen_bet();
      click_spin();
      print('We have bet chip2 on dozen2 and on dozen3');
      print('Landed number is');
      print(get_last_number());
    end else print('Landed number is not Dozen1');
end;

 

Lesson 6. For, Repeat ... Until, and While (all about loops).

 

0. Loops
Loops are used when you want to repeat code a lot of times. For example, if you wanted to print "Hello" on the screen 10 times you would need 10
print commands. You could do the same thing by putting 1 print command inside a loop which repeats itself 10 times.

There are 3 types of loops which are the
for loop, while loop and repeat until loop.

I.
FOR loop


The for loop uses a loop counter variable, which it adds 1 to each time, to loop from a first number to a last number.
The general form is:
for index := StartingLow to EndingHigh do statement;

Ex.6.1: The following example will print the text
Hello 10 times:
var k;
begin
  for k:=1 to 10 do print('Hello !');
end;


If you want to have more than 1 command inside a loop then you must put them between a begin and an end.

Ex.6.2: The following example make 500 spins, and after each zero landed will bet on High:
var k, landed_number;
begin
    set_roulette_window_name('European Roulette - onlineCasino.com');
    for k:=1 to 500 do begin
      click_spin();
      landed_number:=get_last_number();
      if landed_number=0 then begin
        print('Landed number is Zero');
        print('Will bet chip nr.2 on High');
        click_chip2();
        click_high();
      end;
    end;
end;


In the
for-to-do loop, the starting value MUST be lower than the ending value, or the loop will never execute! If you want to count down, you should use the for-downto-do loop:
for index:=StartingHigh downto EndingLow do statement;

Ex.6.3: The following example will print the value of variable K from High to Low order:
var k;
begin
  for k:=10 downto 1 do print(k);
end;


II.
While loop


The while loop repeats while a condition is true. The condition is tested at the top of the loop and not at any time while the loop is running as the name suggests. A while loop does not need a loop variable but if you want to use one then you must initialize its value before entering the loop.

The pretest loop has the following format:
while BooleanExpression do statement;

The loop continues to execute until the Boolean expression becomes FALSE. In the body of the loop, you must somehow affect the Boolean expression by changing one of the variables used in it. Otherwise, an infinite loop will result:
Example of infinite loop:
a := 5;
while a < 6 do
  print (a);


Remedy this situation by changing the variable's value:
a := 5;
while a < 6 do
  begin
    print (a);
    a := a + 1
  end;


The WHILE ... DO lop is called a pretest loop because the condition is tested before the body of the loop executes. So if the condition starts out as FALSE, the body of the while loop never executes.

Ex.6.4: The following example make free spins till 0 lands, and in this case will bet chip2 on Low.
var landed_number;
begin
    set_roulette_window_name('European Roulette - onlineCasino.com');
    landed_number:=-1;
    while landed_number<>0 do begin
      click_spin();
      landed_number:=get_last_number();
    end;
    print('Landed number = 0.');
    print('Will bet chip nr.2 on Low');
    click_chip2();
    click_low();
    click_spin();
end;


III.
Repeat loop


The repeat until loop is like the while loop except that it tests the condition at the bottom of the loop. It also doesn't have to have a begin and an end if it has more than one command inside it.

The posttest loop has the following format:
    repeat
        statement1;
        statement2
      until BooleanExpression;


  In a repeat loop, compound statements are built-in -- you don't need to use begin-end. Also, the loop continues until the Boolean expression is TRUE, whereas the while loop continues until the Boolean expression is FALSE.

This loop is called a posttest loop because the condition is tested after the body of the loop executes. The REPEAT loop is useful when you want the loop to execute at least once, no matter what the starting value of the Boolean expression is.

Ex.6.5: The following example make free spins till 0 lands, and in this case will bet chip2 on Low.
var landed_number;
begin
    set_roulette_window_name('European Roulette - onlineCasino.com');
    repeat
      click_spin();
      landed_number:=get_last_number();
    until landed_number=0;
    print('Landed number = 0.');
    print('Will bet chip nr.2 on Low');
    click_chip2();
    click_low();
    click_spin();
end;


IV.
Break and Continue


The Break command will exit a loop at any time. The following script will print only first 5 values and will  exits the loop.
var k;
begin
    k:=0;
    repeat
      k := k + 1;
      print('Hello!');
      if K>5 then Break;
      print(k);
    until K=10;
end;


The Continue command will jump back to the top of a loop. This example will print 10 times Hello and only 5 times the value of K.
var k;
begin
    k:=0;
    repeat
      k:=k+1;
      print('Hello!');
      if K>5 then Continue;
      print(k);
    until k=10;
end;

 

Lesson 7. First script based on a real system.

 

First script based on a real system. (Practice and write a real script using all information from previous lessons.)

In this lesson I will show you an example of simple script that was written based on all information from previous lessons.
The only things I have added are the next:
1. function
delay - it is used on clear the table from the REBET button.
2. conversion function
IntToStr - it is used to print the numbers (ex: balance).

So the system is simple - it wait for HIGH not to land for X spins in a row (I have set it = 6, and you may change it).
Then it place only 1 bet on HIGH(I have set = $1).
At any result the script again wait HIGH not to land X spins in a row.
The script will stop in 2 cases:
1. in case it reach the wishing amount.
2. in case it reach the stop loss.

In this script you may change the values of alert, bet_value, start_amount, wish_amount, stop_loss.
So you may do the changes in the next lines: line10, line11, line 14, line18, line 21, line23, line33.
You need only to copy the next code into the RSS, change the casino window name, and other changes, open the casino window, and press Run button.

 

Code:


{Script that bet 1 chip on sleeping high.}

var start_amount, wish_amount, amount, spin_count, was_betting, stop_loss;
var didnt_apear, bet_value, alert, last_number;

begin
  {Wait for high not to hit in "X" times, and then bet only 1 bet on high, then again wait.}

  didnt_apear:=0; //indicate how much spins the element didn't land
  alert:=6; //indicate how much spins we must wait for high didn't apear
  bet_value:=1; // bet value

  //enter the start_amount
  start_amount:=5775;
  amount:=start_amount;//current amount became start_amount

  //enter how much you want to increase your start_amount
  wish_amount:=start_amount+4;

  //enter the stop_loss, if stop_loss=0 it will not be used, with other words stop_loos will be the end of balance
  stop_loss := start_amount-10;

  set_roulette_window_name('Roulette Pro - Casino Tropez'); //set roulette window name

  spin_count:=1; was_betting:=1;

while amount<wish_amount do begin //begin of a loop
  if (was_betting=1) then begin delay(300);click_chip2();click_red();delay(300);click_chip2();click_even();delay(600);click_clear_bets(); end;//clear the table from REBET button
  was_betting:=0;

  if didnt_apear>=alert then begin //here we check if high didn't apear the wished spins
    print('Start betting on high.');
    click_chip2(); //select needed chip here we must check that chip1=bet_value
    click_high(); // place selected chip on the HIGH
    was_betting:=1; //indicate that we have place a bet
  end;
  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

  click_spin; //make a spin
  last_number:=get_last_number(); //assign to the variable last_number the value of landed number

  if (last_number>=19)and(last_number<=36) then begin//we check that we we have the high number
    didnt_apear:=0;//in case the high land counter is again 0
    if was_betting=1 then begin // here we check we we have bet
      amount:=amount+bet_value;//in case the high win we increase the amount
      print('We have bet $'+IntToStr(bet_value)+' on high and win.');
    end;
  end else begin
    if was_betting=1 then begin
      amount:=amount-bet_value;//in case the high lose we decrese amount with how much we bet
      print('We have bet $'+IntToStr(bet_value)+' on high and lose.');
      didnt_apear:=0;//in case we lose counter is again 0
    end else didnt_apear:=didnt_apear+1;//in case the high didn't land counter is increased
  end;

  print('Spin count - '+IntToStr(spin_count)+'. Landed numbrer is '+IntToStr(last_number)+'. Current amount is $'+IntToStr(amount)+'.'); //print useful information
  if amount<=stop_loss then break; //check if we reach the stop_loss
  spin_count:=spin_count+1;//increase the spin count
end; //end of a loop

if not (amount>=wish_amount) then print('The game stops because we reach the stop loss.'+'. Current amount is $'+IntToStr(amount))
                              else print('Congratulations! The game stops because we reach wishing amount.'+'. Current amount is $'+IntToStr(amount));
print('Current amount is $'+IntToStr(amount)+'. Start balance is $'+IntToStr(start_amount)+'. Stop loss is $'+IntToStr(stop_loss)+'. Wishing amount is $'+IntToStr(wish_amount)+'.');
end;

 

 Lesson 8. RSS - secrets (Using Step over, Trace into, Watches, ...).

 

0. Debugging
A major feature of the RSS is the integrated debugger. The debugger enables you to easily set breakpoints, watch variables, and do much more. Using the debugger, you can quickly find out what is happening (or not happening) with your scripts as it runs. A good debugger is vital to efficient script development.

Before getting into the details of the debugger, let's review the menu items that pertain to the debugger.

Item

Shortcut

Description

Step Over

F8

Executes the source code line at the execution point and pauses at the next source code line.

Trace Into

F7

Traces into the method at the execution point.

Run to Cursor

F4

Runs the script and pauses when script execution reaches the current line in the source code.

Pause

Shift+F9

Pauses script execution as soon as the execution point enters the script's source code.

Script Reset

Ctrl+F2

Unconditionally terminates the script and returns to the RSS.

Add Watch

Ctrl+F5

Displays the Watch Properties dialog box.

Toggle Breakpoint

F5

Toggles a breakpoint on or off for the current line in the Code Editor.



I. Using Breakpoints - Toggle Breakpoint
When you run your script, it runs at full speed, stopping only where you have set breakpoints.

New Term: A
breakpoint is a marker that tells the debugger to pause script execution when it reaches that place in the script.

Setting and Clearing Breakpoints

To set a breakpoint, click in the editor window's gutter to the left of the line on which you want to pause script execution (the gutter is the gray margin along the Code Editor window's left edge). The breakpoint icon (a red circle) appears in the gutter and the entire line is highlighted in red. To clear the breakpoint, click on the breakpoint icon and the breakpoint is removed. You can also press F5 or choose Toggle Breakpoint from the Code Editor context menu to toggle a breakpoint on or off.

When the script is run under the debugger, it behaves as it normally would--until a breakpoint is hit, that is. When a breakpoint is hit, the RSS is brought to the top and the breakpoint line is highlighted in the source code. If you are using the default colors, the line wh ere the script has stopped is highlighted in red because red indicates a line containing a breakpoint.

New Term: The
execution point indicates the line that will be executed next in your source code.

As you step through the script, the execution point is highlighted in blue and the editor window gutter displays a green arrow glyph. Understand that the line highlighted in blue has not yet been executed but will be when script execution resumes.

When you stop at a breakpoint, you can view variables, view the call stack, browse symbols, or step through your code. After you have inspected any variables and objects, you can resume normal script execution by clicking the Run button. Your application will again run normally until the next breakpoint is encountered.

II. Run to Cursor
There is another debugging command that deserves mention here. The Run to Cursor command runs the script until the source line containing the editing cursor is reached. At that point, the script stops as if a breakpoint were placed on that line.

Run to Cursor acts as a temporary breakpoint. You can use this command rather than set a breakpoint on a line that you want to immediately inspect. Just place the cursor on the line you want to break on and choose Run to Cursor (or press F4). The debugger behaves exactly as if you had placed a breakpoint on that line. The benefit is that you don't have to clear the breakpoint after you are done debugging that section of code.

III. Watching Variables - Add Watch
So what do you do when you stop at a breakpoint? Usually you stop at a breakpoint to inspect the value of one or more variables. You might want to ensure that a particular variable has the value you think it should, or you might not have any idea what a variable's value is and simply want to find out.

The function of the Watch List is basic: It enables you to inspect the values of variables. You can add as many variables to the Watch List as you like.

Adding Variables to the Watch List
To add a variable to the watch, choose Debug|Add Watch from the main menu. When the Watch Properties dialog box comes up, enter the name of the variable you want to add to the Watch List and click OK.

Using t he Watch List

When a breakpoint is hit, the Watch List displays the current value of any variables that have been added to the Watch List. If the Watch List isn't currently open, you can choose Debug|View Watches from the main menu to display it.

TIP: Dock the Watch List window to the bottom of the Code Editor window so that it will always be in view when stepping through code.

Under certain circumstances, a message will be displayed next to the variable instead of the variable's value. If, for example, a variable is out of scope or not found, the Watch List displays
Undeclared identifier:'X' next to the variable name. If the script isn't running or isn't stopped at a breakpoint, the Watch List displays [process not accessible] for all watch items. Other messages can be displayed depending on the current state of the application or the current state of a particular variable.

IV. Stepping Through Your Code - Step Over and Trace Into

Stepping through code is on e of the most basic debugging operations, yet it still needs to be mentioned here.
When you stop at a breakpoint, you can do many things to determine what is going on with your code. You can set up variables to watch in the Watch List. You can also step through your code to watch what happens to your variables and objects as each code line is executed.

As you continue to step through your code, you will see that the line in your source code to be executed next is highlighted in blue. If you have the Watch List window open, they will be updated as each code line is executed. Any changes to variables or objects will be immediately visible in the watch window. The RSS debugger has two primary stepping commands to aid in your debugging operations: Step Over and Trace Into.

Step Over
Step Over means to execute the next line in the source code and pause on the line immediately following. Step Over is sort of a misnomer. The name indicates that you can step over a source line and the line won't be executed. That isn't the case, however. Step Over means that the current line will be executed and any functions or procedures called by that source line will be run at full speed. For example, let's say you set a breakpoint at a line that calls a function in your script. When you tell the debugger to step over the method, the debugger will execute the function and stop on the next line. (Contrast this with how Trace Into works, which you'll read next, and it will make more sense.) To use Step Over to step through your script, you can either press F8 or choose Debug|Step Over from the main menu.

NOTE: As you step through various source code units in your script, the Code Editor will automatically load and display the needed source units if they are not already open.

Trace Into

The Trace Into command enables you to trace into any functions or procedures that are encountered as you step through your code. Rather than execute the function or procedure and return to the next line as Step Over does, Trace Into places the execution point on the first source code line in the function or procedure being called. You can then step line-by-line through that function or procedure using Step Over or Trace Into as necessary. The keyboard shortcut for Trace Into is F7.

After you have inspected variables and done whatever debugging you need to do, you can again run the script at full speed by clicking the Run button. The script will function normally until the next breakpoint is encountered.

V. Script Pause
Choose Debug|Pause to temporarily pause the execution of a running script.

The debugger pauses script execution and positions the execution point on the next line of code to execute. You can examine the state of your script in this location, then continue debugging by running, stepping, or tracing.

In addition to temporarily pausing a script running in the debugger, you can also stop a script and release it from memory. Use Debug|Script Reset to stop a running script and release it from memory.

VI. Script Reset
Choose Debug|Script Reset to end the current script run and release it from memory.

Use Script Reset to restart a script from the beginning, such as when you step past the location of a bug, or if variables or data structures become corrupted with unwanted values.

When you reset a script, RSS performs the following actions:
- Closes all open script files
- Clears all variable settings

Resetting a script does not delete any breakpoints or watches you have set, which makes it easy to resume a debugging session.

  

Lesson 9. Array structures.

 

0. Arrays
An Array is a powerful data structure that stores variable data. It is just like a small fixed number of boxes linked together one after the other storing things that are related to each other. An array is said to be a static data structure because, once declared, its original size that is specified by the programmer will remain the same throughout the whole program and cannot be changed.

Up until now, we have used single variables only as a tool to store data. Now we will be using the array data structure.

I. Declaration

The array is declared like a simple variable, in VAR section.
The size of the array and the data types that it will use for storing data - will be defined at first assing of values.
Ex.9.1: The following example stores in the array 10 numbers. This size depends on your script requirements.
var myArray1;
begin
  myArray1:=[1,2,3,4,5,6,7,8,9,10];
end;


II. Assign and read data.

Arrays are used just like ordinary variables. They are used to store typed data just like the ordinary variables.

To assign values to a particular integer of an array, we do it like this:
myArray1[5]:=22;
<arrayName>[index] := <value>;

To read the value from array and to assign it to a variable (or to other array), use:
myVar:=myArray1[3];
<variableName> := <arrayName>[index];

Arrays in script are 0-based index, so the first element in array have index 0.
This mean that in array from Ex.9.1 we have next:
myArray1[0]=1;
myArray1[1]=2;
...
myArray1[8]=9;
myArray1[9]=10;
myArray1[10]=nothig - because the maximum index is 9.

III. Multi-dimensional arrays .
Multi-dimensional are arrays which store variables in a second or nth dimension having n*m storage locations. Mutli dimensional arrays including the 2 dimensional array, are defined by array in array.

Ex.9.2: The following example stores 3 sets by 12 numbers.
This array dimension is 3x12 or 3 values by array of 12 (remember that first element in array have index 0).
var myArray2;
begin
  myArray2:=[
                [1,2,3,4,5,6,7,8,9,10,11,12],
                [13,14,15,16,17,18,19,20,21,22,23,24],
                [25,26,27,28,29,30,31,32,33,34,35,36]
                ];
end;


How to access it? Next I will show on what position are numbers situated :
  number 1 is on position [0,0] - so print(myArray2[0,0]) - will return 1
  number 6 is on position [0,5] - so print(myArray2[0,5]) - will return 6
  number 12 is on position [0,11] - so print(myArray2[0,11]) - will return 12
  number 13 is on position [1,0]
  number 14 is on position [1,1]
  number 24 is on position [1,11]
  number 25 is on position [2,0]
  number 35 is on position [2,10]
  number 36 is on position [2,11]

The limit of this array are indexes 2 and 11.
trying to read/assign myArray2[
3 ,5], myArray2[2, 12 ] (x any value) - RSS will generate error.
Because we have no index 3 and 12.

The next code will replace the value of position [2,6] (was number 31) to 777;
myArray2[2,6]:=777;
And the array will be
 myArray2:=[
                [1,2,3,4,5,6,7,8,9,10,11,12],
                [13,14,15,16,17,18,19,20,21,22,23,24],
                [25,26,27,28,29,30,777,32,33,34,35,36]
                ];


Yes, it is pretty much the same. Well, array helps you make spreadsheets, just like Lotus 1-2-3 or Excel.

How about the three-dimensional table or more ? It also the same. Look at the definition:
Ex.9.3: The following example stores 3 sets of 4 sets by 3 numbers.
This array dimension is 3x12 or 3 values by array of 12 (remember that first element in array have index 0).
myArray3:=[
                [[1,2,3],[4,5,6],[7,8,9],[10,11,12]],
                [[13,14,15],[16,17,18],[19,20,21],[22,23,24]],
                [[25,26,27],[28,29,30],[31,32,33],[34,35,36,37]]
                ];


  number 1 is on position [0,0,0] - so print(myArray3[0,0,0]) - will return 1
  number 6 is on position [0,1,2] - so print(myArray3[0,1,2]) - will return 6
  number 12 is on position [0,3,2] - so print(myArray3[0,3,2]) - will return 12
  number 20 is on position [1,2,1]
  number 34 is on position [2,3,0]

As you may see I have added the 37 after the 36.
myArray3[2,3,2] will return 36,
myArray3[2,3,3] will return 37,
myArray3[2,3,4] will generate the error,
myArray3[1,3,2] will return 24,
myArray3[1,3,3] will generate the error.

The next code will replace the value of position [1,2,2] (was number 21) to 777;
myArray3[1,2,2] :=777;

------------------------------------
We may assign values of an array to other array:
myArray3[1,1] - it is the next array - [16,17,18].
the next code
myArray3[1,1]:=myArray3[1,2]; will copy the position [1,2] to position [1,1] and the myArray3 will be next:
myArray3:=[
                [[1,2,3],[4,5,6],[7,8,9],[10,11,12]],
                [[13,14,15],[19,20,21],[19,20,21],[22,23,24]],
                [[25,26,27],[28,29,30],[31,32,33],[34,35,36,37]]
                ];


IV. function VarArrayHighBound().
Function VarArrayHighBound() will return the index of last element in the array.

print(IntToStr(VarArrayHighBound(my_array,1))); Result will be 11.
print(IntToStr(VarArrayHighBound(my_array2,1))); Result will be 2.
print(IntToStr(VarArrayHighBound(my_array3,1))); Result will be 2.

Because the myArray2 and myArray3 are multidimensional arrays, this mean that inside them we also have arrays. We may use the function VarArrayHighBound() for accesing the limit of an array that is inside other array.
myArray3[1,1] - it is the next array - [16,17,18].
print(IntToStr(VarArrayHighBound(my_array3[1,1],1))); Result will be 2.

myArray3[2,3] - it is the next array - [34,35,36,37].
print(IntToStr(VarArrayHighBound(my_array3[2,3],1))); Result will be 3.

V. Example with array.
var my_array, k;
begin    
  my_array:=[0,1,1,2,3,4,6,9,14,21,31,47,70,105,158];
  print('Example with array');
  print('');
  print('Without VarArrayHighBound()');
  for k:=1 to 14 do print('Step '+IntToStr(k)+' - Bet'+IntToStr(my_array[k])+' Chips.');
  print('');
  print('With VarArrayHighBound()');
  print(' Array contain '+IntToStr(1+VarArrayHighBound(my_array,1))+' elements;');
  for k:=0 to VarArrayHighBound(my_array,1) do print(' Element '+IntToStr(k)+' - have value '+IntToStr(my_array[k])+'.');
end;