Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Treluk
Newbie


Joined: 28 Nov 2010
Posts: 9

PostPosted: Tue Nov 30, 2010 1:13 am   

Exits trigger issues, and strange placement of created on the fly variables.
 
Hey guys,

Im kind of curious to if anyone has encountered a problem like this, and what they've done to fix it.

1) My room exits look like this [Exits: dir1 dir2 etc].... i have a trigger set up to fire on *Exits: * it is set up in a general trigger class that never turns off so long as the script is running. This trigger executes 98 out of 100 times. For whatever reason, the 2 times out of 100 the script doesn't fire anything. No debut messages or anything, its like cMUD just ignores it. Everytime this happens, i look at the scrollback and notice no difference in the look of the room exit line, it always has directions in it, and it never fails to fire on the same room more than once, its always a random room, that i walk time and time again without problems. Sometimes it will go the entire length (about 50-75 rooms each zone) without problem. Any thoughts?

2) I have manually set up through the package editor a "dirlist" string list variable in the root directory, along with all of the other general aliases and variables that i want to keep active all the time. For whatever reason, one out of every five times i fire an alias that updates the dirlist string list variable cmud will create a new one in a random class. Also, going back to see what happened when the alias fired, it sticks it in a class that had nothing to do with the alias that was just fired. Weird huh?

Anyways I know these errors have been posted before and i've reviewed them, but the solutions arent specific to my case. Can anyone give me some pointers? I should also mention, i have approximately 50 aliases and 50 defined on the fly variables, all of which always update in the root directory, its just the one string list variable that is being problematic.

I guess i should also mention incase anyone makes a comment about there being *Exits: * firing in the room description, but i've double checked all room descriptions, and even ran an entire log against the trigger, and it fires when i run the log through it. Even to test, i've set up a timeout function that when i sit in a room too long, i automatically "look" to force the trigger again in a loop until it catches the Exits: trigger... sometimes it works on the first timeout, sometimes it works on the 10th timeout... really strange.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Tue Nov 30, 2010 1:35 pm   
 
1) Give us the actual XML code for your trigger: Select the trigger in the Package Editor. In the code window, click the XML tab at the bottom. Highlight and copy the the entire XML code to the cut buffer with CTRL-c. In a reply to this thread, paste the code. Before the beginning of the code, put: [code], and after the code put: [/code].

Also, open the debugger window. Turn on all the debugger display options. When you find a case where your trigger does not fire as you expect, copy and paste the relevant portion of the debugger display in your reply to this thread, again within code markers.

2) You should not post multiple problems in a single thread. In the future make a separate thread for each problem.

Give us the actual code for your alias, as described in answer 1). Also, if this alias is being called by other aliases or triggers, give us the actual code for those.

You say that you have examined the previous threads on problems similar to this, and that they aren't specific to your case. I remember quite a few relevant threads that gave general things to look for in cases like this. Have you found those threads, and followed those instructions to try to figure out the problem?

Things to look for, off the top of my head: Are there multiple places in your code where the alias is being called? Do you use threads at all (i.e., use #THREAD, #WAIT, and related commands)? Do you use commands that use #CLASS or #MODULE to change your current active class?
Reply with quote
Treluk
Newbie


Joined: 28 Nov 2010
Posts: 9

PostPosted: Wed Dec 01, 2010 5:12 am   
 
Sorry about the lack of information, in response to your reply;

1) My dirlist variable is only called my "step" alias, its in the root directory and the only line in it is %pop(dirlist)
2) I dont use #THREAD, but i do often use #WAIT to space out the execution of commands. The mud i play on has a "Bot Thwacker" which is intelligent code to identify characters using scripts, and it "Thwacks" the experience, skill improvements and various other things.
3) I do not use commands that use #CLASS or #MODULE, my triggers are set up in seperate classes that i use #T+ and #T- use/disable triggers that are active.
4) I have went through several threads, and in any instance where i could find relavent information, i have attempted to look for/use the fixes that were supplied, but to no avail unfortunately.
5) Sorry about the multiple questions in the thread, i'll remember that for next time.

This is the XML for my exits trigger:

Code:

<trigger priority="470" id="47">
  <pattern>*Exits:*</pattern>
  <value>  #TS 50
              #WAIT 2000
              step
</value>
</trigger>


The 50 second timer is set up to "look" again for the exits and it sends a log notification to my Comm window. I have my script identify all issues that it finds to report in timestamped format to my Comm window so i can keep an eye on it. I generally dont have my actual session window maximized or active, because the script does all the work. It quite often reaches the 50 second timer, and logs it as it should, sometimes one execution of the TICK IN 5 SECONDS. trigger fixes it, sometimes it times out after my limit, and my script forces the character to recall and reset its stats, which it has to use sometimes once per session (every 3-4 hours) and sometimes it happens every run (every 5-10 minutes).

My dirlist string list variable the 2nd problematic code in my script (Theres only 2 out of 100 items thank god) I have aliases that "start a run"
The run is decided in a random format, so i dont run the same 20 zones in a row, it switches it up a bit, to avoid getting caught by the bot code.

Here is an example of a typical definition of the dirlist string list variable;

Code:

<alias name="runelven" id="288">
  <value>#VAR woadsanc 0
#T+ ElvenScript
#T- mobcheck
#WAIT 2000
waypoint unholy
#WAIT 2000
#VAR dirlist {waypoint chapel|open door|s|s|s|sw|w|n|w|w|w|s|w|s|s|s|s|w|s|s|w|s|s|w|s|s|s|s|w|w|w|e|s|e|w|s|w|s|e|s|e|s|n|n|e|e|s|e|n|e|w|n|u|w|w|w|s|n|w|w|e|e|e|n|n|w|n|s|e|e|d|n|e|n|n|s|e|w|s|s|s|e|w|n|w|w|w|w|w|open aspen|u|open door|n|w|n|w|n|s|open doubledoor|s|open door west|w|w|e|e|s|s|e|u|open door|n|s|d|w|w|e|s|w|u|d|e|e|u|u|snod}
#WAIT 2000
#T+ mobcheck
#T+ general
#WAIT 2000
#VAR status Walking
look</value>
</alias>


I originally thought that having multiple word items in the string list variable was causing the problem, but sure enough it fires every time.

Here is an example of an instance where the script doesnt recognize a random "Exit" trigger for no reason;

Code:

A simple wooden cottage
A roaring fire in the fireplace to the left provides both light and warmth
for this cottage. A round table of oak and a set of chairs lie in the center
of the room. In the back of the cottage is a large bed with a small window
set in the wall just above it.

A two handed sickle lies on the ground.
A wood woad stands here on its three spindly legs.
A wood woad glows with a bright light!
A skeletal mage with glowing white hands paces here.
A walking skeleton with a spear paces back and forth.
A walking skeleton with a ball flail paces back and forth.
A raised undead ghoul stands here sniffing for flesh.
A skeletal mage with glowing red hands paces here.
A walking skeleton with a spear paces back and forth.
[Exits: northeast ]
TICK IN 5 SECONDS. [TICK IN 5 SEONCDS. -> look]
look
A simple wooden cottage
A roaring fire in the fireplace to the left provides both light and warmth
for this cottage. A round table of oak and a set of chairs lie in the center
of the room. In the back of the cottage is a large bed with a small window
set in the wall just above it.

A two handed sickle lies on the ground.
A wood woad stands here on its three spindly legs.
A wood woad glows with a bright light!
A skeletal mage with glowing white hands paces here.
A walking skeleton with a spear paces back and forth.
A walking skeleton with a ball flail paces back and forth.
A raised undead ghoul stands here sniffing for flesh.
A skeletal mage with glowing red hands paces here.
A walking skeleton with a spear paces back and forth.
[Exits: northeast ]
TICK IN 5 SECONDS. [TICK IN 5 SECONDS. -> look]
look
A simple wooden cottage
A roaring fire in the fireplace to the left provides both light and warmth
for this cottage. A round table of oak and a set of chairs lie in the center
of the room. In the back of the cottage is a large bed with a small window
set in the wall just above it.

A two handed sickle lies on the ground.
A wood woad stands here on its three spindly legs.
A wood woad glows with a bright light!
A skeletal mage with glowing white hands paces here.
A walking skeleton with a spear paces back and forth.
A walking skeleton with a ball flail paces back and forth.
A raised undead ghoul stands here sniffing for flesh.
A skeletal mage with glowing red hands paces here.
A walking skeleton with a spear paces back and forth.
[Exits: northeast ]
[*Exits:*-> #TS 50
#WAIT 2000
step]
Timer now at 50 secs.
ne


And to spare more wasted lines in this thread, the script after 2 unsuccessful attempts to execute the exits trigger, as it does 95% of the time, and fire the "step" alias, which forced me NW.

Sorry if this is lengthy but i hope this provides more information to the finding of the problem.

Thanks in advance for any further interest or reply.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed Dec 01, 2010 2:55 pm   
 
Quote:
Sorry about the lack of information, in response to your reply;

1) My dirlist variable is only called my "step" alias, its in the root directory and the only line in it is %pop(dirlist)

Well, that is one problem right there. A commandline should never start with a function name or variable name
(except to set the variable). You should probably use "#SEND %pop(dirlist). But this is probably not the cause
of the problem.

I'm not sure why you are using the #TS command. Once you start that running, it is going to repeat its command every 50 seconds, over and over.
What your trigger is doing is resetting it to start the countdown at 50 again. This feels like a very awkward way of doing things, and prone to problems.
It could be contributing to the problem with #WAIT.

The main thing I am worried about is the #WAIT commands. The way you have it set up, you could easily have multiple threads running at the
same time, trying to do the step command. That is almost certainly the problem you are seeing with @dirlist being created in other classes.
It is also the usual cause of problems that have been reported in previous threads. When using #WAIT, you need to be very careful to ensure
that it cannot accidentally make extra threads that you don't want. All that needs to happen for your script to completely get messed up is to have
one "look" command or movement command executed by another thread while your step thread is running. You need to examine your entire
script structure to make sure that this can't happen, or make your step trigger thread-safe to solve the problem.

I'm afraid that's all the help I feel comfortable giving on this specific topic. I do not approve of violating the anti-botting rules of a mud.
But I'll be happy to give more specific help on issues that don't involve violations of mud rules.
Reply with quote
Treluk
Newbie


Joined: 28 Nov 2010
Posts: 9

PostPosted: Wed Dec 01, 2010 4:47 pm   
 
Thanks for the info I will try and rescript it a cleaner fashion. As per violation of mud rules the particular mud I play on does not ban botting. I am not breaking the rules in any way, the bot detection script is for weining out the bots that spam the mud or the bots that camp or are not smart enough to handle themselves in situations involving other players. So not to worry I am not violating the wishes of the admin, ive already talked to him about it. And thanks again for your info.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed Dec 01, 2010 5:23 pm   
 
Ah, interesting. Well, then, if you need more help after trying to track down the conflicts, just ask.
Reply with quote
Treluk
Newbie


Joined: 28 Nov 2010
Posts: 9

PostPosted: Wed Dec 01, 2010 5:38 pm   
 
Thanks for the offer. I suppose to avoid spamming the mud I can set up my script to space out the frequency of commands sent to the mud by using the spam filter I think. That will rid myself of the #WAIT commands I use quite often. As for #SEND %pop(dirlist) it sends it directly to the mud and it responds by giving me the "sorry that is not a proper command" send. I'll clean it up and come for help if I still have issues. Thank for pointing me in the right direction.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net