|
lewdpotato Novice
Joined: 16 May 2002 Posts: 48 Location: USA
|
Posted: Tue Oct 15, 2002 10:16 pm
#T- and plus question |
I use #T- and plus in buttons to turn off classes, my question is I would like my corpmate (parner in tw game) to have control of some of my triggers when Im not at the keys. I already have triggers that allows my partner to control my character a bit, like changing mefrom one planet to another and warping a planet to them if they get into trouble. we use the private corp radio channel and just use a simple text pattern trigger. is there a way my partner can turn on and off my more complex triggers by using a text pattern trigger?
thanks in advance. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Wed Oct 16, 2002 12:20 am |
Yep, there's a way, but you need to lay down some syntax rules, first. These will be the key phrases/words that trigger a response when uttered by your mate. To take it a bit further, you might also require him to preface his communication with an identifier:
Computer
Planetwarp 125
Or
Computer, planetwarp 125
This gives you greater freedom to chat about such things without accidentally invoking the action.
li'l shmoe of Dragon's Gate MUD |
|
|
|
lewdpotato Novice
Joined: 16 May 2002 Posts: 48 Location: USA
|
Posted: Wed Oct 16, 2002 12:35 am |
Hehehe this was so easy I musta had a brain lapse. I just made a simple trigger(s) like this.
start planetdrop #T+ planetdrop (name of class where the trigger is)
stop planetdrop #T- planetdrop
of course this is not the way im really doing it just in case anybody here does actually play tw. 2002 |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Wed Oct 16, 2002 12:54 am |
A simple system I used in a similar circumstance was to preface all commands with "!", that allowed the trigger that captured the channel to rapidly check if something was possibly a command. After that comes the actual command.
The first one you should do is "help" just simply replies with a list of commands. Then of course you need some commands to give, perhaps "autotrade" would be a good example, then you want him to be able to turn it off an on, so we can use those as keywords.
#VAR SharedCom {help|autotrade}
#VAR CurrentCom {0}
#TR {^Corporate channel: !(*)$} {CurrentCom=%ismember(%lower(%word("%1",1)),@SharedCom);#IF {@CurrentCom) {#CASE (@CurrentCom) {#NOOP Reply:Current commands are %replace(@SharedCom,"|",", ")} {#IF (%lower(%word("%1",2))="on") {#T+ AutoTradeClass} {#IF (%lower(%word("%1",2))="off") {#T- AutoTradeClass} {#IF (%numwords("%1")=1) {#NOOP Reply:Autotrade currently %if(%trigger(AutoTradeClass),on,off)} {#NOOP Reply:Invalid arguement to autotrade command, valid format autotrade ~[on/off~]}}}}} {#NOOP Reply:Unknown command, current commands are %replace(@SharedCom,"|",", ")}}
I think I matched the braces for that example, it could get kinda big depending on how many commands you want to handle. In order to improve that you can make each command an alias, then use #EXEC "%1" to run the command with the arguments passed to the alias, that would eliminate the messy #CASE and put all the #IF chains in seperate aliases so it is not so huge and hard to debug. If you go that route make sure the #EXEC is inside the %ismember. |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|