Comments (6)
You can take arguments in fact :)
CommandTrigger has its own variables that hold the arguments
Variables | Link |
---|---|
command | String -- it's the actual command string |
args | Array(of String) -- the arguments that the player have entered. args[0] for first argument, args[1] for second, ... |
argslength | Number -- number of argumenets. Equivalent to args.length |
from triggerreactor.
The args is the Array of String, so to access the values in it, you need the square bracket.
For example, if you would need the first argument of the command, simply use args[0]
#MESSAGE args[0]
This will print out 'boom' if you have a command trigger 'test,' and typed something like /test boom.
But be aware of that the number you put there can be out of bound depends on how many arguments are originally passed to the Trigger.
You can check that by using argslength variable or args.length.
IF args.length > 1
....
ENDIF
This will make sure that there is at least one argument before executing the code in the IF block
You may find this wiki useful too: https://github.com/wysohn/TriggerReactor/wiki/Array
from triggerreactor.
i actually figured it out lol while waiting for you XD but thank you so much. this will definitely help others along the way! i actually designed a command that lets you make other players say whatever you want XD
from triggerreactor.
Thank you very much 😄
For some reason I couldn't find it in the wiki.
from triggerreactor.
Yeah current wiki has a little low readability c.f.
I would appreciate if you fix it a little if you want to :p
from triggerreactor.
can you provide an example of how i could take arguments? i see that you have args but idk how to type the command
from triggerreactor.
Related Issues (20)
- 콘솔에 해당 오류가 출력됩니다.
- New commands HOT 1
- Possibly cause of memory leak
- Get rid of obsolete code
- #VELOCITY Executor can be used to induce server crash HOT 1
- Invalid timings value HOT 1
- failed to pass through Lexer when "0" was entered.
- Create test case concurrent write to a same file HOT 1
- "Failed to rename temp file to Any_Trigger_name.json" HOT 4
- Does not working on Java 16 and below
- Remove JShader requirement HOT 2
- MySQL true시 오류 HOT 2
- Move interrupter building into core
- 한글텍스트가 계속 ???으로 변합니다.
- Switch statement only allows string type HOT 1
- 왼손에 물건 들고 PlayerInteract Event 시 트리거 2번 중복 호출 HOT 2
- InventoryTrigger possibly not sharing internal variables correctly
- #SERVER 오류
- JSONMessage executor HOT 1
- Add Magma to PlatformManager
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from triggerreactor.