개인 자료란 (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/384/778/003/262x150.crop.jpg?20240507003327

업데이트

마인크래프트 자바 에디션 스냅샷 24w18a

학교가기싫다

2024-05-06

0

/files/thumbnails/855/781/003/262x150.crop.jpg?20240505141129

레드스톤

레이저 클리너

GlassesFilm

2024-05-05

1

/files/thumbnails/576/775/003/262x150.crop.jpg?20240426232553

아티클

이달의 블록: 단단한 진흙

학교가기싫다

2024-04-26

0

/files/thumbnails/115/774/003/262x150.crop.jpg?20240428135129

업데이트

마인크래프트 1.20.5 정식 업데이트

학교가기싫다

2024-04-24

0

/files/thumbnails/762/770/003/262x150.crop.jpg?20240418073724

레드스톤

T.B.H (고민중독) | 노트블럭 버전 | NoteBlock Cover [한국어 영어 중국어 가사 추가]

노트블럭전문가

2024-04-18

1