Skip to content

Commit e2e9508

Browse files
authored
Added some example scripts
1 parent ac6c9b7 commit e2e9508

File tree

7 files changed

+122
-0
lines changed

7 files changed

+122
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
:Main
2+
$using = "Console";
3+
// $Console_Hidden = "true";
4+
echo $Console_Cursor_Pos_X;
5+
$Console_Title = "Hello";
6+
Echo "Hello World";
7+
Pause;
8+

Examples/Counter Limit.mscript

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
:Loop
2+
$counter += 1;
3+
if $counter=500; goto Done;
4+
Echo $counter;
5+
goto Loop;
6+
7+
:Main
8+
Clear;
9+
$using = "Console";
10+
Pause;
11+
$counter = 0;
12+
goto Loop;
13+
14+
:Done
15+
Echo "-------------------------";
16+
Echo " Reached 500! ";
17+
Echo "-------------------------";
18+
Pause;
19+
Exit;
20+

Examples/Counter.mscript

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
:Loop
2+
$counter += $args[0];
3+
Echo $counter;
4+
goto Loop;
5+
6+
:Main
7+
$using = "Console";
8+
Echo "This will count infintely with an increment of 20";
9+
$counter = 0;
10+
goto Loop >> 20;

Examples/Functions.mscript

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
:FunctionTwo
2+
Print $args[0];
3+
Print " + ";
4+
Print $args[1];
5+
Print " = ";
6+
$math=0;
7+
$math += $args[0];
8+
$math += $args[1];
9+
Print $math;
10+
Pause;
11+
Exit;
12+
13+
:FunctionOne
14+
Echo $args[0];
15+
Sleep 1000;
16+
Print "Number One >";
17+
$var1 = Input;
18+
Print "Number Two >";
19+
$var2 = Input;
20+
goto FunctionTwo >> $var1,$var2;
21+
22+
23+
:Main
24+
Cls
25+
$using = "Console";
26+
Echo "Testing functions...";
27+
goto FunctionOne >> "Hello World!",23;

Examples/Hello World.mscript

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
:Main
2+
Echo "Hello, World";
3+
Pause;

Examples/Menu.mscript

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
:Loop
2+
$counter += 1;
3+
if $counter=500; goto Done;
4+
Echo $counter;
5+
goto Loop;
6+
7+
:Done
8+
Echo "-------------------------";
9+
Echo " Reached 500! ";
10+
Echo "-------------------------";
11+
Pause;
12+
goto Main;
13+
14+
:Hello
15+
Echo "Hello!";
16+
Pause;
17+
goto Main;
18+
19+
:World
20+
Echo "World!";
21+
Pause;
22+
goto Main;
23+
24+
// todo: add any command to excuite after if
25+
// currently, only goto command works.
26+
27+
:HandleInput
28+
if $args[0]=1; goto Hello;
29+
if $args[0]=2; goto World;
30+
if $args[0]=3; goto Loop;
31+
if $args[0]=0; goto ExitApp;
32+
Echo "Invalid Input, try again";
33+
Pause;
34+
35+
:Main
36+
Clear;
37+
$counter = 0;
38+
$using = "Console";
39+
Echo "1 = Hello!"
40+
Echo "2 = World!"
41+
Echo "3 = Counter";
42+
Echo "0 = Exit";
43+
Print "Enter a option: ";
44+
$input = Input;
45+
goto HandleInput >> $input;
46+
47+
:ExitApp
48+
Exit;
49+
50+
51+

Examples/MessageBox.mscript

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
:Main
2+
Msgbox "Hello world";
3+
Exit;

0 commit comments

Comments
 (0)