- Instead of using keypress detection for "[ENTER]" to check if the chat box is open, a specific EUD checks if the chat box is open.
0x0068C144 governs whether the chat box will open or close when the user next presses enter, can be used to check whether the chat box is open or closed.
Oh good, I'm glad you started using that; I was disappointed to see detection for the enter key.
If you think it will be a serious issue than you can certainly add some kind of false positive protection; my previous way of doing so was to have the system track the number of spaces used, and the number of backspaces used... if the number of spaces exceeded the number of backspaces, the map would stop listening for key-presses (/, d, r, and o) until the number of spaces fell below 1+backspaces again, or until he pressed enter/esc to clear the current chat window.
I would certainly have the space/backspace check in the system.
btw i started doing this map like 5 hours ago and i already added space and backspace trigger
it looks if u hit backspace it clear 1 switch coz i made it under switch not under death.
No... Don't implement detecting backspace... It's a bad idea...
Here's a system implementing backspace, if you're really so concerned about false-positives:
Trigger("Player 8"){
Conditions:
Memory(264056, At least, 1);
Memory(334764, Exactly, 0);
Memory(12764, Exactly, 16777216);
Deaths("Current Player", "Cantina", At least, 1);
Actions:
Set Deaths("Current Player", "Cave", Add, 1);
Preserve Trigger();
Comment("Debt");
}
//-----------------------------------------------------------------//
Trigger("Player 8"){
Conditions:
Memory(264056, At least, 1);
Memory(334764, Exactly, 0);
Memory(12734, Exactly, 1);
Deaths("Current Player", "Cantina", Exactly, 0);
Actions:
Set Deaths("Current Player", "Cave", Add, 1);
Preserve Trigger();
Comment("Debt");
}
//-----------------------------------------------------------------//
Trigger("Player 8"){
Conditions:
Memory(264056, At least, 1);
Memory(334764, Exactly, 0);
Memory(12734, Exactly, 1);
Deaths("Current Player", "Cantina", At least, 2);
Actions:
Set Deaths("Current Player", "Cave", Add, 1);
Preserve Trigger();
Comment("Debt");
}
//-----------------------------------------------------------------//
Trigger("Player 8"){
Conditions:
Memory(264056, At least, 1);
Memory(334764, Exactly, 0);
Memory(12737, Exactly, 65536);
Deaths("Current Player", "Cantina", At most, 1);
Actions:
Set Deaths("Current Player", "Cave", Add, 1);
Preserve Trigger();
Comment("Debt");
}
//-----------------------------------------------------------------//
Trigger("Player 8"){
Conditions:
Memory(264056, At least, 1);
Memory(334764, Exactly, 0);
Memory(12737, Exactly, 65536);
Deaths("Current Player", "Cantina", At least, 3);
Actions:
Set Deaths("Current Player", "Cave", Add, 1);
Preserve Trigger();
Comment("Debt");
}
//-----------------------------------------------------------------//
Trigger("Player 8"){
Conditions:
Memory(264056, At least, 1);
Memory(334764, Exactly, 0);
Memory(12736, Exactly, 16777216);
Deaths("Current Player", "Cantina", At most, 2);
Actions:
Set Deaths("Current Player", "Cave", Add, 1);
Preserve Trigger();
Comment("Debt");
}
//-----------------------------------------------------------------//
Trigger("Player 8"){
Conditions:
Memory(264056, At least, 1);
Memory(334764, Exactly, 0);
Memory(12736, Exactly, 16777216);
Deaths("Current Player", "Cantina", At least, 4);
Actions:
Set Deaths("Current Player", "Cave", Add, 1);
Preserve Trigger();
Comment("Debt");
}
//-----------------------------------------------------------------//
Trigger("Player 8"){
Conditions:
Memory(264056, Exactly, 0);
Actions:
Set Deaths("Current Player", "Cantina", Set To, 0);
Set Deaths("Current Player", "Cave", Set To, 0);
Preserve Trigger();
Comment("Player isn't typing");
}
//-----------------------------------------------------------------//
Trigger("Player 8"){
Conditions:
Memory(264056, At least, 1);
Memory(334764, Exactly, 0);
Memory(12764, Exactly, 16777216);
Deaths("Current Player", "Cantina", Exactly, 0);
Deaths("Current Player", "Cave", Exactly, 0);
Actions:
Set Deaths("Current Player", "Cantina", Add, 1);
Preserve Trigger();
Comment("First character pressed is '/'");
}
//-----------------------------------------------------------------//
Trigger("Player 8"){
Conditions:
Memory(264056, At least, 1);
Memory(334764, Exactly, 0);
Memory(12734, Exactly, 1);
Deaths("Current Player", "Cantina", Exactly, 1);
Deaths("Current Player", "Cave", Exactly, 0);
Actions:
Set Deaths("Current Player", "Cantina", Add, 1);
Preserve Trigger();
Comment("Second character pressed is 'd'");
}
//-----------------------------------------------------------------//
Trigger("Player 8"){
Conditions:
Memory(264056, At least, 1);
Memory(334764, Exactly, 0);
Memory(12737, Exactly, 65536);
Deaths("Current Player", "Cantina", Exactly, 2);
Deaths("Current Player", "Cave", Exactly, 0);
Actions:
Set Deaths("Current Player", "Cantina", Add, 1);
Preserve Trigger();
Comment("Third character is 'r'");
}
//-----------------------------------------------------------------//
Trigger("Player 8"){
Conditions:
Memory(264056, At least, 1);
Memory(334764, Exactly, 0);
Memory(12736, Exactly, 16777216);
Deaths("Current Player", "Cantina", Exactly, 3);
Deaths("Current Player", "Cave", Exactly, 0);
Actions:
Set Deaths("Current Player", "Cantina", Add, 1);
Preserve Trigger();
Comment("Fourth character is 'o'");
}
//-----------------------------------------------------------------//
Trigger("Player 8"){
Conditions:
Memory(264056, At least, 1);
Memory(334764, Exactly, 0);
Memory(12719, Exactly, 1);
Deaths("Current Player", "Cave", Exactly, 0);
Actions:
Set Deaths("Current Player", "Cantina", Subtract, 1);
Preserve Trigger();
Comment("Backspace");
}
//-----------------------------------------------------------------//
Trigger("Player 8"){
Conditions:
Memory(264056, At least, 1);
Memory(334764, Exactly, 0);
Memory(12719, Exactly, 1);
Deaths("Current Player", "Cave", At least, 1);
Actions:
Set Deaths("Current Player", "Cave", Subtract, 1);
Preserve Trigger();
Comment("Backspace");
}
//-----------------------------------------------------------------//
Followed by every key you can press, which would add 1 to the debt (Cave).
Basically, the system has a death counter for the current stage (Stage 1 = "/," Stage 2 = "/d," Stage 3 = "/dr," and Stage 4 = "/dro"). If you type something that isn't part of the sequence, you incur "debt" stored in another death counter. When you press backspace, it decrements your debt if you have any, and then decrements on the stage progress (since you'd be deleting characters from the detecting string at that point). Therefore, you can type "/sdkfasdfkalks" at first and then delete everything until the forward slash and the system would know that if you type a "D" next, you'll be progressing forward to type the "/dro" sequence. This removes any chance of false positives and prevents hackers from tricking the system, right?
It sounds like a nice system, but it doesn't work at all in implementation. The reason for this is because when a player presses a key, one of three things happen:
- The key is released before being detected at all
- The key is released after being detected once
- The key is released after being detected multiple times
That is, if you press the "/" key, the EUD detection can actually miss it, or it can detect it twice or more. This greatly reduces the integrity of detecting a string of characters to the point of making a safe system pointless.
If you don't understand the technical jargon and/or want to see the implementation fail in action, I've attached a map with a wonderful debugging system built into it to illustrate why this is such a bad idea.
Attachments: