API Basic ApiNames ko - LIHACHTETAN/ClassicUO-BadNewbie-BasicIDE GitHub Wiki
Basic / UO.
ClassicUO โข Basic
๊ฒ์ ๋ช ๋ น์ UO.๋ฅผ ์ฌ์ฉํ๊ณ Basic ๊ตฌ๋ฌธ, ๋ด์ฅ ํจ์์ ์ฌ์ฉ์ ํจ์๋ ์ ์ธ๋ ์ด๋ฆ์ ์ฌ์ฉํฉ๋๋ค.
์ ํํ ๊ตฌ๋ฌธ
UO.command(arguments)
BasicFunction(arguments)
UserFunction(arguments)
๋งค๊ฐ๋ณ์
UO.commandโ UO.command(arguments): ๊ฒ์ API์ ํ์์ธ ์ ๋์ฌ์ ๋๋ค. UO.GetType(id)๋ ๊ทธ๋ํฝ/๋ชธ์ฒด ๋ฒํธ๋ฅผ ์ฝ์ผ๋ฉฐ Basic ๋๋ CLR ํ์์ด ์๋๋๋ค.BasicFunctionโ BasicFunction(arguments): Int(value), Str(value), CInt(value) ๋ฑ์๋ UO.๋ฅผ ๋ถ์ด์ง ์์ต๋๋ค.argumentsโ self, backpack, ground, Rhand๋ ๊ฐ์ฒด, ํํฐ, ๋ ์ด์ด ์ธ์๋ก ๊ณ์ ์ ํจํฉ๋๋ค. ์ธ์ ์ด๋ฆ์ ์ ๋์ฌ๋ฅผ ์๋ตํ ๊ฒ์ ํธ์ถ์ด ์๋๋๋ค.
๋ฐํ๊ฐ
๋ช ๋ช ๊ท์น ์์ฒด๋ ๊ฐ์ ๋ฐํํ์ง ์์ต๋๋ค. Int๋ Integer, Str๋ String, ์ธ Api*Exists๋ TRUE/FALSE๋ก ์ฌ์ฉํ ์ ์๋ Integer 1/0์ ๋ฐํํฉ๋๋ค.
๋์
- ๋์๋ฌธ์๋ฅผ ๊ตฌ๋ถํ์ง ์์ต๋๋ค. InjectionApi๋ ์ ๋์ฌ ์๋ Basic์, InjectionApiUO๋ UO.๊ฐ ์๋ ๊ฒ์ ํธ์ถ์ ๋ฑ๋กํฉ๋๋ค. ์ด์ ์งง์ ํธ์ถ์๋ SC005์ ๋ฑ๋ก๋ UO. ๋์์ด ํ์๋๋ฉฐ ์๋ ์คํํ์ง ์์ต๋๋ค. ์บ๋ฆญํฐ ์์ฑ ๊ฐ๋ UO.๊ฐ ํ์ํฉ๋๋ค. ApiNameExists, ApiSignatureExists, ApiParameterExists๋ ์๋ ๊ณต๋ฐฑ์ ์ ๊ฑฐํ๊ณ ์ ๋์ฌ๋ฅผ ์ถ๊ฐํ์ง ์์ ์ ํํ ๋ฑ๋ก ์ด๋ฆ์ ๊ฒ์ฌํฉ๋๋ค. ์๋ฒ ์ํ๊ฐ ์๋ ๋ฉํ๋ฐ์ดํฐ ๊ฒ์ฌ์ ๋๋ค. VB.NET ๋ฆฌํ๋ ์ ์ฐ์ฐ์ GetType(TypeName)์ ๊ตฌํ๋์ง ์์์ต๋๋ค.
์์
1. 1
# graphic์ ๋ชธ์ฒด ๋ฒํธ๋ฅผ ์ฝ๊ณ ์ ๋ณด๊ฐ ์์ผ๋ฉด 0์ด๋ฉฐ whole=2์
๋๋ค. registered๋ ์ธ์ ํ๋์ธ UO.GetType์ ๊ฒ์ฌํฉ๋๋ค. Main์ ๊ทธ๋ํฝ๊ณผ ๊ด๊ณ์์ด "2:1"์ ๋ฐํํ๋ฉฐ ์ด๋ํ๊ฑฐ๋ ์์ดํ
์ ์ฎ๊ธฐ์ง ์์ต๋๋ค.
Option Explicit On
Sub Main()
Var graphic = UO.GetType('self')
Var whole = Int(2.9)
Var registered = UO.ApiSignatureExists('UO.GetType', 1)
Return CStr(whole) + ":" + CStr(registered)
End Sub
๋งค๊ฐ๋ณ์ ๋ฐ ์คํ ์ค๋ช :
graphic์ ๋ชธ์ฒด ๋ฒํธ๋ฅผ ์ฝ๊ณ ์ ๋ณด๊ฐ ์์ผ๋ฉด 0์ด๋ฉฐ whole=2์ ๋๋ค. registered๋ ์ธ์ ํ๋์ธ UO.GetType์ ๊ฒ์ฌํฉ๋๋ค. Main์ ๊ทธ๋ํฝ๊ณผ ๊ด๊ณ์์ด "2:1"์ ๋ฐํํ๋ฉฐ ์ด๋ํ๊ฑฐ๋ ์์ดํ ์ ์ฎ๊ธฐ์ง ์์ต๋๋ค.
2. 2
# ์ ์ฒด ์ ์๋ ์ฌ์ฉ์ Function GetType์ CInt(6)์์ value=6์ ๋ฐ์ 7์ ๋ฐํํฉ๋๋ค. UO.GetType์ ๊ฒ์ ๊ทธ๋ํฝ์ ๊ณ์ ์ฝ์ผ๋ฉฐ ๋ ํธ์ถ์ ์๋ก ๊ฐ๋ก์ฑ์ง ์์ต๋๋ค.
Option Explicit On
Function GetType(value)
Return value + 1
End Function
Sub Main()
Var localResult = GetType(CInt(6))
Var graphic = UO.GetType('self')
Return localResult
End Sub
๋งค๊ฐ๋ณ์ ๋ฐ ์คํ ์ค๋ช :
์ ์ฒด ์ ์๋ ์ฌ์ฉ์ Function GetType์ CInt(6)์์ value=6์ ๋ฐ์ 7์ ๋ฐํํฉ๋๋ค. UO.GetType์ ๊ฒ์ ๊ทธ๋ํฝ์ ๊ณ์ ์ฝ์ผ๋ฉฐ ๋ ํธ์ถ์ ์๋ก ๊ฐ๋ก์ฑ์ง ์์ต๋๋ค.
3. 3
# oldCall=0, gameCall=1, basicCall=1์ GetType, UO.GetType(id), Int(value)๋ฅผ ๊ฒ์ฌํฉ๋๋ค. argumentName=1์ backpack ์ธ์๊ฐ ์ ํจํจ์ ํ์ธํฉ๋๋ค. Main์ "0:1:1:1"์ ๋ฐํํฉ๋๋ค. ์ฌ์ฉ์ ํ๋ก์์ ๋ ๊ฒ์ํ์ง ์์ต๋๋ค.
Option Explicit On
Sub Main()
Var oldCall = UO.ApiSignatureExists('GetType', 1)
Var gameCall = UO.ApiSignatureExists('UO.GetType', 1)
Var basicCall = UO.ApiSignatureExists('Int', 1)
Var argumentName = UO.ApiParameterExists('backpack')
Return CStr(oldCall) + ":" + CStr(gameCall) + ":" + CStr(basicCall) + ":" + CStr(argumentName)
End Sub
๋งค๊ฐ๋ณ์ ๋ฐ ์คํ ์ค๋ช :
oldCall=0, gameCall=1, basicCall=1์ GetType, UO.GetType(id), Int(value)๋ฅผ ๊ฒ์ฌํฉ๋๋ค. argumentName=1์ backpack ์ธ์๊ฐ ์ ํจํจ์ ํ์ธํฉ๋๋ค. Main์ "0:1:1:1"์ ๋ฐํํฉ๋๋ค. ์ฌ์ฉ์ ํ๋ก์์ ๋ ๊ฒ์ํ์ง ์์ต๋๋ค.