Turn Script Won't Disable

thelaststarwhale
15 Feb 2016, 21:13
Hey guys,

I'm working on a chatroom-like TA and I'm having a problem. In order to PM someone the player is moved into a new room and the main chat conversation, which is a turn script, won't disable.

Login:
msg ("<b><i>Login Required. Username:</b></i>")
get input {
player.alias = result
msg ("{player.alias}<br/><br/><b><i>Password:</b></i>")
get input {
player.password = result
msg ("{player.password}<br/><br/><font color=green>Login Successful</font>")
EnableTurnScript (CHATROOM1)
}
}


Then, when you're moved into the PM room, this is the code before you enter the room:
DisableTurnScript (CHATROOM1)


It should be simple, right? I'm not sure where I'm going wrong here. I've moved the disable code all around and nothing is working. I also have it clear the screen and change the background when you move rooms, and that works fine. It's only the turn script that won't disable.

Thanks!

XanMag
15 Feb 2016, 21:51
This is probably the blind trying to lead the blind here, but I think (if I understand TS's correctly)... that once a turnscript has fired it will fire to completion. Disabling a TS only works when it is at the end of the TS or it prevents it from firing (again). With some "Jay- help" I had a similar situation. It's painful for me to revisit, so I won't :lol: I'll just offer you this. I think I had to nest 'IF' scripts within a turnscript to constantly check if a flag was set. If it was, it stopped running, and if it wasn't it kept running. Something like that.

Not sure if that helps at all. Here is the thread - viewtopic.php?f=10&t=5141&p=36247&hilit=turnscript#p36247

If you search my posts specifically, there are several threads in there with similar content. Just search turnscript in the search box.

Hopefully that will get you started until someone more code-capable comes along to help!

jaynabonne
17 Feb 2016, 12:17
The only thing I can think of is that you're either enabling the turn script somewhere else or you have two turnscripts (or some other code) doing the same thing as what's in your turn script. You could double-check that the name matches, but I would think it would give an error if you tried to disable a non-existent turn script.

If no joy, posting the code so we can look at it would be a big help!