Last active
June 13, 2019 12:12
-
-
Save sunasaji/59bbfa9db9dd37d13343bc87f2e745b4 to your computer and use it in GitHub Desktop.
Vケット2のワールドを順次ロードするuwscスクリプト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//vket2_world_loader | |
//Vケット2のワールドを順次ロードするuwscスクリプト | |
//License: CC0 | |
PUBLIC instance_id, check_interval, user_id | |
//使い方 | |
// 下記のuser_idの「usr_xxx...」の部分に、自分のユーザIDを設定して保存し、 | |
// 保存したスクリプトをUWSC.exeにドラッグ&ドロップして放置する。 | |
// 数分おきにVRCウィンドウがアクティブになり、ワールドが自動でロードされる。 | |
// 自分のユーザID | |
// vrchat.netにログインして、右上の自分のアイコンをクリックすると | |
// ブラウザのアドレスバーに出る「usr_」から始まる文字列。 | |
user_id = "usr_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" | |
//インスタンスIDをランダム生成 | |
instance_id=int(random(100000)) | |
//ワールドロード完了をチェックする間隔 | |
check_interval = 300 | |
//VMエントランス | |
World_Open("wrld_3b3af1f3-1cd2-4b7f-90f0-4fa9b14b2601") | |
//バーチャルミュージアムA | |
World_Open("wrld_e8fa01b4-f4ce-43ac-8879-3c6f2c5e5675") | |
//バーチャルミュージアムB | |
World_Open("wrld_3f72aedb-8110-4639-8fa7-6c3618328d79") | |
//バーチャルミュージアムC | |
World_Open("wrld_85a50445-7db2-4ea0-9f01-fbaf35173947") | |
//Future Terminal A | |
World_Open("wrld_cbc73149-f097-4c4a-968c-ab30baa46b91") | |
//Future Terminal B | |
World_Open("wrld_0472ad46-ec17-47c6-b950-7abd9896b137") | |
//異世界マルシェA | |
World_Open("wrld_5dd6e1c9-486d-4918-b77d-c1684268bcf3") | |
//異世界マルシェB | |
World_Open("wrld_fb98c452-3a10-481a-8d3c-c3a8ee55f0a3") | |
//モクリバザールA | |
World_Open("wrld_67d8f636-c2c5-4c45-a264-0ec5a5dd9dd1") | |
//モクリバザールB | |
World_Open("wrld_33552273-8232-4b8d-9c44-227454a1867c") | |
//絢爛博覧会 | |
World_Open("wrld_cf821439-c6b0-4eb0-9b4d-84524d7c6b6f") | |
//ワールドを開いて、ロード完了を待つ | |
function World_Open(str) | |
world_url = "vrchat://launch/?id=" + str + ":" + instance_id + "~private(" + user_id + ")" | |
while True | |
if World_Load_End() | |
exec("cmd /c start=" + world_url ) | |
sleep(check_interval) | |
Result = true | |
break | |
else | |
sleep(check_interval) | |
endif | |
wend | |
fend | |
// ワールドロード中はfalse、それ以外はtrue、ロード中の画面の色(青緑)で判定 | |
function World_Load_End() | |
// VRCウィンドウのID取得 | |
w_id = getid( "VRChat" ) | |
mouseorg( w_id ,2 ,MORG_FORE ) | |
// VRCウィンドウをアクティブにする | |
acw(w_id) | |
c = PeekColor(100, 100) | |
c_r = Color_Red(c) | |
c_g = Color_Green(c) | |
c_b = Color_Blue(c) | |
//ロード中の緑色が表示されているか判定 | |
if (c_r < 5) and (c_g > 52) and (c_g < 72) and (c_b > 55) and (c_b < 75) | |
Result = false | |
else | |
Result = true | |
sleep(60) | |
//VRChatウィンドウを閉じる | |
ctrlwin(w_id, CLOSE) | |
sleep(20) | |
endif | |
fend | |
// 色取得 | |
function Color_Red(c) | |
Result = c and $FF | |
fend | |
function Color_Green(c) | |
Result = (c and $FF00) / $100 | |
fend | |
function Color_Blue(c) | |
Result = (c and $FF0000) / $10000 | |
fend |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment