Built-in functions
Attention
Most built-in functions are either async
or functions that return a Promise
, so putting your script in an async function is necessary. Most functions require the keyword await
.
(async function(){
/*Your code goes here*/
})();
Utility functions
Log
Display information in the Studio's LOG area or in the Status
column of the profile running the script.
Syntax
await Log(message1, message2, message3, ...);
Example
| (async function(){
Log("Hello Bịp Profile");
Log("Hello", [1,2,3], {"Bịp": "Profile"});
// Extended log functions
// LogSuccess
// LogInfo
// LogWarn
// LogError
})();
|
Exit
Close the browser immediately.
Syntax
Delay
Delay by a period of milliseconds.
Syntax
Parameters
Parameters |
Description |
ms1 |
Delay time in milliseconds |
ms2 |
If ms2 is specified, this function will delay a random duration between ms1 and ms2 |
Example
| (async function(){
Log("Started");
await Delay(2000);
Log("2 seconds passed");
// await Delay(6000, 9000);//delay random 6-9s
})();
|
RandomInt
Generate a random integer.
Syntax
Parameters
Parameters |
Description |
min |
Range start number |
max |
Range end number |
Example
| (async function(){
Log(RandomInt(0, 9));
//0 and 9 may also be generated.
})();
|
RandomArray
Randomly retrieve an element from an array.
Syntax
Parameters
Parameters |
Description |
array |
Input array |
Example
| (async function(){
// const r = RandomArray(["a", "b", "c"]);
const r = RandomArray([1,2,3,4]);
Log(r)
})()
|
Base64Encode
base64 encode.
Syntax
Parameters
Parameters |
Description |
input |
Input data |
Example
| (async function(){
Log(Base64Encode("Bịp Profile"));
})();
|
Base64Decode
base64 decode.
Syntax
Parameters
Parameters |
Description |
input |
base64 encoded text |
Example
| (async function(){
Log(Base64Decode("QuG7i3AgUHJvZmlsZQ=="));
})();
|
GenerateXpath
Create a xpath. You may combine with the ClickByXpath and SetByXpath functions.
Syntax
GenerateXpath (tag, attr, value, index);
Parameters
Parameters |
Description |
tag |
Tag name of the element. |
attr |
Attribute of the element. |
value |
Value of attr . |
index |
Position of the element. |
Example
| //Target a link with href attribute = "http://google.com"
GenerateXpath("a", "href", "http://google.com");
//Target a link with href attribute starting with "http://google"
GenerateXpath("a", "href", "http://google%");
//Target a link with href attribute ending with "google.com"
GenerateXpath("a", "href", "%google.com");
//Target a link with href attribute containing the phrase "google"
GenerateXpath("a", "href", "%google%");
|
HttpRequest
Make a HTTP request.
Syntax
await HttpRequest(url, data, timeout, headers);
Parameters
Parameters |
Description |
url |
Target url |
data |
Data to send using POST method (optional) |
timeout |
Maximum time to wait for request, after time will report timed out error, enter 0 to wait forever or until error |
headers |
Add extra header to request (optional) |
Return result
An object with properties is illustrated as follows
{
"status": 200, //http response code
"headers": "raw response header",
"body": "response body",
"error": "", //lỗi trong trường hợp phát sinh
}
Example
| (async function(){
const res = await HttpRequest("http://icanhazip.com");
Log(res);
/*{
"status": 200,
"headers": "access-control-allow-methods: GET\r\naccess-control-allow-origin: *\r\nalt-svc: h3=\":443\"; ma=86400\r\ncf-ray: 8b528debe896855c-HKG\r\ncontent-length: 39\r\ncontent-type: text/plain\r\ndate: Sun, 18 Aug 2024 14:22:09 GMT\r\nserver: cloudflare\r\nvary: Accept-Encoding\r\n",
"body": "12.34.56.78\n"
}
*/
//application/x-www-form-urlencoded
const res = await HttpRequest("https://httpbin.org/anything", {
"username": "bip",
"password": "abc123",
});
//application/json
const res = await HttpRequest("https://httpbin.org/anything", JSON.stringify({
"username": "bip",
"password": "abc123",
}), 0) ;
})();
|
Get user inputs, if your script is shared on the script market,
you can ask users to enter some data when posting your script.
Syntax
Example
| (async function(){
const input = GetScriptInputs();
Log(input.file);
})();
|
GetAppVersion
Get current Bịp Profile version.
Syntax
GetProfileInfo
Get the running profile info.
Syntax
Example
| (async function(){
const profile = GetProfileInfo();
Log(profile);
})();
|
GetWindowSize
Get browser window size (including title bar and border).
Syntax
Example
| (async function(){
const size = await GetWindowSize();
Log(size);
//{"width":1366,"height":736}
})();
|
GetBrowserSize
Get the browser content size.
Syntax
Example
| (async function(){
const size = await GetBrowserSize();
Log(size);
//{"width":1350,"height":640}
})();
|
GetUrl
Get current URL
Syntax
Example
| (async function(){
const url = await GetUrl();
Log(url);
//https://google.com/
})();
|
GetHtml
Get HTML code of current website.
Syntax
Example
| (async function(){
const html = await GetHtml();
Log("HTML length is", html.length);
})();
|
TabCount
Returns the number of open tabs/popups.
Syntax
Example
| (async function(){
const tabs = await TabCount();
Log(tabs);
})();
|
GetUserAgent
Get current User Agent.
Syntax
Example
| (async function(){
const ua = GetUserAgent();
Log(ua);
})();
|
IsMobile
Returns the browser is running in mobile or desktop mode.
Syntax
Example
| (async function(){
const isMobile = IsMobile();
Log(isMobile);
})();
|
IsHideBrowser
Returns whether the browser is showing or hidden.
Syntax
Example
| (async function(){
const hide = IsHideBrowser();
Log(hide);
})();
|
IsLoading
Returns whether the browser is loading or not.
Syntax
Example
| (async function(){
const loading = await IsLoading();
Log(loading);
})();
|
WaitForLoading
Wait for the website to fully loaded.
Syntax
await WaitForLoading(timeout)
Parameters
Parameter |
Description |
timeout |
Maximum waiting time in seconds, if time is exceeded, it will be skipped and no longer waited, ignore this parameter to wait until finished |
Example
| (async function(){
Log("Navigating to google");
await Navigate("https://google.com");
const loaded = await WaitForLoading(30);
Log(loaded ? "Google is loaded" : "Goole still loading...");
})();
|
WaitForElmtBySelector
Wait for an element of a web page to satisfy a specified condition. For example, before clicking a button or typing text in a text box, you can use this function to ensure that the target has appeared.
Syntax
await WaitForElmtBySelector(selector, state, timeout = 60, frameSearch="", frameSearchType="")
Parameters
Return result
true
if state
is met, false
if there is an error or timeout.
Example
| (async function(){
//wait for the text box with name = q to appear
await WaitForElmtBySelector('textarea[name="q"]', {exists: true});
//wait for the div element with id countdown to disappear.
await WaitForElmtBySelector('div#countdown', {exists: false});
//wait for a button with id skip to appear with the disabled attribute (similar to waiting for the attribute to disappear)
await WaitForElmtBySelector('button#skip', {attr: "disabled", exists: true});
//wait for a span tag with id test to have the attribute desc = hello-bipprofile
await WaitForElmtBySelector('span#test', {attr: "desc", equals: "hello-bipprofile"});
//wait for a span with id test whose desc attribute contains lo-bip
await WaitForElmtBySelector('span#test', {attr: "desc", contains: "lo-bip"});
//wait for a span with id test whose desc attribute starts with hello
await WaitForElmtBySelector('span#test', {attr: "desc", startsWith: "hello"});
//wait for a span with id test whose desc attribute ends with bipprofile
await WaitForElmtBySelector('span#test', {attr: "desc", endsWith: "bipprofile"});
})();
|
WaitForElmtByXpath
This function is similar to WaitForElmtBySelector but uses xpath instead.
ImapFetch
Read mail using IMAP (built on ImapFlow library). Make sure your email account has IMAP enabled!
Syntax
await ImapFetch(user, pass, option)
Parameters
Parameters |
Description |
user |
Username including @xxx.xx (eg: [email protected]) |
pass |
Imap login password |
option.server |
Imap server option, with gmail, hotmail and yahoo the function can automatically recognize, the rest you have to specify clearly. |
option.proxy |
Set proxy (proxy needs to be of good quality to not be blocked) |
option.search |
See details here. |
option.mailbox |
Specify the mailbox to search, default is INBOX |
option.markAsRead |
Automatically mark found emails as read |
Returned results
The first, most recent email that matches the search query looks like this:
{
"uid": 1411,
"from": {
"address": "[email protected]",
"name": "Bịp Automation"
},
"to": {
"address": "[email protected]",
"name": ""
},
"date": "2024-09-07T05:14:16.000Z",
"html": "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"><div dir=\"ltr\">test</div>\n",
"text": "test\n"
}
Example
| (async function(){
//Find latest email in INBOX
const mail1 = await ImapFetch("[email protected]", "123456"); // Log(mail1)
//Find the latest email in INBOX that is unread and sent within the last 1 hour.
//Also mark it as read
const mail2 = await ImapFetch("[email protected]", "123456", {
search: {
seen: false,
since: new Date(Date.now()-3600000) //now subtract 3600000 miliseconds (~3600s = 1h)
},
markAsRead: true
}); // Log(mail2)
//Find the latest email whose sender email address contains [email protected]
const mail3 = await ImapFetch("[email protected]", "123456", {
search: {
from: "[email protected]"
}
}); // Log(mail3)
//Find the latest email whose content contains "Your OTP is"
const mail4 = await ImapFetch("[email protected]", "123456", {
search: {
body: "Your OTP is"
}
}); // Log(mail4)
//Find the latest email in the SPAM mailbox of another mail server
const mail5 = await ImapFetch("[email protected]", "123456", {
mailbox: 'Junk', //tìm trong mục SPAM
search: "*",
server: {
host: "imap.bipprofile.com",
port: 993,
secure: true,
}
}); // Log(mail5)
})();
|
Gmail, Yahoo, Hotmail (Outlook) mail types can be automatically detected by IMAP server, for other mail types you need to specify the server.
You can combine multiple search conditions together, so that you target the most relevant mail, avoiding the search range being too broad, causing the function to run slowly due to having to load too many mail. The data fields that can be used for searching are described in detail here.
If you are not sure what mailbox labels your IMAP server has, use the ImapGetMailboxes function below!
ImapGetMailboxes
Get the list of available mailboxes.
Syntax
await ImapGetMailboxes(user, pass, server)
Parameters
Parameters |
Description |
user |
Username including @xxx.xx (eg: [email protected]) |
pass |
Imap login password |
server |
Optional IMAP server, with gmail, hotmail and yahoo the function can automatically recognize, the rest you have to specify clearly. |
Return result
List of mailbox labels in array form as illustrated below:
["INBOX","Sent","Drafts","Junk","Deleted","Archive","Notes","Outbox"]
Example
| (async function(){
const boxes = await ImapGetMailboxes("[email protected]", "123456");
Log(boxes);
})();
|
OpenAIGenText
Text generation using Open AI.
Syntax
await OpenAIGenText(apiKey, prompt, model)
Parameters
Parameters |
Description |
apiKey |
Your OpenAI API Key |
prompt |
Request body |
model |
Specify the model, default is gpt-4o-mini |
Example
| (async function(){
const res = await OpenAIGenText("YOUR_OPENAI_API_KEY", "Tiểu sử Nguyễn Ái Quốc");
if(res.error) LogError(res);
else Log(res.content)
/*{
"content": "Nguyễn Ái Quốc, tên thật là Nguyễn Sinh Cung, sinh ngày 19 tháng 5 năm 1890 tại làng Hoàng Trù, huyện Nam Đàn, tỉnh Nghệ An, Việt Nam. Ông là một nhân vật lịch sử quan trọng trong cuộc đấu tranh giành độc lập cho Việt Nam và là người sáng lập Đảng Cộng sản Việt Nam.
Nguyễn Ái Quốc đã rời quê hương từ sớm để tìm kiếm một con đường giải phóng dân tộc. Ông đã sống và hoạt động ở nhiều nước khác nhau, bao gồm Pháp, Trung Quốc và Liên Xô. Trong thời gian ở Pháp, ông đã tham gia vào các phong trào cách mạng và viết nhiều bài báo, tài liệu kêu gọi độc lập cho Việt Nam.
Năm 1930, ông đóng vai trò quan trọng trong việc thành lập Đảng Cộng sản Việt Nam, đánh dấu sự chuyển mình cho phong trào cách mạng Việt Nam. Ông cũng là người đại diện cho Việt Nam tại Hội nghị Bonn và thành lập Mặt trận Việt Minh vào năm 1941.
Nguyễn Ái Quốc đã lãnh đạo cuộc Tổng khởi nghĩa tháng Tám năm 1945, dẫn đến việc thành lập nước Việt Nam Dân chủ Cộng hoà vào ngày 2 tháng 9 năm 1945, và ông trở thành Chủ tịch đầu tiên của nước này. Dưới sự lãnh đạo của ông, Việt Nam đã trải qua nhiều thử thách, bao gồm cuộc chiến tranh chống thực dân Pháp và chiến tranh đế quốc Mỹ khốn nạn.
Ông mất ngày 2 tháng 9 năm 1969, để lại một di sản vĩ đại đối với đất nước và dân tộc Việt Nam. Tên gọi Nguyễn Ái Quốc không chỉ là một cái tên, mà còn là biểu tượng cho tinh thần đấu tranh, lòng yêu nước và sự hy sinh vì sự nghiệp giải phóng dân tộc."
}
*/
})();
|
OpenAIGenImage
Create images using Open AI with model dall-e-3.
Syntax
await OpenAIGenImage(apiKey, prompt, type, size, quality, style)
Parameters
Parameters |
Description |
apiKey |
Your OpenAI API Key |
prompt |
A description of the image you want to create |
type |
Return data type, url or b64_json , default is url , note that when you choose url , the url of the image will only exist for 60 minutes! |
size |
Image size, width x height, only use one of the following values: 1024x1024 , 1024x1792 , 1792x1024 , default is 1024x1024 |
quality |
Image quality, standard or hd , default is standard |
style |
Image style, vivid or natural , default is vivid |
Example
| (async function(){
const res = await OpenAIGenImage("YOUR_OPENAI_API_KEY", "cute Doraemon");
if(res.error) LogError(res);
else Log(res)
/*
{
"created": 1725805782,
"url": "https://oaidalleapiprodscus.blob.core.windows.net/private/org-q3XdZ77JOR7...",
"revised_prompt": "An adorable, round..."
}
//await OpenAIGenImage("YOUR_OPENAI_API_KEY", "cute Doraemon", "b64_json");
{
"created": 1725805782,
"b64_json": "iVBOR...",
"revised_prompt": "An adorable, round..."
}
//Something went wrong
{
"error": {
"code": "content_policy_violation",
"message": "Your request was rejected as a result of our safety system. Your prompt may contain text that is not allowed by our safety system.",
"param": null,
"type": "invalid_request_error"
}
}
*/
})();
|
CallOpenAIApi
Send a request to the OpenAI API server. You can implement any API according to the OpenAI documentation.
Basically OpenAIGenText and OpenAIGenImage are both built on this function.
Syntax
await CallOpenAIApi(apiKey, path, params)
Parameters
Parameters |
Description |
apiKey |
Your OpenAI API Key |
path |
Path to the API function |
params |
JSON request parameters |
Example
| (async function(){
const text = await CallOpenAIApi("YOUR_OPENAI_API_KEY", "/chat/completions", {
model: "gpt-4o-mini",
messages: [
{
role: "user",
content: "Tiểu sử Nguyễn Ái Quốc"
}
]
});
const image = await CallOpenAIApi("YOUR_OPENAI_API_KEY", "/images/generations", {
model: "dall-e-3",
n: 1,
prompt: "cute Doraemon",
size: "1024x1024"
});
})();
|
Capture the headers of a sent request.
Syntax
await CatchRequestHeaders(filter, timeout)
Parameters
Parameters |
Description |
filter |
Request filter, see example |
timeout |
Maximum wait time, default is 60s |
Example
| (async function(){
const headers = await CatchRequestHeaders({
urls: ["https://bipprofile.io/api/test"],
types: ["xmlhttprequest"]
});
Log(headers); //{header1: value1, header2: value2, ...}
/*
types:
"main_frame"
"sub_frame"
"stylesheet"
"script"
"image"
"font"
"object"
"xmlhttprequest"
"ping"
"csp_report"
"media"
"websocket"
"webbundle"
"other"
*/
})();
|
Keyboard
SendKeyPress
Simulate keypress event.
Syntax
await SendKeyPress (keyCode, modifiers)
Parameters
Parameters |
Description |
keyCode |
Key Code |
modifiers |
Valid values: WITH_ALT , WITH_CTRL , WITH_COMMAND , WITH_SHIFT |
Example
| (async function(){
await SendKeyPress (K_KEYA); //press A
await SendKeyPress (K_KEYV, WITH_CTRL); //press Ctrl + V
await SendKeyPress (K_KEYV, WITH_CTRL | WITH_SHIFT); //press Ctrl + Shift + V
})();
|
SendKeyDown
Simulate keydown event.
Syntax
await SendKeyDown (keyCode, modifiers)
Parameters
Parameters |
Description |
keyCode |
Key Code |
modifiers |
Valid values: WITH_ALT , WITH_CTRL , WITH_COMMAND , WITH_SHIFT |
Example
| (async function(){
await SendKeyDown (K_KEYA); //keydown A
})();
|
SendKeyUp
Simulate keyup event.
Syntax
await SendKeyUp (keyCode, modifiers)
Parameters
Parameters |
Description |
keyCode |
Key Code |
modifiers |
Valid values: WITH_ALT , WITH_CTRL , WITH_COMMAND , WITH_SHIFT |
Example
| (async function(){
await SendKeyUp (K_KEYA); //keydown A
})();
|
SendKeyChar
Simulate keychar event.
Syntax
await SendKeyChar (keyCode)
Parameters
Example
| (async function(){
await SendKeyChar (K_KEYA);
await SendKeyChar ("a");
})();
|
Typing
Simulate typing.
Syntax
await Typing (text[, speed1, speed2])
Parameters
Parameters |
Description |
text |
The text to type. |
speed1 - speed2 |
Delay between typing to make it look human (in milliseconds). |
Example
| (async function(){
//The flash typing
await Typing ("Hello Bịp Profile");
//Human typing
await Typing ("Hello Bịp Profile", 300, 500);
})();
|
Mouse
All of the click functions below simulate a mouse move to the target before the click is performed!
ClickByCoordinates
Click on a specified coordinate on the web page.
Syntax
await ClickByCoordinates (x1, y1, x2, y2, nClick=1)
Parameters
Parameters |
Description |
x1 |
Upper left corner x coordinate |
y1 |
Upper left corner y coordinate |
x2 |
Lower right corner x coordinate |
y2 |
Lower right corner y coordinate |
nClick |
Number of clicks, default is 1 |

Example
| (async function(){
await ClickByCoordinates(100, 100, 200, 200);
await ClickByCoordinates(100, 100, 200, 200, 2);//double click
})();
|
Tip
You can easily create this command using the May Extension!
ClickBySelector
Click an element on the web page using a CSS selector.
Syntax
await ClickBySelector (selector, index=0, nClick = 1, frameSearch="", frameSearchType="")
Parameters
Parameters |
Description |
selector |
A CSS selector. |
index |
The element index to use if the CSS selector matches more than one element. 0 is the first element, or enter random to randomly select an element. |
nClick |
The number of clicks, defaults to 1 |
frameSearch |
If the element is in an iframe, you need to identify the frame using the src attribute or a path to that frame. |
frameSearchType |
Frame type, vailed values: "src-starts" , "src-ends" , "src-equals" , "src-contains" , "src-regex" , "frame-path" , default is "src-contains" . |
Example
| (async function(){
//click a link containing bipprofile.io
await ClickBySelector("a[href*='bipprofile.io']");
//click a button with id submit, inside an iframe with src attribute starting with https://bipprofile.io
await ClickBySelector("button#submit", 0, 1, "https://bipprofile.io", "src-starts");
//click a button with id submit, inside an iframe with src attribute exactly equal to https://bipprofile.io/contact.html
await ClickBySelector("button#submit", 0, 1, "https://bipprofile.io/contact.html", "src-equals");
//click a button with id submit, inside an iframe with src attribute ending in /contact.html
await ClickBySelector("button#submit", 0, 1, "/contact.html", "src-ends");
//click a button with id submit, inside an iframe with src attribute containing bipprofile.io
await ClickBySelector("button#submit", 0, 1, "bipprofile.io", "src-contains");
//click a button with id submit, inside an iframe with src attribute matching regex bip[a-z]+\.io
await ClickBySelector("button#submit", 0, 1, "bip[a-z]+\.io", "src-regex");
//click a button with id submit, inside the first iframe in the site
await ClickBySelector("button#submit", 0, 1, "0", "frame-path");
//click a button with id submit, inside the second iframe of the first iframe in the site
await ClickBySelector("button#submit", 0, 1, "0>1", "frame-path");
})();
|
Tip
You can easily create this command using the May Extension!
ClickById
Click an element by ID.
Syntax
await ClickById (id, nClick=1, frameSearch="", frameSearchType="")
Parameters
Example
| (async function(){
await ClickById("load-more-button");
//same as
//await ClickBySelector("#load-more-button");
})();
|
ClickByTag
Click on an element by tag.
Syntax
await ClickByTag (tag, index, nClick=1, frameSearch="", frameSearchType="");
Parameters
Example
| (async function(){
await ClickByTag("iframe"); //click the first iframe tag
await ClickByTag("iframe", 1); //click the second iframe tag
await ClickByTag("div", "random", 2); //double click a random div tag
})();
|
ClickByClass
Click on an element by class.
Syntax
await ClickByClass (class, index, nClick=1, frameSearch="", frameSearchType="");
Parameters
Example
| (async function(){
await ClickByClass("skip-button"); //click the first element with class "skip-button"
await ClickByClass("skip-button", 1); //click the second element with class "skip-button"
await ClickByClass("skip-button", "random"); //randomly click an element with class "skip-button"
})();
|
ClickByXpath
Click on an element by xpath.
Syntax
await ClickByXpath (xpath, nClick=1, frameSearch="", frameSearchType="");
Parameters
Example
| (async function(){
await ClickByXpath("/html/body/div/div[1]/div/ul/li[6]/a/div[1]/span");
await ClickByXpath(GenerateXpath("a", "href", "https://bipprofile.io%"));
})();
|
ClickRandomLink
Click a random link on the site.
Syntax
await ClickRandomLink (frameSearch="", frameSearchType="");
Parameters
Example
| (async function(){
await ClickRandomLink();
//same as
//await ClickByTag("a", "random");
//await ClickBySelector("a", "random");
})();
|
ClickRandomInternalLink
Randomly click an internal link on the site.
Syntax
await ClickRandomInternalLink (frameSearch="", frameSearchType="");
Parameters
Example
| (async function(){
await ClickRandomInternalLink();
})();
|
ClickRandomExternalLink
Randomly click an external link on the site.
Syntax
await ClickRandomExternalLink (frameSearch="", frameSearchType="");
Parameters
Example
| (async function(){
await ClickRandomExternalLink();
})();
|
SendMouseMove
Simulate mousemove event.
Syntax
await SendMouseMove (x, y);
Parameters
Parameters |
Description |
x |
The x coordinate. |
y |
The y coordinate. |
Example
| (async function(){
await SendMouseMove (100, 200);
})();
|
SendMouseWheel
Simulate mousewheel event.
Syntax
await SendMouseWheel (deltaX, deltaY);
Parameters
Parameters |
Description |
deltaX |
Horizontal scroll distance |
deltaY |
Vertical scroll distance |
Example
| (async function(){
await SendMouseWheel(0, -120); //scroll down 120px
await Delay(3000);
await SendMouseWheel(0, 120); //scroll up 120px
})();
|
MoveMouse
Simulate mouse moving between two points.
Syntax
await MoveMouse (startPoint, endPoint, modifiers = 0, button = "none");
Parameters
Parameters |
Description |
startPoint |
The coordinates of the starting point. |
endPoint |
The coordinates of the ending point. |
modifiers |
Modifier keys: WITH_ALT, WITH_CTRL, WITH_COMMAND, WITH_SHIFT. |
button |
The mouse button pressed: none , left , right , middle . |
Example
| (async function(){
await WaitForLoading();
await MoveMouse({X: 0, Y: 0}, {X: 300, Y: 300});
await MoveMouse({X: 300, Y: 300}, {X: 0, Y: 300});
await MoveMouse({X: 0, Y: 300}, {X: 300, Y: 0});
await MoveMouse({X: 300, Y: 0}, {X: 0, Y: 0});
})();
|
MoveMouseToArea
Move the mouse to a random location within the specified area.
Syntax
await MoveMouseToArea (x1, y1, x2, y2, modifiers = 0, button = "none");
Parameters
Parameters |
Description |
x1 |
Top left x coordinate |
y1 |
Top left y coordinate |
x2 |
Bottom right x coordinate |
y2 |
Bottom right y coordinate |
modifiers |
See MoveMouse |
button |
See MoveMouse |

Example
| (async function(){
await WaitForLoading();
await MoveMouseToArea(0, 0, 300, 300);
await MoveMouseToArea(0, 0, 300, 300);
})();
|
MoveMouseToAnyWhere
Move the mouse to a random location in the site.
Syntax
await MoveMouseToAnyWhere (modifiers = 0, button = "none");
Parameters
Example
| (async function(){
await WaitForLoading();
await MoveMouseToAnyWhere();
await MoveMouseToAnyWhere();
})();
|
MoveMouseToElmBySelector
Move the mouse to an element identified by a CSS selector.
Syntax
await MoveMouseToElmBySelector (selector, index=0, frameSearch="", frameSearchType="", modifiers = 0, button = "none");
Parameters
Example
| (async function(){
//testing url https://google.com/
await WaitForLoading();
//move mouse to the search text box
await MoveMouseToElmBySelector ('textarea[title="Search"]');
})();
|
DragMouse
Drag and drop between two points.
Syntax
await DragMouse (startPoint, endPoint, speed = 0.5, button = "left", modifiers = 0);
Parameters
Parameters |
Description |
startPoint |
Start point. |
endPoint |
End point. |
speed |
Drag speed. |
button |
See MoveMouse |
modifiers |
See MoveMouse |
Example
| (async function(){
//Drag from 0,0 to 300,300
await DragMouse({X: 0, Y: 0}, {X: 300, Y: 300});
//Drag from 0,0 to 300,300 slower
await DragMouse({X: 0, Y: 0}, {X: 300, Y: 300}, 10);
//Drag from 0,0 to 300,300 slower by right mouse
await DragMouse({X: 0, Y: 0}, {X: 300, Y: 300}, 10, "right");
//Drag from 0,0 to 300,300 slower by right mouse with Ctrl + Shift
await DragMouse({X: 0, Y: 0}, {X: 300, Y: 300}, 10, "right", WITH_CTRL | WITH_SHIFT);
})();
|
Other Interactions
Navigate
Navigate the browser to a URL.
Syntax
await Navigate (url, referrer);
Parameters
Parameters |
Description |
url |
Link to the website to download. |
referrer |
Spoof referrer link (optional). |
Example
| (async function(){
await Navigate("https://google.com/");
await WaitForLoading();
await Navigate("https://bipprofile.io/", "https://google.com/");
})();
|
CapturePage
Take a screenshot of the browser and return the data in base64 encoded.
Syntax
await CapturePage (quality);
Parameters
Parameters |
Description |
quality |
Image quality, from 0-100, default is 80. |
Example
| (async function(){
const imgBase64 = await CapturePage();
const betterImgBase64 = await CapturePage(100);
})();
|
CaptureArea
Take a screenshot of the browser within a specified area and return the data in base64 encoded.
Syntax
await CaptureArea (x1, y1, x2, y2, quality);
Parameters
Parameters |
Description |
x1 |
Top left x coordinate |
y1 |
Top left y coordinate |
x2 |
Bottom right x coordinate |
y2 |
Bottom right y coordinate |
quality |
Image quality, from 0-100, default is 80. |

Example
| (async function(){
const imgBase64 = await CaptureArea(0, 0, 300, 500);
const betterImgBase64 = await CaptureArea(0, 0, 300, 500, 100);
})();
|
Tip
You can easily create this command using the May Extension!
CaptureElement
Takes an image of an element displayed on a web page and returns the data in base64 encoded.
Syntax
await CaptureElement (selector, quality, frameSearch, frameSearchType);
Parameters
Example
| (async function(){
const captcha = await CaptureElement("#image_captcha");
const avatar = await CaptureElement("#profile img.avatar");
})();
|
GetElementPosBySelector
Get the coordinates of an element using a CSS selector.
Syntax
await GetElementPosBySelector (selector, frameSearch, frameSearchType);
Parameters
Example
| (async function(){
const pos = await GetElementPosBySelector("#image_captcha");
//eg: {x1: 100, y1: 100, x2: 200, y2: 200}
})();
|
Tip
You can easily create this command using the May Extension!
SetFilesToElement
Set the selected file to the file input
tags, usually used when you need to upload.
Syntax
await SetFilesToElement (selector, files, frameSearch, frameSearchType);
Parameters
Example
| (async function(){
//tested on link https://ps.uci.edu/~franklin/doc/file_upload.html
await SetFilesToElement("html>body>form>input", ["D:\\test_file.txt"]);
})();
|
Tip
You can easily create this command using the May Extension!
Scroll the web page to the specified position.
Syntax
await ScrollTo (x, y, smooth = false);
Parameters
Parameters |
Description |
x |
x coordinate. |
y |
y coordinate. |
smooth |
Smooth or fast scroll. |
Example
| (async function(){
await ScrollTo(0, 1000);
await ScrollTo(0, 0, true);
})();
|
ResizeTo
Resize browser.
Syntax
await ResizeTo (width, height);
Parameters
Parameters |
Description |
width |
Width. |
height |
Height. |
Example
| (async function(){
await ResizeTo (600, 500);
})();
|
MoveTo
Move the browser window to a specified location on the screen.
Syntax
Parameters
Parameters |
Description |
x |
The x coordinate. |
y |
The y coordinate. |
Example
| (async function(){
await MoveTo (100, 150);
})();
|
TabFocus
Activates a tab or popup when the browser has more than one tab open. After calling the TabFocus function, all subsequent functions will be run on the newly focused tab.
Syntax
Parameters
Parameters |
Description |
target |
Can be either the tab number (starting from 1) or a text pattern that appears in the URL. |
Example
| (async function(){
await WaitForLoading();
await EvalScript('open("https://google.com")');
await EvalScript('open("https://facebook.com")');
await Delay(2000);
await EvalScript('document.write("this is main tab")');
await TabFocus(2); //focus to the 2nd tab
await Delay(1000);
await EvalScript('document.write("this 2nd tab")');
await TabFocus("facebook.com"); //focus to the tab which has url contains "facebook.com"
await Delay(1000);
await EvalScript('document.write("this facebook tab")');
//focus to the first tab that does not contains facebook.com
await TabFocus("!facebook.com");
})();
|
EvalScript
Execute javascript code on a web page, the returned results are primitive data (number, string) or simple objects.
Syntax
await EvalScript (jsCode, frameSearch="", frameSearchType="");
Parameters
Example
| (async function(){
await WaitForLoading();
const r1 = await EvalScript ('"bip" + "profile"');
//r1 = {"result":"bipprofile"}
const r2 = await EvalScript ('null[0]');
//r2 = {"error":"TypeError: Cannot read properties of null (reading '0')"}
})();
|
EvalScriptWithPromise
Similar to EvalScript but if your code is an async function or a function returns a Promise then use this function.
Syntax
await EvalScriptWithPromise (jsCode, frameSearch="", frameSearchType="");
Parameters
Example
| (async function(){
await WaitForLoading();
const r1 = await EvalScript ('"bip" + "profile"');
//r1 = {"result":"bipprofile"}
const r2 = await EvalScriptWithPromise ('Promise.resolve("bipprofile")');
//r2 = {"result":"bipprofile"}
const r3 = await EvalScriptWithPromise ('Promise.noSuchFunc("bipprofile")');
//r3 = {"error":"TypeError: Promise.noSuchFunc is not a function"}
})();
|
SetBySelector
Sets an attribute of an element by ID.
Syntax
await SetBySelector (selector, attr, value, index, frameSearch="", frameSearchType="");
Parameters
Parameters |
Description |
selector |
The ID of the element. |
attr |
The attribute to set the value to. |
value |
The value of the attr . |
index |
The element index to use if the CSS selector matches more than one element. 0 is the first element, or enter random to take one randomly, all to apply to all. |
frameSearch |
If the element is in an iframe, you need to specify the frame. |
frameSearchType |
Frame type, including values: "src-starts" , "src-ends" , "src-equals" , "src-contains" , "src-regex" , "frame-path" , default is "src-contains" . |
Example
| (async function(){
await WaitForLoading();
await SetBySelector("#email", "value", "[email protected]");
await SetBySelector(".address", "value", "mars", "all");
//set the value to "[email protected]" for the input tag with id email, inside an iframe with src attribute starting with https://bipprofile.io
await SetBySelector("input#email", "value", "[email protected]", 0, "https://bipprofile.io", "src-starts");
//set the value to "[email protected]" for the input tag with id email, inside an iframe with src attribute exactly equal to https://bipprofile.io/contact.html
await SetBySelector("input#email", "value", "[email protected]", 0, "https://bipprofile.io/contact.html", "src-equals");
//set the value to "[email protected]" for the input tag with id email, inside an iframe with src attribute ending in /contact.html
await SetBySelector("input#email", "value", "[email protected]", 0, "/contact.html", "src-ends");
//set the value to "[email protected]" for the input tag with id email, inside an iframe with src attribute containing bipprofile.io
await SetBySelector("input#email", "value", "[email protected]", 0, "bipprofile.io", "src-contains");
//set the value to "[email protected]" for the input tag with id email, inside an iframe with src attribute matching regex bip[a-z]+\.io
await SetBySelector("input#email", "value", "[email protected]", 0, "bip[a-z]+\.io", "src-regex");
//set the value to "[email protected]" for the input tag with id email, inside the first iframe on the site
await SetBySelector("input#email", "value", "[email protected]", 0, "0", "frame-path");
//set value to "[email protected]" for input tag with id email, inside 2nd iframe of 1st iframe in site
await SetBySelector("input#email", "value", "[email protected]", 0, "0>1", "frame-path");
})();
|
SetById
Sets the value of an element attribute by ID.
Syntax
await SetById (id, attr, value, frameSearch="", frameSearchType="");
Parameters
Parameters |
Description |
id |
ID of the element. |
attr |
Attribute to set value. |
value |
Value. |
frameSearch |
See SetBySelector |
frameSearchType |
See SetBySelector |
Example
| (async function(){
await WaitForLoading();
await SetById("email", "value", "[email protected]");
})();
|
SetByClass
Sets the value of an element's class attribute.
Syntax
await SetByClass (class, attr, value, index, frameSearch="", frameSearchType="");
Parameters
Parameters |
Description |
class |
The class name of the element. |
attr |
The attribute to set the value to. |
value |
The value. |
index |
See SetBySelector |
frameSearch |
See SetBySelector |
frameSearchType |
See SetBySelector |
Example
| (async function(){
await WaitForLoading();
await SetBySelector("#email", "value", "[email protected]");
await SetBySelector(".address", "value", "mars", "all");
})();
|
SetByTag
Sets the value of an element attribute by tag name.
Syntax
await SetByTag (tag, attr, value, index, frameSearch="", frameSearchType="");
Parameters
Parameters |
Description |
tag |
Tag name of the element. |
attr |
The attribute you want to set. |
value |
The value you want to set. |
index |
See SetBySelector |
frameSearch |
See SetBySelector |
frameSearchType |
See SetBySelector |
Example
| (async function(){
await WaitForLoading();
await SetByTag("input", "value", "text value");
await SetByTag("input", "value", "text value", 2);
await SetByTag("input", "value", "text value", "random");
await SetByTag("input", "value", "text value", "all");
})();
|
SetByXpath
Sets the value of an element attribute by xpath name.
Syntax
await SetByXpath (xpath, attr, value, frameSearch="", frameSearchType="");
Parameters
Parameters |
Description |
xpath |
Xpath of the elements. |
attr |
The attribute you want to set. |
value |
The value you want to set. |
frameSearch |
See SetBySelector |
frameSearchType |
See SetBySelector |
Example
| (async function(){
await WaitForLoading();
await SetByXpath ('//input[@type="email"]', 'value', '[email protected]');
})();
|
Captcha processing
_2CaptchaSolve
Solve captchas using 2Captcha service.
If you use another service that is similar or compatible with 2captcha, you can
override the server API in the _2CaptchaServer
variable.
Syntax
await _2CaptchaSolve (params, timeout);
Parameters
Parameters |
Description |
params |
Parameters according to the 2Captcha documentation. |
timeout |
Maximum wait time in seconds. |
Example
| (async function(){
//_2CaptchaServer = "http://a-similar-2captcha.com";
const captBase64 = await CaptureElement("#CAPTCHA_IMAGE");
const result = await _2CaptchaSolve({
'key' : '2CAPTCHA_API_KEY', //replace with your 2Captcha API Key
'method' : 'base64',
'json' : 1,
'body': captBase64
});
Log("Result is:", result.request);
//Example Result: {status:1, request: VMXKDG, captchaId: 1241352612}
})();
|
_2CaptchaReportBad
If you believe the captcha is solved incorrectly, you can report it for a refund, but do not abuse it as it may violate the provider's policy.
Syntax
await _2CaptchaReportBad (key, captchaId);
Parameters
Example
| (async function(){
//_2CaptchaServer = "http://a-similar-2captcha.com";
const captBase64 = await CaptureElement("#CAPTCHA_IMAGE");
const result = await _2CaptchaSolve({
'key' : '2CAPTCHA_API_KEY', //replace with your 2Captcha API Key
'method' : 'base64',
'json' : 1,
'body': captBase64
});
//assuming the site tell you that captcha is invalid
await _2CaptchaReportBad('2CAPTCHA_API_KEY', result.captchaId);
})();
|
ACSolve
Solve captchas using anti-captcha service.
If you use another service that is similar or compatible with anti-captcha, you can
override the server API in the AntiCaptchaServer
variable.
Syntax
await ACSolve (params, timeout);
Parameters
Parameters |
Description |
params |
parameters according to anti-captcha documentation. |
timeout |
Timeout in seconds. |
Example
| (async function(){
//AntiCaptchaServer = "http://a-similar-anti-captcha.com";
//image captcha
const captBase64 = await CaptureElement("#CAPTCHA_IMAGE");
const result = await ACSolve({
"clientKey":"Your anti-captcha API Key",
"task":
{
"type":"ImageToTextTask",
"body":captBase64,
"phrase":false,
"case":false,
"numeric":false,
"math":0,
"minLength":0,
"maxLength":0
}
}, 150);
/* Example result
{
"taskId":1234567,
"errorId":0,
"status":"ready",
"solution":
{
"text":"deditur",
"url":"http:\/\/61.39.233.233\/1\/147220556452507.jpg"
},
"cost":"0.000700",
"ip":"46.98.54.221",
"createTime":1472205564,
"endTime":1472205570,
"solveCount":"0"
}
*/
//Google ReCAPTCHA
const result2 = await ACSolve({
"clientKey": "Your anti-captcha API Key",
"task":
{
"type":"NoCaptchaTaskProxyless",
"websiteURL":"https://bipprofile.com",
"websiteKey":"6LdPp08UAAAAADi4dE6frVDXCv2CgESTpcscb_LS"
}
}, 600);
})();
|
ACReportIncorrectImage
If you believe the captcha is solved incorrectly, you can report it for a refund, but do not abuse it as it may violate the provider's policy.
Syntax
await ACReportIncorrectImage(key, taskId);
Parameters
Example
| (async function(){
//AntiCaptchaServer = "http://a-similar-anti-captcha.com";
const captBase64 = await CaptureElement("#CAPTCHA_IMAGE");
const result = await ACSolve({
"clientKey":"Your anti-captcha API Key",
"task":
{
"type":"ImageToTextTask",
"body":captBase64,
"phrase":false,
"case":false,
"numeric":false,
"math":0,
"minLength":0,
"maxLength":0
}
}, 150);
if(something went wrong)
{
ACReportIncorrectImage("Your anti-captcha API Key", result.taskId);
}
})();
|
ACReportIncorrectRecaptcha
Similar to ACReportIncorrectImage but used with ReCAPTCHA.
SolveRecaptcha
This is the ReCAPTCHA solver function, built on _2CaptchaSolve and ACSolve.
If the captcha is solved successfully, you can continue with the next actions such as clicking the Submit button, Continue, etc.
In addition, you can use the TryToCallRecaptchaCallBack function to trigger the callback function (if any) on the site when the captcha has been solved.
Syntax
await SolveRecaptcha (service, apiKey, timeout = 300, overrideApiServer = null);
Parameters
Parameters |
Description |
service |
Valid values: 2captcha or anti-captcha |
apiKey |
API Key of 2captcha or anti-captcha |
timeout |
Maximum timeout in seconds |
overrideApiServer |
Overrides the original API endpoint if you use a similar service |
Example
| (async function(){
//test on https://www.google.com/recaptcha/api2/demo
await WaitForLoading ();
const result = await SolveRecaptcha("2captcha", "YOUR_API_KEY");
//const result = await SolveRecaptcha("anti-captcha", "YOUR_API_KEY");
await ClickBySelector('#recaptcha-demo-submit'); //click submit button
//await TryToCallRecaptchaCallBack(result.request);
/*
Example of result value:
2captcha: {"status":1,"request":"THE_RESPONSE_RESULT","captchaId":"71006265012"}
anti-captcha:
{
"errorId":0,
"status":"ready",
"solution":{
"gRecaptchaResponse":"THE_RESPONSE_RESULT",
"cookies":{
"_GRECAPTCHA":"COOKIES..."
}
},
"cost":"0.00200",
"ip":"1.2.3.4",
"createTime":1658115990,
"endTime":1658116074,
"solveCount":0,
"taskId":685667638
}
*/
})();
|
SolvehCaptcha
Similar to SolveRecaptcha but used with hCaptcha.
Syntax
await SolvehCaptcha (service, apiKey, timeout = 300, overrideApiServer = null);
Parameters
Parameters |
Description |
service |
Valid values: 2captcha or anti-captcha |
apiKey |
API Key of 2captcha or anti-captcha |
timeout |
Maximum timeout in seconds |
overrideApiServer |
Overrides the original API endpoint if you use a similar service |
Example
| (async function(){
//test on https://accounts.hcaptcha.com/demo
await WaitForLoading ();
const result = await SolvehCaptcha("2captcha", "YOUR_API_KEY");
//const result = await SolvehCaptcha("anti-captcha", "YOUR_API_KEY");
await ClickById('hcaptcha-demo-submit'); //click submit button
})()
|
SolveImageCaptcha
Similar to SolveRecaptcha but used for image captchas.
Syntax
await SolveImageCaptcha (imgSelector, resultSelector, service, apiKey, timeout = 300, overrideApiServer = null);
Parameters
Parameters |
Description |
imgSelector |
CSS selector of the captcha image. |
resultSelector |
CSS selector text box to enter the result. |
service |
Valid values: 2captcha or anti-captcha |
apiKey |
API Key of 2captcha or anti-captcha |
timeout |
Maximum timeout in seconds |
overrideApiServer |
Override the original API endpoint if you use a similar service |
Example
| (async function(){
//test on https://captcha.com/demos/features/captcha-demo.aspx
await WaitForLoading ();
const result = await SolveImageCaptcha("#demoCaptcha_CaptchaImage", "#captchaCode", "2captcha", "YOUR_API_KEY")
// const result = await SolveImageCaptcha("#demoCaptcha_CaptchaImage", "#captchaCode", "anti-captcha", "YOUR_API_KEY")
await ClickBySelector ("#validateCaptchaButton");
/*
Example of result value:
2captcha: {"status":1,"request":"bw8t","captchaId":"71014870176"}
anti-captcha:
{
"errorId":0,
"status":"ready",
"solution":{
"text":"BW8T",
"url":"http://209.212.146.170/80/165820017899645.jpg"
},
"cost":"0.00070",
"ip":"1.2.3.4",
"createTime":1658200178,
"endTime":1658200181,
"solveCount":0,
"taskId":701277528
}
*/
})()
|
TryToCallRecaptchaCallBack
Try to find and execute the callback function (if any) after solving the ReCAPTCHA.
Syntax
TryToCallRecaptchaCallBack (result);
Parameters
Parameters |
Description |
result |
ReCAPTCHA solving result. |
Example
| (async function(){
const result = await ACSolve({
"clientKey": "Your anti-captcha API Key",
"task":
{
"type":"NoCaptchaTaskProxyless",
"websiteURL":"https://bipprofile.io",
"websiteKey":"6LdPp08UAAAAADi4dE6frVDXCv2CgESTpcscb_LS"
}
}, 600);
await TryToCallRecaptchaCallBack(result.solution.gRecaptchaResponse);
})()
|
File
GetCurrentDir
Get the root directory of Bịp Profile.
Syntax
Example
| (async function(){
const root = GetCurrentDir();
Log("Working dir:", root);
})();
|
GetHomeDir
Get user's home directory on computer.
Syntax
Example
| (async function(){
const home = GetHomeDir();
Log("Home dir:", home);
})();
|
GetDownloadDir
Get the folder where the downloaded files are saved.
Syntax
Example
| (async function(){
const dl = GetDownloadDir();
Log("Download dir:", dl);
})();
|
ReadFileAsString
Read file and return data as text.
Syntax
Parameters
Parameters |
Description |
path |
Path to the file. |
Returned result
An object with properties illustrated as follows
{result: "FILE_CONTENT"}
or
{error: "ERROR_MESSAGE"}
Example
| (async function(){
const read = ReadFileAsString("D:\\my-proxies.txt");
Log("Result is:", read.result);
//{result: "1.1.1.1:6969"}
//{error: "file does not exists"}
})();
|
ReadFileAsLines
Read file and return data as an array of lines.
Syntax
Parameters
Parameters |
Description |
path |
Path to the file. |
Returned result
An object with properties illustrated as follows
{result: STRING_ARRAY}
hoặc
{error: "ERROR_MESSAGE"}
Example
| (async function(){
const read = ReadFileAsLines("D:\\my-proxies.txt");
Log("Result is:", read.result);
//{result: ["1.1.1.1:6969", "1.1.1.1:6970"]}
//{error: "file does not exists"}
})();
|
ReadFileAsBytes
Read file and return data in binary format.
Syntax
Parameters
Parameters |
Description |
path |
Path to the file. |
Returned result
An object with properties as illustrated below
{result: ArrayBuffer}
or
{error: "ERROR_MESSAGE"}
Example
| (async function(){
const read = ReadFileAsBytes("D:\\my-proxies.txt");
Log("Result is:", read.result);
//{result: ArrayBuffer}
//{error: "file does not exists"}
})();
|
WriteFile
Write data to file.
Syntax
WriteFile (path, data, append);
Parameters
Parameters |
Description |
path |
Path to file. |
data |
Text or binary data. |
append |
Appends or overwrites data, true or false . |
Returned result
An object with properties as illustrated below
{result: true}
or
{error: "ERROR_MESSAGE"}
Example
| (async function(){
WriteFile("D:\\bipprofile.txt", "vi tuong lai");
WriteFile("D:\\bipprofile.txt", " MMO Viet", true); //ghi nối thêm vào file
})();
|
TouchFile
Touch file.
Syntax
Parameters
Parameters |
Description |
path |
Path to file. |
Returned result
An object with properties as illustrated below
{result: true}
or
{error: "ERROR_MESSAGE"}
Example
| (async function(){
TouchFile("D:\\bipprofile.txt");
})();
|
PathExists
Checks whether a path (file or directory) exists.
Syntax
Parameters
Parameters |
Description |
path |
Path to file. |
Example
| (async function(){
const exists = PathExists("D:\\bipprofile.txt");
if(exists) Log("File exists");
else Log("File does not exists");
})();
|
GetFileInfo
Get file information.
Syntax
Parameters
Parameters |
Description |
path |
Path to file. |
Returned result
An object with properties as illustrated below
{
"result": {
"creationTime": 1724735412.946547,
"isDirectory": false,
"isSymbolicLink": false,
"lastAccessed": 1724735417.776545,
"lastModified": 1724735417.776545,
"size": 21
}
}
hoặc
{error: "ERROR_MESSAGE"}
Example
| (async function(){
const info = GetFileInfo("D:\\bipprofile.txt");
Log(info);
})();
|
CopyFileOrDir
Copy file or folder.
Syntax
CopyFileOrDir (src, dst);
Parameters
Parameters |
Description |
src |
Source path. |
dst |
Destination path. |
Returned result
An object with properties as illustrated below
{result: true}
or
{error: "ERROR_MESSAGE"}
Example
| (async function(){
CopyFileOrDir("D:\\bipprofile.txt", "D:\\bipprofile2.txt");
})();
|
MoveFileOrDir
Move file or folder.
Syntax
MoveFileOrDir (src, dst);
Parameters
Parameters |
Description |
src |
Source path. |
dst |
Destination path. |
Returned result
An object with properties as illustrated below
{result: true}
or
{error: "ERROR_MESSAGE"}
Example
| (async function(){
MoveFileOrDir("D:\\bipprofile.txt", "E:\\bipprofile.txt");
})();
|
DelFileOrDir
Delete file or folder.
Syntax
Parameters
Parameters |
Description |
path |
Path to file. |
Returned result
An object with properties as illustrated below
{result: true}
or
{error: "ERROR_MESSAGE"}
Example
| (async function(){
DelFileOrDir("D:\\bipprofile.txt");
})();
|
MkDir
Create a dictonary.
Syntax
Parameters
Parameters |
Description |
path |
Path to create. |
Returned result
An object with properties as illustrated below
{result: true}
or
{error: "ERROR_MESSAGE"}
Example
| (async function(){
MkDir("D:\\new-folder");
})();
|
ReadDir
Returns a list of items in a directory.
Syntax
Parameters
Parameters |
Description |
path |
Path. |
Returned result
An object with properties illustrated as follows
{
"result": [
"full_path_to_file1",
"full_path_to_file2",
"full_path_to_a_dir"
]
}
or
{error: "ERROR_MESSAGE"}
Example
| (async function(){
const list = ReadDir("D:\\new-folder");
Log(list);
})();
|
Cookies
GetCookies
Get some or all cookies according to a filter. If no filter is specified, all cookies will be returned.
Syntax
await GetCookies (filter);
Details: filter is an object with the following properties
Attribute |
Description |
domain |
The domain of the cookie. |
url |
The URL of the cookie. |
path |
The path in the URL of the cookie. |
name |
The name of the cookie. |
Example
| (async function(){
const allCookies = await GetCookies();
Log("all:", allCookies );
const googleCookies = await GetCookies({domain: "google.com"});
Log("google:", googleCookies);
})()
|
GetCookie
Get a cookie by name.
Syntax
await GetCookie (name, url);
Chi tiết: filter là một object với các thuộc tính sau
Attribute |
Description |
name |
Cookie name. |
url |
Cookie URL. |
Example
| (async function(){
const cookie = await GetCookie("PHPSESSID", "https://myhttpheader.com/");
Log(cookie );
/*
{
"domain": "myhttpheader.com",
"hostOnly": true,
"httpOnly": false,
"name": "PHPSESSID",
"path": "/",
"sameSite": "unspecified",
"secure": true,
"session": true,
"storeId": "0",
"value": "d353f7f28ed8c7947749934e6633174b"
}
*/
})()
|
SetCookie
Set cookie.
Syntax
await SetCookie (cookie);
Details: cookie is an object with the following properties
Attribute |
Description |
name |
Cookie name (Required). |
value |
Cookie value (Required). |
url |
Cookie URL (Required). |
expires |
Cookie expiration in Unix timestamp. |
path |
Cookie URL path. |
domain |
Cookie domain. |
httpOnly |
HttpOnly. |
sameSite |
same-site status. |
secure |
Secure. |
Example
| (async function(){
await SetCookie({
"name": "BIP_PROFILE",
"value": "DINH_NOC_KICH_TRAN_BAY_PHAP_PHOI",
"url": "https://bipprofile.io",
"expires": Date.now()/1000 + 86400*3 //3 ngày
});
const cookie = await GetCookie("BIP_PROFILE", "https://bipprofile.io");
Log(cookie);
})()
|
DeleteCookies
Delete one or more cookies.
Syntax
await DeleteCookies (name, domain, url);
Details: cookie is an object with the following properties
Attribute |
Description |
name |
Cookie name (Required). |
url |
Cookie URL (If not specified, domain must be specified). |
domain |
Cookie domain (If not specified, url must be specified). |
Example
| (async function(){
await SetCookie({
"name": "BIP_PROFILE",
"value": "FUCKING_AWESOME",
"url": "https://bipprofile.io",
"expires": Date.now()/1000 + 86400*3 //3 days
});
Log("Before delete:", await GetCookie("BIP_PROFILE", "https://bipprofile.io"));
await DeleteCookies("BIP_PROFILE", "bipprofile.io");
Log("After deleted:", await GetCookie("BIP_PROFILE", "https://bipprofile.io")); //null
})()
|
ClearCookies
Clear all browser cookies.
Syntax
Example
| (async function(){
Log("Before delete:", await GetCookies());
await ClearCookies();
Log("After deleted:", await GetCookies());
})()
|
Shell
LaunchProcess
Launch an external process.
Syntax
await LaunchProcess (cmd, args, wait);
Parameters
Parameters |
Description |
cmd |
Path to the executable. |
args |
Parameters. |
wait |
Wait for the process to exit, true or false . |
Example
| (async function(){
await LaunchProcess("notepad");
const l = await LaunchProcess("cmd", ["/C", "echo", "Hello Bip Profile"], true);
Log(l);//stdout+stdout
})()
|
Keycode Table
Use for functions: SendKeyPress, SendKeyDown, SendKeyUp, SendKeyChar.
Click to show code table
Key |
Description |
K_BACKSPACE |
Backspace |
K_TAB |
Tab |
K_ENTER |
Enter |
K_SHIFT |
Shift |
K_CONTROL |
Control |
K_ALT |
Alt |
K_PAUSE |
Pause |
K_CAPSLOCK |
CapsLock |
K_ESCAPE |
Escape |
K_SPACE |
Space |
K_PAGEUP |
PageUp |
K_PAGEDOWN |
PageDown |
K_END |
End |
K_HOME |
Home |
K_ARROWLEFT |
ArrowLeft |
K_ARROWUP |
ArrowUp |
K_ARROWRIGHT |
ArrowRight |
K_ARROWDOWN |
ArrowDown |
K_PRINTSCREEN |
PrintScreen |
K_INSERT |
Insert |
K_DELETE |
Delete |
K_DIGIT0 |
Digit0 (0) |
K_DIGIT1 |
Digit1 (1) |
K_DIGIT2 |
Digit2 (2) |
K_DIGIT3 |
Digit3 (3) |
K_DIGIT4 |
Digit4 (4) |
K_DIGIT5 |
Digit5 (5) |
K_DIGIT6 |
Digit6 (6) |
K_DIGIT7 |
Digit7 (7) |
K_DIGIT8 |
Digit8 (8) |
K_DIGIT9 |
Digit9 (9) |
K_KEYA |
KeyA (A) |
K_KEYB |
KeyB (B) |
K_KEYC |
KeyC (C) |
K_KEYD |
KeyD (D) |
K_KEYE |
KeyE (E) |
K_KEYF |
KeyF (F) |
K_KEYG |
KeyG (G) |
K_KEYH |
KeyH (H) |
K_KEYI |
KeyI (I) |
K_KEYJ |
KeyJ (J) |
K_KEYK |
KeyK (K) |
K_KEYL |
KeyL (L) |
K_KEYM |
KeyM (M) |
K_KEYN |
KeyN (N) |
K_KEYO |
KeyO (O) |
K_KEYP |
KeyP (P) |
K_KEYQ |
KeyQ (Q) |
K_KEYR |
KeyR (R) |
K_KEYS |
KeyS (S) |
K_KEYT |
KeyT (T) |
K_KEYU |
KeyU (U) |
K_KEYV |
KeyV (V) |
K_KEYW |
KeyW (W) |
K_KEYX |
KeyX (X) |
K_KEYY |
KeyY (Y) |
K_KEYZ |
KeyZ (Z) |
K_METALEFT |
MetaLeft (Meta) |
K_METARIGHT |
MetaRight (Meta) |
K_CONTEXTMENU |
ContextMenu |
K_NUMPAD0 |
Numpad0 (0) |
K_NUMPAD1 |
Numpad1 (1) |
K_NUMPAD2 |
Numpad2 (2) |
K_NUMPAD3 |
Numpad3 (3) |
K_NUMPAD4 |
Numpad4 (4) |
K_NUMPAD5 |
Numpad5 (5) |
K_NUMPAD6 |
Numpad6 (6) |
K_NUMPAD7 |
Numpad7 (7) |
K_NUMPAD8 |
Numpad8 (8) |
K_NUMPAD9 |
Numpad9 (9) |
K_NUMPADMULTIPLY |
NumpadMultiply (*) |
K_NUMPADADD |
NumpadAdd (+) |
K_NUMPADSUBTRACT |
NumpadSubtract (-) |
K_NUMPADDECIMAL |
NumpadDecimal (.) |
K_NUMPADDIVIDE |
NumpadDivide (/) |
K_F1 |
F1 |
K_F2 |
F2 |
K_F3 |
F3 |
K_F4 |
F4 |
K_F5 |
F5 |
K_F6 |
F6 |
K_F7 |
F7 |
K_F8 |
F8 |
K_F9 |
F9 |
K_F10 |
F10 |
K_F11 |
F11 |
K_F12 |
F12 |
K_NUMLOCK |
NumLock |
K_SCROLLLOCK |
ScrollLock |
K_AUDIOVOLUMEMUTE |
AudioVolumeMute |
K_AUDIOVOLUMEDOWN |
AudioVolumeDown |
K_AUDIOVOLUMEUP |
AudioVolumeUp |
K_MEDIATRACKNEXT |
MediaTrackNext |
K_MEDIATRACKPREVIOUS |
MediaTrackPrevious |
K_MEDIASTOP |
MediaStop |
K_MEDIAPLAYPAUSE |
MediaPlayPause |
K_LAUNCHMAIL |
LaunchMail |
K_LAUNCHMEDIAPLAYER |
LaunchMediaPlayer |
K_LAUNCHAPPLICATION1 |
LaunchApplication1 |
K_LAUNCHAPPLICATION2 |
LaunchApplication2 |
K_SEMICOLON |
Semicolon (;) |
K_EQUAL |
Equal (=) |
K_COMMA |
Comma (,) |
K_MINUS |
Minus (-) |
K_PERIOD |
Period (.) |
K_SLASH |
Slash (/) |
K_BACKQUOTE |
Backquote (`) |
K_BRACKETLEFT |
BracketLeft ([) |
K_BACKSLASH |
Backslash (\) |
K_BRACKETRIGHT |
BracketRight (]) |
K_QUOTE |
Quote (') |
Need help?
If you encounter any difficulties, or want to request new functions, please contact us!.