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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
MisterDwooD
Novice


Joined: 04 Feb 2014
Posts: 42

PostPosted: Sun May 24, 2015 10:18 am   

Trigger stops triggering after it gets "interrupted"
 
I have a "Find Room" script that I use on my mud that syncs with my map. --- I'm going to try and keep this short, as I know nobody likes to read a book just to help someone else.

What is supposed to happen is I type "find" and it sends a "look" command to the mud, and then captures the room, and searches for my room on my map and moves me to that room on the map so that i'm in sync with it.

Video Here: http://screencast.com/t/3HxROx22

The script works great 99% of the time. However, the 1% it stops working. And then it's broken until I close zmud, and start it back up again. I have NO IDEA why that will make it work again.

What happens when it's broken is that the trigger:
Code:
^*obvious exits: (*) ]$
stops triggering. I can reload the re-try the "find" all I want, it never triggers. However, if I do a "test" and copy the line from the mud that it triggers on, and put it in the test box, it tests positive. I can manually "execute" the trigger, and it works too. But that doesn't reset it or anything. It is still broken. I can type "find" all i want, and nothing ever works.

Video of it broken here: http://screencast.com/t/WVm21CbW and here http://screencast.com/t/RzqJFjIT35

For years, I just delt with the issue. But, now I've narrowed it down to 1 common occurrence that appears to do the breaking. You can see it in this screenshot: http://screencast.com/t/5nZj5ngU

In that screenshot, you can see that one of my other triggers. "kill 2.leatherleaf" triggered and put that in there before the "Matching Room Found" text. I have found that EVERYTIME something like this happens. it breaks. I have no idea why it's breaking it. This can also happen when I'm running a long distance, and have already put in like 15+ commands to move, and then i type "find" in the middle of it somewhere, and the script fires, but the "look" command doesn't go through until the rest of my directional commands go through. When the "look" command does go through, it'll find my room once, and then it breaks the trigger again.

I did do a little big of modifying the script that i'll past below. And maybe that's the reason it doesn't work. what i did it took out the "#say" in on the bottom of the "obvious" trigger. the one found
Code:
#IF (@findverbose) #say
. I didn't like the space after the "matching room found". And then I took out the %crlf before the
Code:
 #SAY %crlf Matching room found! Correcting map position.
.

Maybe someone can tell me if that's the whole reason it's happening. maybe there's a reason that the #say and the %crlf have to be in there or it does break occasionally. HOWEVER, even without modifying the code, I was able to break it.

Here's one more video showing that.
Code:
http://screencast.com/t/Esi94vulx


HERE IS THE CODE:

Code:
#CLASS {Map Scripts|Find Room 2.2}
#ALIAS find {
#PRIORITY {
#VARIABLE FindRoomName {}
#VARIABLE FindRoomDesc {}
#VARIABLE FindRoomExits {}
#IF (%begins( %proper( %1), "V")) {
#SAY %crlf Find Room will now use VERBOSE mode.
#VARIABLE FindVerbose {2}
}
#IF (%begins( %proper( %1), "B")) {
#SAY %crlf Find Room will now use BRIEF mode.
#VARIABLE FindVerbose {1}
}
#IF (%begins( %proper( %1), "S")) {
#SAY %crlf Find Room will now use SILENT mode.
#VARIABLE FindVerbose {0}
}
#IF (%begins( %proper( %1), "M")) {
#SAY %crlf Find Room is currently in %item( "SILENT|BRIEF|VERBOSE", %eval( @findverbose+1)) mode.
#SAY %char( 32)Modes available: SILENT, BRIEF, VERBOSE.
}
#IF (%numparam( ) = 0) {
look
#IF (@findverbose) {#SAY Preparing to find this room on the map.}
#T+ FindRoomTrigger
#T+ FindRoomExitsTrigger
}
#NOOP
}
}
#FUNCTION frsubexits {%sort( %upper( %replace( %replace( %replace( %1, "[ obvious exits: ", ""), " ]", ""), " ", "|")))}
#VARIABLE FindRoomDesc {This is an inn favored by the merchants who come to Fal Dara. It is a quiet}
#VARIABLE FindRoomName {The Peaceful Knight''s Rest}
#VARIABLE RoomsFoundByName {38653}
#VARIABLE RoomsFoundByDesc {6113}
#VARIABLE FindRoomExits {S}
#VARIABLE RoomsFoundByExits {38354|38355|38356|38383}
#VARIABLE findverbose {1}
#REGEX "FindRoomTrigger" {(?:^|> )(\033.?.?36m(?!\a+ (?:speaks from the |answers your prayer)).*\033)} {
%literal( #PRIORITY {#VARIABLE FindRoomName {%trimleft( %right( %line, %pos( '> ', %line)))}})
#NOOP
} "" {notrig|color|disable}
#CONDITION {^(*)$} {
#IF (%line =~ "^*obvious exits: (*) ]$") {#VARIABLE FindRoomDesc {}} {#VARIABLE FindRoomDesc {%1}}
#STATE FindRoomTrigger 0
} {looplines|param=50|notrig|disable}
#TRIGGER "FindRoomExitsTrigger" {^*obvious exits: (*) ]$} {
#PRIORITY {
#VARIABLE FindRoomExits {%1}
#T- FindRoomTrigger
#IF (@findverbose=2) {#SAY}
#IF (%numitems( @FindRoomName) = 0) {
#IF (@findverbose) {
#SAY %char( 32)Failed to retrieve room info!
#COLOR red
}
} {
#IF (@findverbose=2) {
#SAY %char( 32)Searching for room names...
#COLOR darkgray
}
#VARIABLE FindRoomName {%replace( @FindRoomName, "'", "''")}
#VARIABLE RoomsFoundByName {%mapquery( NAME = '@FindRoomName')}
#IF (%numitems( @RoomsFoundByName) = 0) {
#IF (@findverbose) {
#SAY %crlf No matching room name found! Update your map.
#COLOR red
}
} {
#IF (%numitems( @RoomsFoundByName) = 1) {
#TELEPORT {@RoomsFoundByName}
#IF (@findverbose=2) {
#SAY %crlf Matching room name found! Correcting map position.
#COLOR green
} {
#IF (@findverbose=1) {
#SAY %crlf Matching room found! Correcting map position.
#COLOR green
}
}
} {
#IF (@findverbose=2) {
#SAY %char( 32)Multiple matching room names found.
#COLOR goldenrod
#SAY %char( 32)Searching through descriptions...
#COLOR darkgray
}
#IF (%numitems( @FindRoomDesc) = 0) {
#IF (@findverbose=2) {
#SAY %char( 32)Failed to retrieve room description!
#COLOR red
}
#VARIABLE RoomsFoundByDesc {@RoomsFoundByName}
} {
#VARIABLE RoomsFoundByDesc {}
#FORALL @RoomsFoundByName {#IF (%begins( %roomdesc( %i), @FindRoomDesc)) {#ADDITEM RoomsFoundByDesc %i}}
}
#IF (%numitems( @RoomsFoundByDesc)=1) {
#TELEPORT {@RoomsFoundByDesc}
#IF (@findverbose = 2) {
#SAY %crlf Matching room description found! Correcting map position.
#COLOR green
} {
#IF (@findverbose = 1) {
#SAY %crlf Matching room found! Correcting map position.
#COLOR green
}
}
} {
#IF (%numitems( @RoomsFoundByDesc)=0) {
#IF (@findverbose=2) {
#SAY %char( 32)No matching room description found! Update your map.
#COLOR red
}
#VARIABLE RoomsFoundByDesc {@RoomsFoundByName}
} {
#IF (@findverbose=2) {
#SAY %char( 32)Multiple matching descriptions found.
#COLOR goldenrod
}
}
#IF (@findverbose=2) {
#SAY %char( 32)Searching through exits...
#COLOR darkgray
}
#VARIABLE RoomsFoundByExits {}
#FORALL @RoomsFoundByDesc {#IF (@frsubexits(@FindRoomExits)=@frsubexits(%roomexit( %i))) {#ADDITEM RoomsFoundByExits %i}}
#IF (%numitems( @RoomsFoundByExits)=1) {
#TELEPORT {@RoomsFoundByExits}
#IF (@findverbose=2) {
#SAY %crlf Matching room exits found! Correcting map position.
#COLOR green
} {
#IF (@findverbose=1) {
#SAY %crlf Matching room found! Correcting map position.
#COLOR green
}
}
} {
#IF (%numitems( @RoomsFoundByExits)=0) {
#IF (@findverbose=2) {
#SAY %char( 32)No matching room exits found! Hidden doors suspected.
#COLOR goldenrod
}
#VARIABLE RoomsFoundByExits {@RoomsFoundByDesc}
}
#IF (%numitems( @RoomsFoundByExits)>1) {
#IF (@findverbose=2) {
#SAY %char( 32)Multiple matching room exits found!
#COLOR goldenrod
}
#VARIABLE RoomsFoundByExits {@RoomsFoundByDesc}
}
#IF (%ismember( %roomkey, @RoomsFoundByExits)) {
#IF (@findverbose) {
#SAY %crlf Multiple possible matches, and your map is already in one of them. No action taken.
#COLOR goldenrod
}
} {
#TELEPORT %item( @RoomsFoundByExits, 1)
#IF (@findverbose) {
#SAY %crlf Multiple possible matches! Randomly guessing map position...
#COLOR goldenrod
}
}
}
}
}
}
}
#IF (@findverbose) {#SAY}
}
#T- FindRoomExitsTrigger
} "" {notrig|disable}
#CLASS 0



If Anyone can help me fix this. That would be awesome!

Thank you in advance! (I hope i've given you everyone you need to look into it!)

Thanks!
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 3589
Location: Pensacola, FL, USA

PostPosted: Sun May 24, 2015 11:02 pm   
 
Nothing is jumping out at me with a quick skim, but since you mentioned the command as a possible cause...
Maybe your hunting script is interferring somhow?
_________________
Windows 10 Home Premium 64-bit
AMD Phenom II x6 1055T 2.8GHz 16GB
CMUD Pro v3.34
Reply with quote
MisterDwooD
Novice


Joined: 04 Feb 2014
Posts: 42

PostPosted: Mon May 25, 2015 4:52 am   
 
Thank you for the response.

And that would definitely be nice if all i had to do was change up my "hunting script". However, like I mentioned, if I enter in a long string of directional commands, and then type a "find"... Sometimes that will mess it up as well. So it's not just the hunting script that is causing it.

I understand that from just looking at it, it's hard fix it. So Thank you anyways for looking at it!
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 3589
Location: Pensacola, FL, USA

PostPosted: Mon May 25, 2015 7:37 am   
 
I half suspect you may have corrupted your settings file somehow.
Not sure if the CMUD method of trying to preserve your settings would work for zMUD.
Been awhile since i used it outright.
_________________
Windows 10 Home Premium 64-bit
AMD Phenom II x6 1055T 2.8GHz 16GB
CMUD Pro v3.34
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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