개인 자료란 (JE)

  서버 커뮤니티

Profile HAN1110 대표칭호 없음

HAN1110 9899e780ba984d89824a90ee8deb7cb2

Profile

커뮤니티 소통 잡담하기

[스크립트로 트리거 만들기 개발일지] 1 - 메소드(?)

2022.01.28 조회 수 43 추천 수 0

네. 그 메소드 맞습니다.

자바 메소드입니다.

onEvent , onEnable , onDisable , onMotion 메소드를 만들건데

여러분들이 상상도 못한것. (정확히는 보통 안쓰는)

777be24c5e484d0da7f593e83ca3f76b.png

IDE 를 VSC (Visual Studio Code) 로 씁니다! 크하하하

물론 이건 일단 넘어가고 애드온을 적용해야하는데

저는 reflect 사용할겁니다!

물론 이건 자랑 아니구요

일단 이건 오픈소스이기 때문에 절대 자료란에 배포 안할겁니다. 여기에 소스 싹다 적어둘거에요. 배포제외 완전가능 오픈소스에요.

command /script-ide [<string>]:
    trigger:
        if arg 1 is "onEvent":
            message "onEvent"
        else if arg 1 is "onEnable":
            message "onEnable"
        else if arg 1 is "onMotion":
            message "onMotion"
        else if arg 1 is "onDisable":
            message "onDisable"
        else:
            message "&9---------- Visual Stuido Script API by HAN1110 --------------------------"
            message ""
            message "&a/script-ide : Prefix Command"
            message "&bonEvent : For Repeat infinitely until onDisable is executed"
            message "&bonMotion : Send events when moving"
            message "&bonEnable : Sent when activated"
            message "&bonDisable : Sent when disabled"

대충 이렇게 만들었는데3f97c5600543c20ae4d1cc2fa44c82e6.png

아니 이게 뭐냐고 저거 맞춰놓아야지.

그래서 저거 --- 저거를 좀 줄였는데80ad2e073c826fac50815ce62672b982.png

속 시원하네요.

이제 완성했어요.

물론 도움말 없으면 불편해서

command /script-api:
    trigger:
        message "&9----- Visual Stuido API Script by HAN1110 -----"
        message ""
        message "&b/script-ide : Code Scripting Command"
        message "&2&l/script-api : &2API Helpful Command" 

이렇게 API 코드 하나 만들었답니다.

그리고 Tab Complete 를 만들어야한단 말얘요?

그래서 


on tab completion for command "script-ide":
    set {tabcode::*} to "onEnable" and "onDisable" and "onEvent", "onMotion"
    if {tabcode::*} do not contain arg-1:
        loop {tabcode::*}:
            if loop-value contain arg-1:
                add loop-value completions

했는데 오류가 나더군요. 물론 이건 간단한 해결법이였을겁니다.

그리고 그건 사실이였죠.


on tab complete with "/script-ide":
    set {_arg.1::*} to "onEnable" and "onEvent", "onMotion", "onDisable"
    if {_arg.1::*} do not contain arg-1:
        loop {_arg.1::*}:
            if loop-value contain arg-1:
                add loop-value to completions

이거만 쓰면 해결되는 버그~

그래서 해결했답니다.

끝~ 다음편 기다리세요!

2개의 댓글

허두
2022.01.30

vscode 한국어... 에바,,

HAN1110
2022.01.30
@허두

몇년 전부터 써왔어요

뉴스 및 창작물
/files/thumbnails/841/773/003/262x150.crop.jpg?20240526120908

레드스톤

마인크래프트 노트블록버전 『 봄을 고하다 (春を告げる) 』 [더블옥타브 버전]

노트블럭전문가

2024-05-26

0

/files/thumbnails/712/796/003/262x150.crop.jpg?20240525085438

레드스톤

마인크래프트 노트블록으로 만든 『 봄을 고하다 (春を告げる) 』 1

Sonttukk

2024-05-25

0

/files/thumbnails/268/789/003/262x150.crop.jpg?20240515192032

레드스톤

벌레먹은 돌 빠르게 제거하는 법

GlassesFilm

2024-05-15

0

/files/thumbnails/797/788/003/262x150.crop.jpg?20240515090924

건축

마인크래프트로 구현한 카르카손 보드게임

Warak

2024-05-15

1

/files/thumbnails/487/784/003/262x150.crop.jpg?20240508233607

모드

Windows Borderless 모드에서 악성코드 발견 3

학교가기싫다

2024-05-08

1