 |
mattmatt Newbie
Joined: 27 Nov 2008 Posts: 3
|
Posted: Thu Nov 27, 2008 8:27 pm
3 issues |
1. After I get disconnected my log suddenly stops. I can't continue (append) it without closing and opening again cmud. Why is that?
I'm using onConnect event:
#lo "C:\Documents and Settings\Maria\Moje dokumenty"\logi\%time(eeee)\%time(mmmm-dd)
Folders already exist and log is starting but as I mentioned it just can't continue after geting disconnected without restarting Cmud.
2. In Zmud I used for example variable aaa.bbb with value orc|goblin|orc2 and then in trigger I used "^{@aaa.bbb} does something." and it worked for orc does something. and goblin does something etc. Now in Cmud the trigger doesn't works. What should I do?
3. How can I make trigger witch creates variable that has more than 1 line?
For example:
#if (%1=polnoc)
{
#var blabla "
as
as
"
}
doesn't works - creates variable " and sends to mud as,as,"
Please help. :) |
|
|
 |
charneus Wizard

Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Thu Nov 27, 2008 8:48 pm |
1. The log is still running, even when you get disconnected. For this reason, when you have an onConnect event that starts logging but no onDisconnect to end logging, the log stops on the reconnect. Try adding a #LOG to the onDisconnect.
2. Try using {%%dbkeys(@aaa)} instead.
3. Try using %cr where the line breaks are supposed to be.
Hope this helps.
Charneus |
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Thu Nov 27, 2008 8:48 pm |
1) It's because the #log command toggles logging. See also this thread. Using an OnDisconnect event to toggle the log off should fix it.
2) Depends what exactly you were trying to do, but basically, you shouldn't be using . in variable names - it's a special character in this context because it separates the name of a data record variable from its key. The {item|list} syntax still exists in triggers and will still work with a variable with that format, but you need to be careful how you configure your variables.
3) Again, it depends on the exact problem you're trying to solve. More detail will help us suggest an appropriate solution. The basic answer is that a newline is a command separator in CMUD, so you can't use raw newlines the way you're trying to use them inside a string in your script. You need to use some sort of proxy character ("|" works well, because it'll create a stringlist you can then iterate over using #forall) to represent the newlines in the string. |
|
|
 |
mattmatt Newbie
Joined: 27 Nov 2008 Posts: 3
|
Posted: Thu Nov 27, 2008 10:17 pm |
Great, logging works perfectly now. Thanks a lot. :)
2. I have a database with names of my friends. In my language the name is different when you use it in santance "Adam is standing here." and in command "help Adam" or kill "Adam". It would looks like: pomoz (help) Adamowi and zabij (kill) Adama. In that database i have all possible forms of my friends names (6 for each name). Then when I'm in team with someone i have a script that compares my current teammates with the names in database. Then they are put in each form in a variable named "druzyna". This is a big variable, in "Database record" form. It has saveral Keys, and Values - for example Key: "Celownik" with Value: "Adamowi|Tomkowi|Kubie" and Key: "Mianownik" with Value: "Adam|Tomek|Kuba" and so... Now I would like to use it to add colours to my teammates attacks, I need to use variable "Druzyna", key "Mianownik" and it has to works if I have 1 person in team "Tomek", two people "Tomek|Adam" or more people "Tomek|Adam|Kuba|Jasiek|Kamil". In Zmud i just used trigger like that: "{@druzyna.mianownik} strikes {orc|goblin|dwarf} with a {great|low} power. But now it just doesn't works. :(
3. I'm trying to create an Status window that would draw me a simple map. Each location has exits in last line. I can "catch" them by some triggers and then I would like to put them in a variable that would be seen in Status window. Currently I can add that "map" after the last line of text but I would prefere to have it in status window in top, left corner of the screen.
Exit line translated from my language:
There are three exits from this location: east, west, north-east.
and the map looks like that:
How can I put it in a variable (by a trigger that catches exits) so then I can see that in a status window.
Thanks a lot for help guys. :) |
|
|
 |
|
|