Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name Departure Chat
- @inputs On Num:string
- @outputs
- @persist GoingTo:string From:string Passing:string Arriving:string
- @trigger
- runOnChat(1)
- ReportingMark = "AAAA"
- #[
- Instructions:
- 1. Wire the 'On' input to the MU master or a toggle button.
- 2. type .to, then your destination. Example: .to Rockfort
- 3. type .from, then your departing location. Example: .from Wolfram
- 4. Finally, type .depart to announce your departure!
- 5. If you want to announce if you are passing through somewhere, type .passing [location]
- 6. If you would like to announce your arrival to a station/yard, type .arriving [location]
- ]#
- if(chatClk(owner()) & On){
- LS = owner():lastSaid()
- Command = owner():lastSaid():explode(" ")
- Location = Command[2,string]
- if(Command[1,string] == ".to"){
- GoingTo = Command[2,string]
- print("Destination set to "+GoingTo+"!")
- hideChat(1)
- }
- if(Command[1,string] == ".from"){
- From = Command[2,string]
- print("Starting location set to "+From+"!")
- hideChat(1)
- }
- if(Command[1,string] == ".passing"){
- Passing = Command[2,string]
- chatPrint(
- vec(0,255,255),ReportingMark+" "+Num+" ",
- vec(255),"passing ",
- vec(0,255,0),Passing
- )
- hideChat(1)
- }
- if(Command[1,string] == ".arriving"){
- Arriving = Command[2,string]
- chatPrint(
- vec(0,255,255),ReportingMark+" "+Num+" ",
- vec(255),"arriving at ",
- vec(0,255,0),Arriving
- )
- hideChat(1)
- }
- if(LS == ".depart"){
- hideChat(1)
- chatPrint(
- vec(0,255,255),ReportingMark+" "+Num+" ",
- vec(255),"departing for ",
- vec(0,255,0),GoingTo,
- vec(255)," starting from ",
- vec(0,255,0),From
- )
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement