Resource icon

Approved AdvancedTester (RecoilTest/JumpTest) 1.6.4

No permission to download

tarynkelley

Retired Staff
Retired Staff
Trusted Member
Nov 14, 2015
575
178
28
Parts Unknown
Python:
if (TestCooldown.ContainsKey(p.UID))
                {
                    var ticks = TestCooldown[p.UID];
                    var calc = System.Environment.TickCount - ticks;
                    var time = TestCooldown[p.UID];
                    if (calc > 0 || !double.IsNaN(calc) || !double.IsNaN(ticks))
                    {
                        var done = Math.Round((float) ((calc/1000)/60));
                        player.MessageFrom("AdvancedTest",
                            "Player has report cooldown for: " + (time - done) + " minutes!");
                        return;
                    }
                    if (calc < (TestAllowedEvery + time)*60000)
                    {
                        var done = Math.Round((float) ((calc/1000)/60));
                        player.MessageFrom("AdvancedTest",
                            "Player has report cooldown for: " + (time - done) + " minutes!");
                        return;
                    }
                }
I dont understand what you want to reach with the time variable.

And specially why it gets added to TestAllowedEvery, its in a wrong format there anyways (time is already in ms).

"Player has report cooldown for: (time - done) What do you try to calculate?


CommandEvent Error: System.Collections.Generic.KeyNotFoundException: The given k
ey was not present in the dictionary.

I think you should use Datastore for this?
 
Last edited:

tarynkelley

Retired Staff
Retired Staff
Trusted Member
Nov 14, 2015
575
178
28
Parts Unknown
OK, I found the real cause why the key cannot be found.

At the succesfull end of the test this will get executed:

else if (dist > 0.10f)
{
player.MessageFrom("AdvancedTest", green + "ButtonTest3 Complete!");
UnderTesting[player.UID].ButtonComplete3 = true;
RemoveTest(player);
Server.GetServer().BroadcastFrom("AdvancedTest", green + player.Name + " passed all auto tests!");
return;
}

RemoveTest actually executes then:

if (TestCooldown.ContainsKey(player.UID))

{

TestCooldown.Remove(player.UID);

}

Therefore the TestCoolDown does not work because this key gets removed at the end of the successful test.


Here is a fix of me, I also rewrote the CoolDown check function.

Also with Sourcecode
 

Attachments

Last edited:

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
Read the code parts and think what I am calculating. I will fix that remove part, thanks for noticing.

Sent From My Samsung Galaxy S4
 

tarynkelley

Retired Staff
Retired Staff
Trusted Member
Nov 14, 2015
575
178
28
Parts Unknown
var time = TestCooldown[p.UID];

if (calc < (TestAllowedEvery + time)*60000)

But isn't time already in ms? Why would you multiply it again with 60000? TestAllowedEvery instead is in min.
 

tarynkelley

Retired Staff
Retired Staff
Trusted Member
Nov 14, 2015
575
178
28
Parts Unknown
How does the Drop Test exactly work? I'm not able to figure it out by the source code.

var timedEvent = CreateParallelTimer(3500, dict);

timedEvent.OnFire += Callback2;

timedEvent.Start();

What exactly is the 3500ms?
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
How does the Drop Test exactly work? I'm not able to figure it out by the source code.

var timedEvent = CreateParallelTimer(3500, dict);

timedEvent.OnFire += Callback2;

timedEvent.Start();

What exactly is the 3500ms?
3,5 secs, just a simple timer to delay the drop test.
 

tarynkelley

Retired Staff
Retired Staff
Trusted Member
Nov 14, 2015
575
178
28
Parts Unknown
So after 3,5 secs after the drop it checks if the player got hurt, right?

How can it be that there are false positives, specially with high pings?
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
So after 3,5 secs after the drop it checks if the player got hurt, right?

How can it be that there are false positives, specially with high pings?
Remember the auto droptest in BannedPeople?

Sometimes people with high pigh were never teleported, teleported too late, or got teleported but didnt receive the damage yet.