วิธีการใช้งานสคริปท์บน BlueStacks 4

Purpose

Scripts คือชุดของการกระทำ (เช่น การกดปุ่ม, คลิกเมาส์, ดีเลย์) ซึ่งตั้งค่าให้ทำงานผ่านุ่มควบคุม เป็นฟีเจอร์ใหม่ที่ช่วยเพิ่มความหลากหลายให้ระบบ keyboard control และช่วยเพิ่มประสิทธิภาพในการใช้งาน

Benefits

ช่วยให้คุณสามารถสร้างสคริปท์และใช้งานได้

Audience

ผู้ใช้ทุกคนที่ใช้งาน BlueStacks.

BlueStacks versions affected

BlueStacks version 4.140 ขึ้นไป

Geos affected

ทุกพื้นที่

ก่อนอื่นขอเชิญชมวีดีโอแนะนำระบบสคริปท์บน BlueStacks.

คำสั่งต่างๆที่ใช้งานได้บน BlueStacks: 

Keyword

Syntax

Short Description

#

# this is a comment

Comments begin with #. Everything until the end of the line is considered comment and is ignored.

A comment can be on a line by itself or can be placed at the end of a command on the same line.

keyDown

keyDown key

e.g.
keyDown TAB

Key is pressed and is not released until the keyup is encountered for the same key.

Mapping for the key is executed if one exists; otherwise, the key down input is forwarded to android.

keyDown2

keyDown2 key

e.g.
keyDown2 TAB

Key is pressed and is not released until the keyup is encountered for the same key.

Mapping is not executed and key down input is forwarded to android.

keyUp

keyUp key

e.g.
keyup TAB

Key is released. Mapping is executed if one exists; otherwise, key up input is forwarded to android.

keyUp2

keyup2 key

e.g.
keyup2 TAB

Key is released. Mapping is not executed and key up input is forwarded to android.

mouseDown

mouseDown x y

e.g.
mouseDown 44.0 55.5

Mouse left button is pressed at location x, y. All locations are in screen percentages so that the same script can work across different resolutions.

mouseUp

mouseUp

Mouse left button is released. No coordinates are required.

mouseMove

mouseMove x y

e.g.
mouseMove 4.56 5.67

Mouse moves to new location x, y

touch

touch x1 y1 x2 y2 x3 y3

e.g.
# 3 fingers
touch 4 5 6 7 8 9

# 3rd finger lifted
touch 4 5 6 7

# fingers 1 and 2 move
touch 5 6 7 8

# fingers 1 and 2 lifted
touch

Touch input with the current set of touchpoints specified. Series of touch commands can be used to create arbitrary multi-touch input.

Up to 16 touchpoints are supported. But keep in mind that other touchpoints from other controls are aggregated before sending to android.

text

text “text”
text backspace 2
e.g.
text “hello world”

Send text input to android. This can be in any language. The format should be utf8.

mouseWheel

mouseWheel x y d
mouseWheel 44.0 55.5 1
mouseWheel 44.0 55.5 -1

Send mousewheel event to keymapping which will convert it to zoom or scroll accordingly

wait

wait msecs

e.g.
wait 24

Waits for the specified number of milliseconds before executing the next command.

Higher Level Primitives.

Keyword

Syntax

Short Description

tap

tap x1 y1 x2 y2 … xn yn delay

This does a tap gesture. Single or multiple touchpoints can be specified. The touchpoint(s) are held for a specified delay. If the delay is not specified it is assumed to be 50msec.

Up to 16 touchpoints are supported. But keep in mind that other touchpoints from other controls are aggregated before sending to android.

swipe

swipe x1 y1 x2 y2 … xn yn delay

e.g.
# swipe 4,5 to 40,45
# take 100msecs
swipe 4 5 40 45 100

Do a swipe gesture. Multiple points may be specified which the swipe goes through.

Delay is specified in milliseconds. This is the amount of time the entire swipe gesture takes.

loop / loopEnd

loop n
.
.
loopEnd

Commands following loop command until loopEnd are executed n times.

If n is not specified the loop continues indefinitely or until the macro trigger key is released.

onRelease

onRelease

This provides finer control over the execution of the script. A different set of commands can be provided for executing when the trigger key is pressed and released.

All commands from the top of the script until the onrelease command are executed when trigger key is pressed. Commands following the onrelease command are executed when trigger key is released.

enterShoot

enterShoot

Enter shooting mode used to play FPS games. If a Pan control does not exist in the current scheme this is ignored. If shooting mode is already enabled this has no effect.

exitShoot

exitShoot

Exit shooting mode. If a Pan control does not exist in the current scheme this is ignored. If shooting mode is disabled this is ignored.

toggleShoot

toggleShoot

Toggle shooting mode. If a Pan control does not exist in the current scheme this is ignored.

การสน้างสคริปท์

1) เปิดแอพหรือเกมที่คุณต้องการ

2) คลิกที่ keyboard control UI ด้านข้างจอตามรูป
Scripts1.PNG

3) คลิกที่ปุ่ม Edit บริเวณมุมขวาบน จากนั้นจะมีกล่องข้อความตามรูป
1.PNG

4) คลิกที่ Advanced settings บริเวณมุมขวาล่าง
Scripts3.PNG

5) หลังจากเปิดหน้าต่าง Game Controls ลากปุ่ม script button ไปวางที่ไอคอนถุง มุมซ้ายล่างตามรูป
Scripts4.PNG

ที่ TAB สามารถใส่คำสั่งของสคริปท์ได้
Scripts5.PNG

6) คลิกที่ไอคอน ที่ด้านล่างเครื่องหมาย "<\>" ให้พิมพ์คำสั่งของสคริปท์ที่ต้องการ

Scripts6.PNG

7) จากนั้นคลิกที่ "<\>" จะมีเคอร์เซอร์ปรากฏบนหน้าจอ เมื่อนำเมาส์ไปชี้จะแสดงรายละเอียด
Scripts13.PNG

เมื่อเสร็จสิ้นแล้วคลิกที่ไอคอนรูปถุง

8) คุณสามารถพิมพ์คำสั่งได้เมื่อเคอร์เซอร์แสดงบนหน้าจอ
Scripts7.PNG

ตัวอย่างคำสั่ง

 tap หมายถึงเมื่อเรากด TAB จะแตะที่ไอคอนถุง

exitShoot หมายถึงเมื่อเรากด TAB จะออกจาก Shooting mode

เมื่อใส่คำสั่งแล้วกด Done

9) คลิกที่บันทึก
Scripts8.PNG

10)  เมื่อมีการบันทึกจะมีหน้าต่างแสดงขึ้น คุณสามารถปิดคอนโซลควบคุมเกมได้
Scripts9.PNG

11) สามารถใช้งานในเกมได้เลย

ตามภาพด้านล่างผู้เล่นอยู่ใน Shooting Mode
Scripts11.PNG

เมื่อกด TAB ผู้เล่นจะออกจาก Shooting mode และเปิดกระเป๋าเก็บของ
Scripts12.PNG

เรามีความยินดีเป็นอย่างยิ่งที่คุณเลือกใช้ BlueStacks เพื่อเล่นเกมของคุณ เราหวังเป็นอย่างยิ่งว่าคุณจะสนุกสนานเพลิดเพลินกับการเล่นเกมครั้งนี้ หากมีข้อสงสัยกรุณาติดต่อ support at bluestacks dot com. ขอขอบพระคุณ

บทความนี้มีประโยชน์หรือไม่
575 จาก 1179 เห็นว่ามีประโยชน์
Reach out to us on Reddit (Join Reddit) or Discord (Join Discord) or at support@bluestacks.com with your questions.

We’d love to hear from you! Please take a moment to share your thoughts on the BlueStacks Help Center via this survey.
Subscribe to BlueStacks Weekly!
Get updates on new releases, features, and fixes. Discover trending games & enjoy exclusive gift codes!
By subscribing, I agree to receive weekly updates from the BlueStacks Help Center.
Thank you for subscribing to BlueStacks Weekly
Keep an eye on your inbox for updates on the latest features, gaming trends, bug fixes, gift codes, and much more!