Copyright 6 Vista 7 new! Languages 8 Glovepie scripts 9



Download 0.65 Mb.
Page2/30
Date conversion08.07.2018
Size0.65 Mb.
1   2   3   4   5   6   7   8   9   ...   30

Copyright

GlovePIE is Copyright 2007 by Carl Kenner, except for the scripts by other authors. By using this software you agree to obey the following license conditions:


* Playball Technology, Inc has exclusive rights to use this software for making money from commercial baseball simulations. However other people are free to make money from this program for non-baseball related things.
* You may not use this software directly or indirectly for any military purpose. This includes, but is not limited to, training, research and development, controlling military hardware, directing military personnel, or troop entertainment. You may not use this software anywhere on a military base or vessel. This applies to all versions of PIE. You may also not use it for playing “games” produced by the military to recruit players as real soldiers, including America’s Army. Sorry.
* You may not export this software to Israel, or use it in Israel (including the occupied territories), until Israel has ended its occupation of the West Bank, Gaza Strip, Lebanon, Syria, and anywhere else it may occupy, or until Israel abolishes apartheid (granting all Jews and non-Jews in its territories equal rights). If you try to run it in Israel before then, it will give you an error.
* You may not use this software to cheat at online or multiplayer games. What constitutes cheating depends on the game and the server. Just using a different input device shouldn't be considered cheating, but complex scripted actions to make things easier may be considered cheating. Don't get GlovePIE banned, or you will hurt everyone who wants to play with a VR glove. But feel free to cheat at single player!


Vista

You need to run GlovePIE as administrator if you want to emulate keys and the mouse in fullscreen games on Windows Vista. If you don’t run it as administrator, the keys and mouse will not be emulated. This is a security feature in Windows Vista.


If you use the “Rower” object you also need to run it as administrator.
To run GlovePIE as an administrator, right-click it and choose “Run as Administrator”. If you want it to always run as administrator, then right-click it and choose “Properties”, then choose the “Compatibility” tab, then tick the “Run this program as an administrator” box. Then choose “OK”.
Note that running programs as administrator is less secure, since it allows them to do whatever they want to your system. But it is no less secure than running them on XP.
On Vista, you can’t install the Mike and Mary speech synthesis voices. You also won’t have access to the “Sam” voice. You only have Anna, unless you bought Windows Ultimate in which case you might be able to get Lili.
In GlovePIE 0.30, Speech recognition should now work the same on Vista as it did on XP. The speech recognition window will no longer appear, and you will no longer execute random windows commands and randomly delete files, etc. while you are playing a game. It will however waste resources if you are also using other speech programs at the same time. If you want the speech recognition window to appear, and to randomly execute dangerous commands, you can choose “Vista Shared Speech Recogniser” from the Troubleshooter menu.
I can’t get the minimize-to-tray caption button to work on Vista with themes enabled. The button will still be there, but it will be hiding between other buttons, and it will look out of place.

NEW! Languages


GlovePIE can now be translated into other languages. This will not only translate the menus, but unlike other programming languages, it can also translate the scripting language. So language keywords, names of objects and names of properties of objects can all be translated. You can also translate some of the punctuation. Some languages can use commas as decimal points. So be careful. Those languages still use commas as commas too. So they (usually) need a space after the comma if it is not a decimal point and it is not obvious.
You can change the translation, or add translations for other languages, by changing the .inilng files or creating new ones. You also need to change the languages.ini file to add your language. Both these files must be saved as UTF8. It is best to use Notepad to edit them. If your language has non-English letters you should give the language name in those letters (before the = ), but the file name (after the = ) in English letters only. Menus can have any non-English letters you want, but the scripting language and its keywords and identifiers can only have Western European characters. That is because I haven’t been able to find a good syntax highlighting editor that supports Unicode. Identifiers are the names of things in the scripts. If you see anything in the user interface, or the scripting language that you want to translate, you can add it to the .inilng file in the appropriate section. It doesn’t matter if it already exists or not. Some items don’t exist yet, so you should add them. Because it is a programming language, you can’t have two translations that are the same, but for different things, or the computer will not be able to understand. You can add multiple foreign terms for each English term if you want. The first one will be chosen when translating into the foreign language, but when translating from the foreign language, any of the multiple terms will work.
When you post a script on a forum, it is very important that you translate it back to English first, by choosing English from the Language menu. Also if you cut and paste an English script FROM a forum, you also need to change GlovePIE’s language back to English first.
When you save a script, it is always saved in English automatically. When you load a script, it is always assumed to be in English and translated into your current language.

GlovePIE Scripts


Here is the syntax for GlovePIE scripts:

Commands and other Statements



Comments
Comments are text which does nothing. They only help the human who is trying to read your script (usually you).

The computer ignores them.


Comments can have the following syntax:
// This is a comment
/* This is a multi-line comment

It goes over multiple lines

like this */
This is a BASIC style comment

REM This is also a BASIC style comment
% This is a MATLAB style comment
Assignment statements
The most common kind of statement in GlovePIE is the assignment statement.
It has one of the following forward syntaxes:
LValue = expression [ ; ]
LValue := expression [ ; ]
or the following backwards syntax:
expression => LValue [ ; ]

These statements all set the LValue to the value of the expression.

If it is inside an IF statement then it will always set the value.

If it is not inside an IF statement then it will ONLY set the LValue when the expression changes.

This means you can set a variable, such as a key, several times:
Ctrl = var.a

Ctrl = var.b


Which has a similar effect to: Ctrl = var.a or var.b
The expressions can be any complicated mathematics that you want, or just another value.
New! Mathematical assignment statements
If you want to add something to a value, you have always been able to say:

LValue = LValue + expression


But now you can write the same thing a shorter way, like in C and Java:
LValue += expression
Both ways change LValue by adding expression onto it.

There are also other ways to increase a value, see the “Increment statements” section below.


You can also do subtraction, multiplication, or division by using -=, *= or /=
IF statements
Sometimes you will want to only do a set of commands when some condition is true.
You can do that with IF statements.
If statements can have one of the following syntaxes:
if condition then statement [ ; ]
if ( condition ) [then] statement [ ; ]
if condition [then] [begin] [ { ]

statement [ ; ]

statement [ ; ]

...

[ } ] [end [if]] [ ; ]


if condition [then] [begin] [ { ]

statement [ ; ]

statement [ ; ]

...

[ } ] [end] else [begin] [ { ]



statement [ ; ]

statement [ ; ]

...

[ } ] [end [if]] [ ; ]



if condition [then] [begin] [ { ]

statement [ ; ]

statement [ ; ]

...

[ } ] [end] (else if|elseif) condition2 [then] [begin] [ { ]



statement [ ; ]

statement [ ; ]

...

[ } ] [end] (else if|elseif) condition3 [then] [begin] [ { ]



statement [ ; ]

statement [ ; ]

...

[ } ] [end] else [begin] [ { ]



statement [ ; ]

statement [ ; ]

...

[ } ] [end [if]] [ ; ]




WHILE loops
While loops are NOT very useful in PIE because PIE is not a linear language.

A PIE script continuously loops through the entire script, even while IF statements are running in the background.

If you think you need a while loop then you are probably looking at the problem the wrong way.
Nevertheless, PIE does support while loops in the unlikely event that you do need them.
The entire while loop will be executed in one go. You can't use it to wait for some condition triggered elsewhere (yet).
The syntax is one of the following:
while condition do statement [ ; ]
while ( condition ) [do] statement [ ; ]
while condition [do] [begin] [ { ]

statement [ ; ]

statement [ ; ]

...

[ } ] [end [while]] [ ; ]


If you make a mistake and create an infinite loop, then it will give up after a fifth of a second and speak "infinite loop".


FOR loops
For loops aren't as useful in PIE as they are in other languages, because PIE is not a linear language.

A PIE script continuously loops through the entire script, even while IF statements are running in the background.

If you think you need a for loop then you may be looking at the problem the wrong way.
The entire for loop will be executed in one go. You can't use it to wait for some condition triggered elsewhere (yet).
The syntax is one of the following:
for variable (=|:=) InitialValue (to|downto) FinalValue [step amount] do statement [ ; ]
for variable (=|:=) InitialValue (to|downto) FinalValue [step amount] [do] [begin] [ { ]

statement [ ; ]

statement [ ; ]

...

[ } ] [end [for]]


for ( initialization ; condition ; increment ) [do] statement [ ; ]
for ( initialization ; condition ; increment ) [do] [begin] [ { ]

statement [ ; ]

statement [ ; ]

...

[ } ] [end [for]]


If you make a mistake and create an infinite loop, then it will give up after a fifth of a second and speak "infinite loop".
Wait command
Wait commands are for use in macros. Everything inside an IF statement is considered a macro.

A wait command will pause only the macro it is inside of, while the rest of the script will keep going in the background.

If you have nested if statements inside each other, then it will only pause the innermost if statement. So don’t use it inside an if statement which is already inside an if statement itself.
The syntax is either:
wait duration [ ; ]
wait( duration ) [ ; ]
You should normally specify the units for the duration. Valid units are: milliseconds (ms), seconds (s), minutes, hours, days.
eg.

wait 100 ms

wait 1 second

wait(500 milliseconds);


Increment statements
You can add one to something using one of these syntaxes:
var.x++

++var.x


Inc(var.x)

These are commands, not functions like in C. So you can’t set something else to equal var.x++.


You can subtract one from something like this:
var.x--

--var.x


Dec(var.x)
SHR and SHL statements
You can shift a value’s bits to the left or right with the SHR and SHL commands:

eg.
shr var.x, 1


Say command
You can use the Say command to make GlovePIE speak:
Say “hello world”
or
Say(“hello world”)
Other Commands
The following other commands also exist:
ExitProgram, ExitPIE,

Execute(filename), Chain(filename),

Display(text), DebugPrint(text)

AddCode(text),

ControlPanel, ControlPanelKeyboard, ControlPanelJoystick, ControlPanelMouse, ControlPanelP5, ControlPanelPPJoy, ControlPanelSpeech, ControlPanelMidi, ControlPanelDisplay,
PlaySound(filename),

Beep([freq, duration]), BeepAsterisk, BeepExclamation, BeepHand, BeepQuestion, BeepDefault,


FlashPieWindow, HidePie, ShowPie, MinimizePie, MaximizePie, RestorePie, UnMinimizePie, UnMaximizePie,
Press(x), Release(x), Toggle(x),
Type(text), TypeUnicode(text),
SendOsc(ip, port, address, [p1, p2, p3…]), BroadcastOsc(port, address, [p1, p2, p3…])

WiimotePoke([wiimote number], address, value)

WiimoteSend(wiimote number, report number, [p1, p2, p3…])

1   2   3   4   5   6   7   8   9   ...   30


The database is protected by copyright ©dentisty.org 2016
send message

    Main page