|
Fizban1216 Apprentice
Joined: 03 Feb 2007 Posts: 170
|
Posted: Fri May 23, 2008 2:48 am
%lastcom |
Is there any way to use something like %lastcom except have it only work for the last command typed into the current window and not the last command typed period like it does now? (ie. I have a trigger that does #TRIG {^You have lost your concentration~!$} {#exec %lastcom} and if I'm playing on two windows at the same time I tend to be talking in one window look back to the other later and realize my half of the conversation has been being said on both muds due to %lastcom picking up commands from another window.)
|
|
|
|
wheelman Novice
Joined: 30 Jan 2006 Posts: 41
|
Posted: Fri May 23, 2008 4:42 am |
You can use ! or whatever your history character is in the special characters section of preferences.
|
|
|
|
Anaristos Sorcerer
Joined: 17 Jul 2007 Posts: 821 Location: California
|
Posted: Sat May 24, 2008 6:28 pm |
The way I've handled this in the past is:
Code: |
#TRIGGER {^You lost your concentration while trying to cast (*).$} {#EXECWIN mainwindowname {#EXEC {cast '%1'}}}
|
Where mainwindowname would be the name of your session or, alternatively, the name of the window holding the network connection. |
|
_________________ Sic itur ad astra. |
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Sat May 24, 2008 7:22 pm |
I take it you're meaning that the non-talking window is using lastcom and it is picking up the commands from the other window?
If so, Anaristos has the right idea, but he's being overly complicated on it. No need to use #EXECWIN if the trigger is firing on the window you want the command to be executed on. I've used that particular trick on my mud for 10 years lol! Heck, you don't even need to #EXEC it either.
Code: |
#TRIG {^You lost your concentration casting (*).$} {cast '%1'} |
Anyways, using #EXEC might make it safer, but it isn't strictly necessary. |
|
_________________ CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate |
|
|
|
Fizban1216 Apprentice
Joined: 03 Feb 2007 Posts: 170
|
Posted: Sun May 25, 2008 6:58 am |
Quote: |
I take it you're meaning that the non-talking window is using lastcom and it is picking up the commands from the other window? |
Correct. (The problem up till now is the mud doesn't send the name of the failed spell in the concentration fail message) |
|
|
|
Anaristos Sorcerer
Joined: 17 Jul 2007 Posts: 821 Location: California
|
Posted: Sun May 25, 2008 8:00 pm |
You are right, ralgith. The way I did it in the post IS overly complicated and normally I do it the way you presented. I posted that way of doing it as suggestion to override any focus problems if he is working on another window. The complicated way assures that the network-connected window executes the command.
As to your problem, Fizban1216, is it because your MUD does not put that info into the message? If so, one way to do it is to have an alias issue the cast and keep the spell id in a variable that you can access in the trigger. Each time a spell is cast, your alias would push the id into the spell list, then your trigger would pop the id and re-cast.
Code: |
#ALIAS cs($id) {cast $id;spelllist = %push($id,@spelllist)}
...
#TRIGGER {^You have lost your concentration~!$} {cast %pop(spelllist)}
|
You would need a trigger to key on the successful cast message that would remove the id from the list.
Yes, I know. It does seem like a bit of a hussle.
EDIT: You don't need a success trigger to clean up the list, the concentration trigger automatically removes the spell id. |
|
_________________ Sic itur ad astra.
Last edited by Anaristos on Tue May 27, 2008 6:11 am; edited 2 times in total |
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Mon May 26, 2008 9:54 pm |
Yes, I understand Anaristos. And I agree with your solution to the problem of the spell name not being in the lost con message. Though, thats kind of the silly thing to NOT have it in the message lol.
I know my healer bot (posted in the finished scripts somewhere, though perhaps that version is too old to have it) depends on the lost con message big time to recast spells to the person being healed. It works quite well too. :D I've got everything safety rigged for recasting, it always sucks to end up dead because the healer fails to heal you. |
|
|
|
|
|