|
Royel Beginner
Joined: 21 Aug 2008 Posts: 12
|
Posted: Fri Aug 22, 2008 12:40 am
CMudPro 2.36 Newbie |
Greetings All
I am posting here hoping to get a bit of help with creating some stuff for playing on Aardwolf. I (very) recently started playing MUD's, I tinkered around with them many years ago, but either didn't find the right MUD or was too busy with something else to commit enough time to them, however, after many years of playing MMO's, I have found myself burned out on that and wanting to get back to the roots of what got me interested in gaming, I remember one of my first and favorite games was Wizardry for the Apple 2e.
Anyhow, I looked around for some info for a few days before really getting started and found many MUD's and many clients, none of which I was certain about, then I found Aardwolf and I really like the playerbase and what I have seen in game is exactly the type of thing I think will be great to get me started. (note: I'm sure other MUD's are just as great, this is not to disqualify any others). I started playing with zMud and CMud initially, I found also that Aardwolf offered a customized client so I checked it out and loved the custom plugins.
I know many of you will think (maybe) that I haven't enough reason to need CMud, but I figure if I am gonna get started on something new I may as well use what the experts claim to be important, this means Mapping, and other things that are supported with Zugg's software that are not available in other tools, also I like that fact that it's actively being developed and there is a community here that can be reached.
I purchased CMudPro 2.36 and was hoping to find the packages already built, but they are not available in the library, there is one map package but it appears to be out-dated or perhaps just a bit buggy, it did create a new child window and moved the map function into it, but it often left remnants in the main window and did not fully create the maps properly in the new window.
I mentioned I loved the way that Aardwolf has customized a client for use with their servers, and I was hoping to mimic some of this behavior within CMudPro 2.36, I have found a screenshot in my lengthy search thru these forums in hope to find the info I needed to create this myself but alas, all I could find was this wonderful screenshot of a beautiful client (CMudPro 2.30, shameless plug here) looking near exactly as I wanted.
So, here is the link to the screenshot
http://www.zuggsoft.com/images/aardwolf.jpg
the most importants aspects I should point out are:
1) the HP/MP/XP stats located on the lower left of main window.
2) the chat channels are in there own window
3) the ingame maps are shown in their own window
Not shown here, but was available with Aardwolf's custom client was a status window, it showed detailed info about your char and some info about your target, if you had one. I would eventually like to mimic this too, but would be thrilled just to have the first 3 items I mentioned working.
I know there is more to MUD gaming than just a pretty layout, but this is the first step for me and makes the experience much easier for me to see whats happening in the game.
If anyone cares to help this Newb get started on creating this functionality it would be greatly appreciated
Thanks,
Royel |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Aug 22, 2008 2:19 am |
I actually asked Royel to post here so that I could paste some of my Aardwolf script for him.
Royel: The way you use this information is to copy each script shown below and then open the Package Editor in CMUD (press Ctrl-G) and right-click on the name of the Window in the tree view on the left (should be the top item in the tree) and select the Paste option.
1) OK, let's start with the gauges for HP/MP/etc. First there is a trigger that captures the data from the MUD prompt. Make sure your MUD prompt shows the data in the form:
100/100hp 100/100mn 100/100mv 100tnl
Code: |
<trigger newline="false" prompt="true">
<pattern>(%d)/(%d)hp (%d)/(%d)mn (%d)/(%d)mv (%d)tnl</pattern>
<value>hp=%1
maxhp=%2
mv=%5
maxmv=%6
tnl=%7</value>
</trigger> |
then there are 3 button gauges:
Code: |
<cmud>
<button type="Gauge" autosize="false" width="120" height="14" inset="true" toolstyle="true" transparent="false" color="#008040" textcolor="white" gaugelowcol="red" priority="1">
<caption>Hp: @hp/@maxhp</caption>
<expr>@hp</expr>
<gaugemax>@maxhp</gaugemax>
<gaugelow>@maxhp/10</gaugelow>
</button>
<button type="Gauge" autosize="false" width="120" height="14" inset="true" toolstyle="true" transparent="false" color="#8080FF" textcolor="white" gaugelowcol="fuchsia" priority="2">
<caption>Mv: @mv/@maxmv</caption>
<expr>@mv</expr>
<gaugemax>@maxmv</gaugemax>
<gaugelow>@maxmv/10</gaugelow>
</button>
<button type="Gauge" autosize="false" width="120" height="14" inset="true" toolstyle="true" transparent="false" color="#EEDB51" textcolor="#5C8DFE" gaugelowcol="red" priority="3">
<caption>Exp: @tnl</caption>
<expr>@tnl</expr>
<gaugemax>1000</gaugemax>
<gaugelow>150</gaugelow>
</button>
</cmud> |
My character is a warrior type, so I don't care about mana. But you could easily follow these examples to create your own if you need. Then go into your Preferences and in the Buttons tab, set "Toolbar 1 position" to be "Bottom".
2) For the chat channels, they are easy. Just normal #capture windows, which is probably one of the most common features used in CMUD. Here is the trigger for each window:
Code: |
<cmud>
<trigger>
<pattern>(%w) answers</pattern>
<value>#capture Answer
#nomap</value>
</trigger>
<trigger>
<pattern>(%w) questions</pattern>
<value>#capture Answer
#nomap</value>
</trigger>
<trigger>
<pattern>Global Quest:</pattern>
<value>#capture Quest</value>
</trigger>
<trigger>
<pattern>has placed a bid</pattern>
<value>#capture Auction;#GAGSPACE</value>
</trigger>
<trigger>
<pattern>SOLD to</pattern>
<value>#capture Auction;#GAGSPACE</value>
</trigger>
<trigger>
<pattern>tells the CLAN:</pattern>
<value>#CAPTURE Clan</value>
</trigger>
<trigger>
<pattern>tells you</pattern>
<value>#CAPTURE Tells</value>
</trigger>
<trigger regex="true">
<pattern>^(\(\w+\)\s+)?CLAN</pattern>
<value>#CAPTURE Clan</value>
</trigger>
<trigger>
<pattern>^Advice:</pattern>
<value>#capture Advice;#gagspace</value>
</trigger>
<trigger>
<pattern>^Remort Auction:</pattern>
<value>#cap Auction</value>
</trigger>
<trigger>
<pattern>{gossips|~(Gossip~)}</pattern>
<value>#capture Gossip;#gagspace</value>
</trigger>
</cmud> |
You might want to trigger these manually (like doing "#SHOW tells you") to cause all of the windows to be created. Once the windows are created, drag the Auction window and dock it to the top of your main MUD window. Then drag each other chat window and dock it over the middle of the Auction window to make them all into tabs. Once the windows are docked the way you want them, then you can click on each window in the Package Editor and then click the Preferences button at the bottom-right of the editor to open the preferences for that particular window. Specifically, I like to go to the Window options and set some of the important windows (like the Clan window) to "Automatically bring to front window with activity". This causes the Clan tab to automatically display when it receives new text. I also do this in the Quest tab so that I can see when a new quest starts.
3) For the ingame map, you first need to turn on the MAPSTART and MAPEND tags. I forget the exact MUD command to do this, but look at the config help in Aardwolf.
Code: |
<cmud>
<trigger>
<pattern>^~<MAPSTART~>$</pattern>
<value>#GAG
#GAGON
:Map:#CLR
#C+ Map
</value>
</trigger>
<trigger>
<pattern>^~<MAPEND~>$</pattern>
<value>#GAG
#C-
#GAGOFF</value>
</trigger>
</cmud> |
NOTE: In the forum it messes up the < and > characters in the trigger pattern above. So you might get an error when you try to Paste this. If so, change the < to "& lt ;" (without the quotes or spaces) and change the > to "& gt ;".
Once the Map window is created, drag it to the right of the screen to dock it.
For other status info, Aardwolf recently added some new tags for the score data. Using Telnet triggers you can enable and capture this information. I haven't had the time to play with that yet myself. Right now I just capture the output from the "score" command to keep track of that kind of stuff. But I know some other people have implemented that in CMUD already, so maybe they'll respond.
The key is to take this stuff a step at a time and go slowly. Try to understand each trigger and each script. The more you learn, the easier you will be able to customize it yourself to meet your own character needs. Most players develop their layout and scripts over time as they learn more and get more advanced.
Hope this makes a good start. |
|
|
|
Royel Beginner
Joined: 21 Aug 2008 Posts: 12
|
Posted: Fri Aug 22, 2008 2:40 am |
Thanks a ton Zugg, I really appreciate all the time you have given me today.
"I actually asked Royel to post here so that I could paste some of my Aardwolf script for him. "
I felt like the community and myself would benefit a bit more with some background info about myself since the post is open to all to see.. So.. it was a bit of a introduction to me and my problems, again, thanks for your help.
Stay tuned, I may have questions to follow. |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Fri Aug 22, 2008 5:12 am |
Actually, for channels, it's now much easier... this is my script for channels:
#TRIGGER {(~{chan ch=(%w)~})(*)} {#SWITCH (%2) ("Answer" OR "Question") {#CAP answer} {#CAP %2};#PSUB {} %x1} -- each one will go to their individual window. :P
Charneus
You do have to have tags channels on, though. |
|
|
|
Toxic Adept
Joined: 27 May 2008 Posts: 299
|
Posted: Fri Aug 22, 2008 5:54 am |
Also, you can check out http://davos.aardcharn.com These are my scripts. They are quite a bit more complex but are really nice and do alot of things for you. You can note me on personal ingame my char name is Davos... Or you can ask Charneus for help regarding them if you decide to use them, he should be able to answer any questions you have about them if he is around. If not your welcome to email me at my email address located in my finger on aardwolf.
Hope this helps. Also, I will probably be putting out a channel capture script very soon that will do what Zugg and Charneus posted scripts to do but I will make it totally configurable. |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Fri Aug 22, 2008 7:44 am |
Shameless plug here...
Sooo Toxic, there's wonderful are also in the package library..... right?!? |
|
_________________ Asati di tempari! |
|
|
|
Toxic Adept
Joined: 27 May 2008 Posts: 299
|
Posted: Fri Aug 22, 2008 2:31 pm |
Not sure I understand what your saying... But if its asking whether I put them on the package library or not, the answer is no.
The instructions for adding a package to your current session are far too complex for the average user which is still the main problem. Its not simply a matter of download, file/open click and it works.
What I would like to see is either the ability to modify the global/local/external switch via script as well as the package list, or more intuitive package adding when related to those settings. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Aug 22, 2008 5:28 pm |
I'll see if I can add something to make it a bit easier to add a package to your current session. But here are the current steps:
1) Select the Edit Session action
2) Go to the Package Files tab
3) Click the Edit button (the pencil) to open the package library
4) Expand the name of the MUD (Aardwolf) and find the package you want
5) Click the Install link next to the package name
6) Drag the package into the Package List on the left (which shows the packages loaded for your session)
There are no plans to let you change the global/local/external option from a script. That would require all sorts of changes. This setting controls the scope of the module and is part of your package/module design and not something that should be changed back and forth. If you think you have a reason to change this in a script, create a new topic which describes what you are trying to do.
Also, if there is a bug in the above procedure for loading a package from the library, please create a new topic to talk about it so that we don't get this thread side-tracked.
Back to the topic: The reason I didn't add my own stuff to the package library is because it's a mess and not easily customizeable, nor is any of the code commented. I haven't had the time needed to make my stuff into a general package that would be easy for others to use. |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Fri Aug 22, 2008 6:15 pm |
I was talking about having them in the package library. It was a late night post, and clearly I should have been in bed instead.
What is complex about being able to install the packages? What's required beyond the download, file/open click?
I may be a bit myopic, but I'm not sure why you'd want to programmatically change the scope of a module within the package. If you're talking about programmatically determining and specifying the packages enabled for a given window, then this can be done using the %packages function introduced in version 2.32.
Start another topic so we can drive that out in some more details. |
|
_________________ Asati di tempari! |
|
|
|
Toxic Adept
Joined: 27 May 2008 Posts: 299
|
Posted: Fri Aug 22, 2008 6:25 pm |
So could I do something like
$templist = %packages()
#ADDITEM $templist NewPackage
#CALL %packages(%replace($templist,"|",","))
Or so... to add a new package to the current active window? |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Fri Aug 22, 2008 8:21 pm |
Well here's the documentation for the command.
Quote: |
Added %packages function to set/query enabled package list for a window %packages(windowname[,newlist]) |
So your code should be more like
Code: |
$templist = %packages()
#ADDITEM $templist NewPackage
#CALL %packages(,$templist) |
Of course if you don't specify a window it assumes that the your are viewing is the one with the execution context.
[Edit] You beat me to it with your own post
P.S. It looks like there's no entry for this in the documentation, so I'll be adding it. |
|
_________________ Asati di tempari! |
|
|
|
Royel Beginner
Joined: 21 Aug 2008 Posts: 12
|
Posted: Fri Aug 22, 2008 8:51 pm |
charneus wrote: |
Actually, for channels, it's now much easier... this is my script for channels:
#TRIGGER {(~{chan ch=(%w)~})(*)} {#SWITCH (%2) ("Answer" OR "Question") {#CAP answer} {#CAP %2};#PSUB {} %x1} -- each one will go to their individual window. :P
Charneus
You do have to have tags channels on, though. |
I had the channels stuff Zugg posted working, but yours intrigued me enough to play with it, I suppose this has to be done for each channel, but the real problem for me with it is, I don't understand the code/command as well as I do the xml.
I can read the xml that Zugg posted and get a fairly good idea of what it's doing and what will happen with it, however I get lost with this damn near at the start, I did finally figure out it was a command line and not something that you paste into the editor. I guess to clarify a bit, I understand that I can edit it to create other channels, but I get lost in the format and the ?switches? that are involved in this command. Maybe I need more time in a MUD to understand it, but it's a bit greek for me atm.
Anyhow, I got most of this stuff working with no trouble, even created a help script based on the "map" capture script that Zugg posted.
Code: |
<trigger id="25">
<pattern>~{help}</pattern>
<value>#GAG
#GAGON
:HELP:#CLR
#C+ HELP</value>
</trigger>
<trigger id="26">
<pattern>~{/help}</pattern>
<value>#GAG
#C-
#GAGOFF</value>
</trigger>
|
I have 3 issues I can't seem to resolve, I know they have to be simple.
1) I can't get the status bars to update with any data. I changed the code a bit to better suit what I wanted, which is probably more like what Zugg's original format was, I mistakenly stated Mana somewhere and I did not really want that one. So my code is...
Ingame prompt: 293/293hp 732/732mv 1000tnl
Code: |
<trigger newline="false" prompt="true" id="32">
<pattern>(%d)/(%d)hp (%d)/(%d)mv (%d)tnl</pattern>
<value>hp=%1
maxhp=%2
mv=%3
maxmv=%4
tnl=%5</value>
</trigger> |
This is the code for the buttons, I changed nothing since it seemed that it was using the values assigned in the above code, maybe I missed something here.
Code: |
<cmud>
<button type="Gauge" autosize="false" width="120" height="14" inset="true" toolstyle="true" transparent="false" color="#008040" textcolor="white" gaugelowcol="red" priority="1">
<caption>Hp: @hp/@maxhp</caption>
<expr>@hp</expr>
<gaugemax>@maxhp</gaugemax>
<gaugelow>@maxhp/10</gaugelow>
</button>
<button type="Gauge" autosize="false" width="120" height="14" inset="true" toolstyle="true" transparent="false" color="#8080FF" textcolor="white" gaugelowcol="fuchsia" priority="2">
<caption>Mv: @mv/@maxmv</caption>
<expr>@mv</expr>
<gaugemax>@maxmv</gaugemax>
<gaugelow>@maxmv/10</gaugelow>
</button>
<button type="Gauge" autosize="false" width="120" height="14" inset="true" toolstyle="true" transparent="false" color="#EEDB51" textcolor="#5C8DFE" gaugelowcol="red" priority="3">
<caption>Exp: @tnl</caption>
<expr>@tnl</expr>
<gaugemax>1000</gaugemax>
<gaugelow>150</gaugelow>
</button>
</cmud> |
PS. I'm not sure why this info always follows my prompt, but this is the complete output of my prompt in game:
293/293hp 732/732mv 1000tnl
{stats}30/15,12/11,22/11,21/14,17/15,24/14,100,100,100,49,34,You are Standing.,9999,293/293,300/300,732/732,11058,0,0,90,1000,11,5
I'm not sure if that is having an effect on this working or not, but it's not something I want to see spammed each time my char moves, I would like to use this later to place in a new window that is fixed, but I'm not even sure how to turn this off in game atm.[/code]
2) I can't for the life of me figure out how to move these buttons above, to the status bar area of my main window, it appears that way in Zugg's screenshot, but I couldn't find any option for moving them.
3) In my map window, I have the tag <MAPEND> show up under the [ Exits: E ], is there a way to hide that? I can get a screenshot and post if this confuses anyone. |
|
|
|
Toxic Adept
Joined: 27 May 2008 Posts: 299
|
Posted: Fri Aug 22, 2008 9:01 pm |
Actually the code provided by Charneus will handle ALL of your channels with just that little bit of code... But to use it you need to turn on some tags Ingame...
This is what his code would look like in xml format
Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<trigger priority="88750" copy="yes">
<pattern>(~{chan ch=(%w)~})(*)</pattern>
<value>#SWITCH (%2) ("Answer" OR "Question") {#CAP answer} {#CAP %2}
#PSUB {} %x1</value>
</trigger>
</cmud>
|
Basicly all the #SWITCH does is detect if its Question or Answer channel and writes them both to the same window since they are essencially the same channel ingame.
So type 'tags channels on' which ingame and then use Charneus' code and you will see what I mean.
Also to get rid of the {stats} line use the command 'statmon'. It is a toggle.
Also to make your code proper you need to escape the } in both your help capture triggers...
So it would look like this..
Code: |
<trigger id="25">
<pattern>^~{help~}</pattern>
<value>#GAG
#GAGON
:HELP:#CLR
#C+ HELP</value>
</trigger>
<trigger id="26">
<pattern>^~{/help~}</pattern>
<value>#GAG
#C-
#GAGOFF</value>
</trigger> |
|
|
|
|
Royel Beginner
Joined: 21 Aug 2008 Posts: 12
|
Posted: Fri Aug 22, 2008 9:03 pm |
Toxic wrote: |
Actually the code provided by Charneus will handle ALL of your channels with just that little bit of code... But to use it you need to turn on some tags Ingame...
|
OH!!! :)
Toggling Statmon fixed the button data issue.
Using Charn's chat capture code does not remove all the chat from the main window, it does echo it to new windows, is this how it's supposed to work, or did I mess something up? |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Fri Aug 22, 2008 9:21 pm |
It works that way, yes. If you want to remove it from the main channel (note, it WILL remove all channels from the main screen), just add a #gagspace at the first line.
Charneus |
|
|
|
Royel Beginner
Joined: 21 Aug 2008 Posts: 12
|
Posted: Fri Aug 22, 2008 9:53 pm |
Charneus,
I got this working now, but I am still getting 2 windows for the answer and question channel, since Davos explained it should be capturing to one window, have I messed something up.
Code: |
<trigger priority="560" id="56">
<pattern>(~{chan ch=(%w)~})(*)</pattern>
#GAGSPACE
#SWITCH (%2) ("Answer" OR "Question") {#CAP answer} {#CAP %2}
#PSUB {} %x1</value>
</trigger>
|
Actually, this is the Script Text copied directly from the Package Editor, as I was told to place Gagspace there to remove the chat from the main window.
Pattern: (~{chan ch=(%w)~})(*)
1 #GAGSPACE
2 #SWITCH (%2) ("Answer" OR "Question") {#CAP answer} {#CAP %2}
3 #PSUB {} %x1 |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sat Aug 23, 2008 12:14 am |
Not sure why it's not working. It works on my end flawlessly.
Did you delete the other settings (such as the one Zugg gave you) for your channels? Either delete it or just disable it, and answer/question should go to just one window. Also , make sure that you delete the question window. That may confuse you into thinking that stuff is going to that window.
Charneus |
|
|
|
Royel Beginner
Joined: 21 Aug 2008 Posts: 12
|
Posted: Sat Aug 23, 2008 12:24 am |
Yes, I deleted all the stuff Zugg gave me, I deleted all the windows and started over fresh..
I eventually gave up and reinstalled CMud, first deleting all my user files. Still it creates 2 windows and labeled appropriately, one question, the other answer. |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sat Aug 23, 2008 1:46 am |
Royel, you were right - it was making two windows. Therefore, I modified it a little. Truthfully, it should have worked the way I had set it up per the help files, but this is the way to get it to work now:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<trigger priority="17820" copy="yes">
<pattern>(~{chan ch=(%w)~})(*)</pattern>
<value>#GAGSPACE;#SWITCH (%2="answer" OR %2="question") {#CAP answer} {#CAP %2}</value>
</trigger>
</cmud>
Sorry about that... :\ Hope this helps!
Charneus |
|
|
|
Royel Beginner
Joined: 21 Aug 2008 Posts: 12
|
Posted: Sat Aug 23, 2008 2:02 am |
Well, this has actually been fun for me I'm learning a good bit and now that we've got this first issue taken care of, my stats update on the buttons correctly (though I'd like to somehow make them refresh a bit more often at times).
Got the chat stuff working and I have a good idea how I can actually modify this stuff now, thanks again Charneus.
Now for the last 2 issues, if anyone cares to help with those.
Royel wrote: |
2) I can't for the life of me figure out how to move these buttons above, to the status bar area of my main window, it appears that way in Zugg's screenshot, but I couldn't find any option for moving them.
3) In my map window, I have the tag <MAPEND> show up under the [ Exits: E ], is there a way to hide that? I can get a screenshot and post if this confuses anyone. |
|
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sat Aug 23, 2008 2:15 am |
Here is my automap script. It's basically the same as Zugg's, only it takes care of that <MAPEND> bit, too.
Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<class name="AutoMap" copy="yes">
<trigger priority="23550" copy="yes">
<pattern>^You will no longer see the map automatically when you move.$</pattern>
<value>#clr MAP
#loop 4 {#win MAP %cr}
#win MAP " "%ansi( red)~[ %ansi( hi, red)Map Unavailable %ansi( red)~]</value>
</trigger>
<trigger priority="23600" copy="yes">
<pattern>^You{ will now see the map automatically when you move|r journey was broken by the need to defend yourself}.$</pattern>
<value>map;#gag</value>
</trigger>
<trigger priority="11840" copy="yes">
<pattern>^~</pattern>
<value>#gag
#gagoff
#c-
#CALL %pref("echomessage",1)</value>
</trigger>
<trigger priority="12120" copy="yes">
<pattern>^$</pattern>
<value>#CALL %pref("echomessage",0)
#gagon
#gag
#c+ maps
#clr maps</value>
<trigger param="20" regex="true">
<pattern>^\[(?:\s+)?Exits.*</pattern>
<value>#gag;#gagoff;#C-</value>
</trigger>
</trigger>
</class>
</cmud> |
As for your first issue, go to Preferences -> User Interface -> Buttons, and make Toolbar 2 to be bottom. Then go to the buttons themselves, go to the options tabs on the buttons, look for Position, and change Toolbar to 2.
Charneus |
|
|
|
Royel Beginner
Joined: 21 Aug 2008 Posts: 12
|
Posted: Sun Aug 24, 2008 4:34 am |
How would I go about setting up this?
I want a trigger based on this text, but I want to save the part in brackets as a string to re-use elsewhere.
Code: |
You stop wielding {Melpomene's Betrayal} in your off-hand. |
The brackets are added by me to show what part of the text I want to capture for the string, the actual line in game looks as follows:
Code: |
You stop wielding Melpomene's Betrayal in your off-hand. |
Thanks
Royel |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sun Aug 24, 2008 4:37 am |
#TRIGGER {You stop wielding (*) in your off-hand.} {#var offhandweapon %1}
The parameter would be %1, so whatever you wanted to do with that captured item, you need to denote it as %1.
Charneus |
|
|
|
Royel Beginner
Joined: 21 Aug 2008 Posts: 12
|
Posted: Sun Aug 24, 2008 6:06 am |
Thanks Charneus for the help
I wanted to show you my sloppy work so you could critique it for me, I know there was a much simpler method to do this very thing, I actually started with just sending the commands, but I also wanted to try and learn something, which I did. I wanted to make the script work with any weapon I might be using for future use.
This is the code at this point:
Code: |
<button autosize="false" width="60" height="16" autopos="false" left="890" inset="true" transparent="false" color="#FF8040" priority="1502" id="150">
<caption>Port Recall</caption>
<value>dual remove
#TRIGGER {You stop wielding (*) in your off-hand.} {#var OffHand %1}
hold can
enter
dual %left(@OffHand,3)</value>
</button> |
I'm sure if you knew what I was gonna do with this code you could have told me that it was gonna give me a fit, which it did, I searched the help files in CMud for several hours again tonite till I found the solution.. I'm sure that it will cause a problem at some point, but for now it worked.
Let me know what you think, or how it should be done.
Thanks
Royel
PS, I did see a section on strings that showed how to count the words, and characters in a string, I think that might be the way to make this work properly, but that was too much work for me for now. |
|
|
|
BloodyThorn Newbie
Joined: 31 Jan 2009 Posts: 5 Location: Austin, Texas
|
Posted: Fri Mar 27, 2009 4:33 am |
charneus wrote: |
Actually, for channels, it's now much easier... this is my script for channels:
#TRIGGER {(~{chan ch=(%w)~})(*)} {#SWITCH (%2) ("Answer" OR "Question") {#CAP answer} {#CAP %2};#PSUB {} %x1} -- each one will go to their individual window. :P
Charneus
You do have to have tags channels on, though. |
I liked this, cept I didn't want it all going to different windows, so instead I made it compare a database record and send it to the designated window in the data record.
#TRIGGER {^(~{chan ch=(%w)~})(*)$} {#IF (%2<>"") {#psub {} %x1;#capture %db(@chat,%2);#gagspace} {#psub {} %x1}}
#addkey chat gossip SpamChat
#addkey chat ftalk Chat
..etc al
That way I can have all my spammy chat goto one window, and all my important text goes to another. And really you can designate where each one goes based on the Database Record variable.
I admired the eloquence of Charneus' script, but had to modify it a bit. Having a seperate chat window for each would...unruly.
BloodyThorn
EDIT - Edited the trigger to make a contingency for channels that weren't found in the data record, then it will just print it to the normal window scroll and not do a cap at all...but will still strip the tag header out of the message.
EDIT2- Okay, this should have worked just fine, but when there is no record found in the variable, it copies it to the editor window and I can't figure out why. If it evaluates false it shouldn't do anything but strip the tag...still testing... |
|
|
|
|
|
|
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
|
|