Skip to content

Commit

Permalink
Add readme and scripting reference
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaScorpion committed Apr 5, 2021
1 parent 6fe8721 commit d8ed2b0
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Build
*.exe

# IDEs
.idea/
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# keyScripter

A tool to script keyboard and mouse inputs for Windows.

## Scripting Reference

See [SCRIPTING.md](SCRIPTING.md).

## Developing

### Prerequisites

- Make sure you have [Go](https://golang.org/dl/) installed
- Clone the repository

### Building

```shell
go build ./cmd/keyScripter
```

This will create `keyScripter.exe`.

### Formatting

```shell
go fmt ./...
```

### Dependencies

Dependencies are managed using [modules](https://github.com/golang/go/wiki/Modules).
41 changes: 41 additions & 0 deletions SCRIPTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Scripting Reference

## Quick Start

```
# Lines starting with a "#" are comments.
print "Call functions like this."
wait 500
print "Done!"
```

## Functions

### print

Print a value to the output. The first argument of `print` must be a string, which is interpreted as a [Go format](https://golang.org/pkg/fmt/) string. The rest of the arguments can be any value, and are used as values for the format. To use a value in the format string, use `%v`.

Example:

```
print "A simple print."
print "%v is replaced by the passed %v." 42 "values"
```

Output:

```
A simple print.
42 is replaced by the passed values.
```

### wait

Wait a number of milliseconds before resuming the script.

Example:

```
# Wait 1 second:
wait 1000
```

0 comments on commit d8ed2b0

Please sign in to comment.