forked from openbullet/openbullet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLSDoc.xml
509 lines (428 loc) · 16.6 KB
/
LSDoc.xml
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
<?xml version="1.0" encoding="UTF-8"?>
<doc>
<section name="General Info">
<item name="What is LoliScript?">
LoliScript (LS) is a custom scripting language made to give access to all existing (plus some more advanced) capabilities of OpenBullet.
Every instruction is a one-liner (but can be broken down into multiple segments for readability) and it will integrate the existing block execution capabilities with some other that cannot be reproduced with normal blocks.
This is ABSOLUTELY NOT a fully functional scripting language meant to replace the capabilities offered by JavaScript or Python.
Here's an example of a LoliScript command:
PRINT Hello, World!
And here's how you would execute a standard Function Block:
FUNCTION Constant "Hello, World!" -> VAR "GREETING"
In this documentation you will learn how to use LoliScript to its full potential and integrate it with your other blocks or even stop using blocks altogether!
</item>
<item name="When to use it">
You should use LoliScript when:
• you need more powerful tools to build a config
• you want something faster and much easier to debug at a glance
• you don't want to deal with clicking on tens of blocks in big configs
</item>
</section>
<section name="Syntax">
<item name="Introduction">
LoliScript has a linear syntax where each line is a command.
Example:
FUNCTION Constant "Hello, World!" -> VAR "GREETING"
Indentation will be considered as a continuation of the previous line, so writing something like:
FUNCTION Constant
"Hello, World!"
-> VAR "GREETING"
is completely equivalent to the one-liner above.
Optional arguments will be wrapped with square brackets [ ] and they don't need to be set each time.
Every command follows this scheme:
CMDID [ARGUMENTS]
CMDID uniquely identifies a command or flow control statement by its name
[ARGUMENTS] can have different types and they are used to customize the command you want to execute
</item>
<item name="Argument Types">
The arguments can be of 4 types:
• Parameter (usually identifies an enumerator value)
FUNCTION Hash SHA512 ...
• Numeric (usually an integer)
FUNCTION RandomNum 0 100 ...
• Boolean (a parameter name (case sensitive!) followed by =True or =False)
KEYCHECK BanOn4XX=True BanOnTocheck=False
• Literal (corresponds to a string argument)
FUNCTION Constant "Hello" ...
Note that you will have to escape double quotes inside a literal, for example
FUNCTION Constant "This is how to \"escape\" double quotes" ...
• Redirector (used to direct the output to a variable or a file)
FUNCTION Constant "Hello" -> VAR "GREETING"
FUNCTION Constant "Hello" -> CAP "Greeting"
</item>
<item name="Variables">
You can access the saved values of variables and use them in literals by including them in angle brackets like this <A>.
There are 3 types of variables:
Single
List
Dictionary
Examples (NAME is the variable name):
- Single
<NAME>
- List (access one element by index or all element using * as index)
<NAME[0]>
<NAME[*]>
- Dictionary (access by key using () and by value using {}, supports *)
<NAME(key)>
<NAME{value}>
<NAME(*)>
<NAME{*}>
</item>
<item name="Comments">
Every line that starts with two #s is considered a comment
Example:
## THIS IS A COMMENT
</item>
</section>
<section name="General Commands">
<item name="PRINT">
This command is peculiar since it doesn't take a literal argument but just parses the rest of the line after the keyword PRINT and outputs it to the debugger log.
Syntax:
PRINT TEXT
Example:
PRINT Hello, World!
</item>
<item name="SET">
This command is very powerful as it allows manipulation on the global data of the bot.
Syntax:
SET IDENTIFIER [PARAMETERS]
Allowed identifiers:
SOURCE - The stored response source of the last request performed
STATUS - The status of the bot
RESPONSECODE - The response code of the last request performed
COOKIE - Sets the value for a cookie of the global cookie jar given its name
ADDRESS - The address of the response of the last request performed
USEPROXY - Whether to use the proxy that is currently assigned to the bot during requests
PROXY - Sets the current proxy
PROXYTYPE - Sets the current proxy type
DATA - Sets the current data
VAR - Sets a variable
CAP - Sets a captured data
NEWGVAR - Initializes a new global variable (only if it doesn't exist)
GVAR - Sets a global variable's value
GCOOKIES - Sets cookies from the local cookie jar into the global cookie jar
Examples:
SET SOURCE "Example Source"
SET STATUS SUCCESS
SET STATUS CUSTOM "ABCD"
SET RESPONSECODE 200
SET COOKIE "token" "abcdef"
SET ADDRESS "https://www.google.com"
SET USEPROXY FALSE
SET PROXY "127.0.0.1:8888"
SET PROXYTYPE HTTP
SET DATA "abc:def"
SET VAR "varname" "data"
SET CAP "capname" "data"
SET NEWGVAR "sharedcookie" "abc=123"
SET GVAR "sharedcookie" "def=456"
SET GCOOKIES
</item>
<item name="DELETE">
This command allows you to delete elements from current collections.
Syntax:
DELETE IDENTIFIER [CONDITION] "LITERAL"
Allowed identifiers:
COOKIE
VAR
GVAR
The default condition is EqualTo
Examples:
DELETE COOKIE Contains "phpsessid"
DELETE VAR "TOKEN"
DELETE GVAR "MAX"
</item>
<item name="Mouse Action">
This command allows you to perform advanced mouse actions in the browser.
General Syntax:
MOUSEACTION [ACTION [PARAMETERS]]*
General Syntax for an ELEMENT parameter:
ELEMENT LOCATOR "STRING" [INDEX]
Allowed Actions:
## Spawn a div with a given id to a (x,y) absolute position, so you can use it as element hook for mouse movement
SPAWN "ID" "X" "Y"
CLICK [ELEMENT]
CLICKANDHOLD [ELEMENT]
RIGHTCLICK [ELEMENT]
DOUBLECLICK [ELEMENT]
DRAGANDDROP ELEMENT -> ELEMENT
DRAGANDDROPWITHOFFSET "X" "Y" ELEMENT
KEYDOWN "KEY" [ELEMENT]
KEYUP "KEY" [ELEMENT]
MOVEBY "X" "Y"
MOVETO ELEMENT
RELEASE [ELEMENT]
SENDKEYS "KEYS" [ELEMENT]
## Draws random points in a square starting from the top left corner and with the given width and height
DRAWPOINTS MAXW MAXH AMOUNT
DRAWLINE ("X1" "Y1" -> "X2" "Y2" / ELEMENT -> ELEMENT) : AMOUNT
DRAWLINEHUMAN ("X1" "Y1" -> "X2" "Y2" / ELEMENT -> ELEMENT) : AMOUNT [GRAVITY WIND]
Examples:
## Moving to an element and clicking 100 pixels right of it
MOUSEACTION
MOVETO ELEMENT CLASS "testclass" 1
MOVEBY "100" "0"
CLICK
## Moving to a specific set of coordinates on the page
MOUSEACTION
SPAWN "target" "100" "150"
MOVETO ELEMENT ID "target"
## Moving like a human from point A (0,0) to point B (700,700). The lower the AMOUNT, the faster the line is drawn
MOUSEACTION
DRAWLINEHUMAN "0" "0" -> "700" "700" : 150 1 1
## Moving like a human from element with id="one" to element with id="two", 20 points and default gravity/wind
MOUSEACTION
DRAWLINEHUMAN ELEMENT ID "one" -> ELEMENT ID "two" : 20
</item>
</section>
<section name="Block Commands">
<item name="Info">
The block commands will spawn and execute a block of the corresponding type, after setting all the required parameters.
You can give a label to any block by writing # and then the preferred label, for example:
#GETLEN FUNCTION Length "Test123" -> VAR "LEN"
</item>
<item name="Function">
This will spawn and execute a Function Block.
Note: If the input has a variable of List type, the function will be executed on all the elements and return a new List variable.
Syntax:
FUNCTION Name [ARGUMENTS] ["INPUT STRING"] [-> VAR/CAP "NAME"]
Examples:
FUNCTION Constant "Hello" -> VAR "GREETING"
FUNCTION Constant "Name is <NAME[*]>" -> CAP "Names"
FUNCTION ClearCookies
Peculiar functions:
FUNCTION Hash SHA512 "<PASS>" -> VAR "HASHED"
FUNCTION HMAC SHA1 "key" HmacBase64=True KeyBase64=False "<PASS>" -> VAR "DIGEST"
FUNCTION Translate StopAfterFirstMatch=True
KEY "key1" VALUE "value1"
KEY "key2" VALUE "value2"
"input" -> CAP "Translated"
FUNCTION DateToUnixTime "format" "input" -> VAR "DATE"
FUNCTION UnixTimeToDate "format" "input" -> VAR "UNIXTIME"
FUNCTION Replace "what" "with" UseRegex=True "input" -> VAR "REPLACED"
FUNCTION RegexMatch "pattern" "input" -> VAR "MATCHED"
FUNCTION RandomNum "0" "100" -> VAR "RANDOM"
FUNCTION CountOccurrences "tofind" "input" -> VAR "COUNT"
FUNCTION CharAt "index" "input" -> VAR "CHAR"
FUNCTION Substring "startindex" "length" "input" -> VAR "SUBSTRING"
FUNCTION AesEncrypt "secretkey" "secretmessage" -> VAR "ENCRYPTED"
</item>
<item name="Keycheck">
This will spawn and execute a Keycheck Block.
Syntax (expanded for readability):
KEYCHECK [BanOn4XX?] [BanOnToCheck?]
[KEYCHAIN TYPE ["CUSTOMNAME"] MODE
[KEY "STRING" [CONDITION "STRING"]]*
]*
Note: As shown above, for brevity,
KEY "<SOURCE>" Contains "abc"
can be written as
KEY "abc"
Example:
KEYCHECK BanOnToCheck=False
KEYCHAIN SUCCESS OR
KEY "Logout"
KEYCHAIN FAILURE OR
KEY "<SOURCE>" EqualTo ""
KEYCHAIN CUSTOM "DEFAULT" OR
KEY "abc" Contains "ab"
</item>
<item name="Request">
This will spawn and execute a Request Block.
Syntax (expanded for readability):
REQUEST METHOD "URL" [AcceptEncoding?] [AutoRedirect?] [ReadResponseSource?] [ParseQuery?] [EncodeContent?]
[STANDARD / MULTIPART / BASICAUTH]
[CONTENT "postdata"]
[CONTENTTYPE "ctype"]
[STRINGCONTENT "name:value"]*
[FILECONTENT "name:path:content-type"]*
[BOUNDARY "abcd"]
[COOKIE "abc: def"]*
[HEADER "abc: def"]*
[SECPROTO security-protocol]
[-> STRING / -> FILE "path" / -> BASE64 "VARNAME"]
Examples:
REQUEST GET "http://example.com/file.zip" -> FILE "file.zip"
REQUEST POST "http://example.com/poster" AutoRedirect=False
COOKIE "Hello: World"
HEADER "Hello: World"
CONTENT "{"id":1}"
CONTENTTYPE "application/json"
REQUEST POST "http://example.com/multi" MULTIPART
STRINGCONTENT "Hello: World"
STRINGCONTENT "Hi: Again"
FILECONTENT "Image: image.jpg"
BOUNDARY "abcd"
REQUEST GET "http://example.com/basic" BASICAUTH
</item>
<item name="SolveCaptcha">
This will spawn and execute a SolveCaptcha Block.
Syntax:
SOLVECAPTCHA TextCaptcha "question?" LANGUAGEGROUP LANGUAGE [UseProxy?] ["UserAgent"]
SOLVECAPTCHA ImageCaptcha "base64" LANGUAGEGROUP LANGUAGE MINLEN MAXLEN CHARSET "instructions" [IsPhrase?] [CaseSensitive?] [RequiresCalculation?] [UseProxy?] ["UserAgent"]
SOLVECAPTCHA ReCaptchaV2 "sitekey" "siteurl" [IsInvisible?] [UseProxy?] ["UserAgent"]
SOLVECAPTCHA ReCaptchaV3 "sitekey" "siteurl" "action" "minscore" [UseProxy?] ["UserAgent"]
SOLVECAPTCHA FunCaptcha "pkey" "serviceurl" [NoJS?] [UseProxy?] ["UserAgent"]
SOLVECAPTCHA KeyCaptcha "userid" "sessionid" "wss1" "wss2" [UseProxy?] ["UserAgent"]
SOLVECAPTCHA HCaptcha "sitekey" "siteurl" [UseProxy?] ["UserAgent"]
SOLVECAPTCHA GeeTest "gt" "challenge" "apiserver" [UseProxy?] ["UserAgent"]
SOLVECAPTCHA Capy "sitekey" "siteurl" [UseProxy?] ["UserAgent"]
When the block is processed, if the solution was sucessful it will generate 2 variables:
- SOLUTION (containing the solution as plaintext)
- CAPTCHAID (containing the id you can send to report bad captchas)
In the case of GeeTest, the block will generate 4 variables instead:
- CHALLENGE
- VALIDATE
- SECCODE
- CAPTCHAID
</item>
<item name="ReportCaptcha">
This will spawn and execute a ReportCaptcha Block.
Syntax:
REPORTCAPTCHA Type "id"
</item>
<item name="Recaptcha (Obsolete)">
THIS BLOCK IS OBSOLETE! IT WILL BE REMOVED IN THE FUTURE, DO NOT USE IT!
This will spawn and execute a Recaptcha Block.
Syntax:
RECAPTCHA "URL" "SITEKEY" -> VAR "NAME"
Example:
RECAPTCHA "http://example.com" "ABCD" -> VAR "RECAP"
</item>
<item name="Captcha (Obsolete)">
THIS BLOCK IS OBSOLETE! IT WILL BE REMOVED IN THE FUTURE, DO NOT USE IT!
This will spawn and execute a Captcha Block.
Syntax:
CAPTCHA "URL" [Base64?] [SendScreenshot?] -> VAR "NAME"
Example:
CAPTCHA "http://example.com/image.png" -> VAR "CAP"
</item>
<item name="Parse">
This will spawn and execute a Parse Block.
Syntax:
PARSE "TARGET" LR "LEFT" "RIGHT" [Recursive?] [EncodeOutput?] [CreateEmpty?] [UseRegexLR?] -> VAR/CAP "NAME" ["PREFIX" "SUFFIX"]
PARSE "TARGET" CSS "SELECTOR" "ATTRIBUTE" [INDEX / Recursive?] [EncodeOutput?] [CreateEmpty?] -> VAR/CAP "NAME" ["PREFIX" "SUFFIX"]
PARSE "TARGET" JSON "FIELD" [JTokenParsing?] [Recursive?] [EncodeOutput?] [CreateEmpty?] -> VAR/CAP "NAME" ["PREFIX" "SUFFIX"]
PARSE "TARGET" REGEX "REGEX" "OUTPUT" [Recursive?] [EncodeOutput?] [CreateEmpty?] [DotMatches?] [CaseSensitive?] -> VAR/CAP "NAME" ["PREFIX" "SUFFIX"]
Examples:
PARSE "<SOURCE>" LR "<span>" "</span>" Recursive=True -> CAP "BALANCE" "$" ""
PARSE "<SOURCE>" CSS "[name=csrf]" "value" -> VAR "CSRF"
</item>
<item name="Bypass CF">
This will spawn and execute a BypassCF Block.
Syntax:
BYPASSCF "URL" [SECPROTO security-protocol] ["UA"]
Example:
BYPASSCF "http://example.com"
</item>
<item name="Utility">
This will spawn and execute a Utility Block.
Syntax for list:
UTILITY LIST "List Name" ACTION [PARAMETERS] [-> VAR/CAP "NAME"]
Syntax for variable:
UTILITY VARIABLE "Variable Name" ACTION [PARAMETERS] [-> VAR/CAP "NAME"]
Syntax for conversion:
UTILITY CONVERSION FROM TO "input" [-> VAR/CAP "NAME"]
Syntax for file:
UTILITY FILE "File Name" ACTION [PARAMETERS] [-> VAR/CAP "NAME"]
Example:
UTILITY LIST "List1" JOIN "," -> VAR "JOINED"
UTILITY VARIABLE "Var1" SPLIT "," -> VAR "SPLITTED"
UTILITY CONVERSION BASE64 HEX "0xA35F" -> VAR "BASE64"
UTILITY FILE "test.txt" WRITE "Hello" -> VAR "TEXT"
</item>
<item name="TCP">
This will spawn and execute a TCP block
NOTE: This block is currently only available in LoliScript
Syntax:
TCP COMMAND [ARGUMENTS]
Allowed Commands:
CONNECT "HOST" "PORT" [UseSSL?] [WaitForHello?] [-> VAR/CAP "NAME"]
SEND "MESSAGE" [WebSocket?] [-> VAR/CAP "NAME"]
DISCONNECT
Example:
TCP CONNECT "google.com" "443" UseSSL=True
TCP SEND "Hello" -> VAR "RESPONSE"
TCP DISCONNECT
</item>
<item name="Navigate">
This will spawn and execute a Navigate Block.
Syntax:
NAVIGATE "URL" [TIMEOUT] [BanOnTimeout?]
Example:
NAVIGATE "http://example.com"
NAVIGATE "http://example.com" 60 BanOnTimeout=True
</item>
<item name="Browser Action">
This will spawn and execute a BrowserAction Block.
Syntax:
BROWSERACTION ACTION ["INPUT"]
Examples:
BROWSERACTION OPEN
BROWSERACTION SENDKEYS "Hello"
</item>
<item name="Element Action">
This will spawn and execute an ElementAction block
Syntax:
ELEMENTACTION LOCATOR "LOCATOR" [INDEX / Recursive?] ACTION ["INPUT"] [-> VAR/CAP "NAME"]
Examples:
ELEMENTACTION ID "testid" CLICK
ELEMENTACTION SELECTOR "div input" SENDKEYS "abcd"
ELEMENTACTION CLASS "testclass" Recursive=True GETTEXT -> CAP "ITEMS"
</item>
<item name="Execute JS">
This will spawn and execute an ExecuteJS block
Syntax:
EXECUTEJS "SCRIPT" [-> VAR/CAP "NAME"]
Examples:
EXECUTEJS "alert('hi'); return 'hello';" -> VAR "GREETING"
</item>
</section>
<section name="Flow Control">
<item name="If Else">
The IF statement will check the condition after it. If it's successful, it will continue to the next instruction, otherwise it will jump to the first ELSE or ENDIF statement.
The ELSE statement will be executed if the IF wasn't successful, otherwise it will jump to the first ENDIF statement.
Syntax:
IF "STRING1" CONDITION "STRING2"
## OTHER COMMANDS
ENDIF
You can add an ELSE command too like this:
IF "STRING1" CONDITION "STRING2"
## COMMANDS TO BE EXECUTED ON TRUE CONDITION
ELSE
## COMMANDS TO BE EXECUTED ON FALSE CONDITION
ENDIF
</item>
<item name="While">
The WHILE statement will check the condition after it. If it's successful, it will continue to the next instruction, otherwise it will jump to the first ENDWHILE statement.
The ENDWHILE statement will always jump back to the first WHILE statement above it.
The WHILE - ENDWHILE pair allows to reproduce the FOR statement of common high level programming languages as well.
Syntax:
WHILE "STRING1" CONDITION "STRING2"
## OTHER COMMANDS
ENDWHILE
</item>
<item name="Jump">
The JUMP statement will jump to the first block with the specified label (within the script!).
Syntax:
JUMP #LABEL
</item>
<item name="Begin (End) Script">
The BEGIN SCRIPT statement will mark an area of the script where the commands will be executed using another scripting language.
The OUTPUTS literal can contain a comma-separated list of variable names that you want to extract from the script's scope and declare inside OB as strings or lists.
It is useful to mention that your normal variables will be automatically declared inside the script as strings / lists of strings / dictionaries (if their name is allowed by that language's standards).
Available languages:
JavaScript
IronPython
Syntax:
BEGIN SCRIPT LANGUAGE
[script here]
END SCRIPT -> VARS "OUTPUTS"
Example:
BEGIN SCRIPT JavaScript
var a = 1+2;
var b = 'hello';
END SCRIPT -> VARS "a,b"
</item>
</section>
</doc>