From 20df2abc1aca00d6aa5dc78347133890f36b32f3 Mon Sep 17 00:00:00 2001 From: Saulc Date: Sat, 13 Jan 2018 20:50:42 +0100 Subject: Initial commit --- npc/test/test1.txt | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 npc/test/test1.txt (limited to 'npc/test/test1.txt') diff --git a/npc/test/test1.txt b/npc/test/test1.txt new file mode 100644 index 000000000..a6e6d4b94 --- /dev/null +++ b/npc/test/test1.txt @@ -0,0 +1,76 @@ +// Evol scripts. +// Author: +// 4144 +// Description: +// script tests + +function script test1function { + .var = .walkmask; + if (.var != 3) + mes "Error: testing test1 npc variables from function."; + .var = getvariableofnpc(.walkmask, "test1"); + if (.var != 3) + mes "Error: testing test1 npc variables from function."; + .var = getvariableofnpc(.walkmask, "test2"); + if (.var != 4) + mes "Error: testing test2 npc variables from function."; + + return; +} + +test,10,5,0 script test1 NPC_HAT_BOX,{ + mes "Npc vars testing..."; + .var = .walkmask; + if (.var != 3) + mes "Error: testing test1 npc variables."; + .var = getvariableofnpc(.walkmask, "test1"); + if (.var != 3) + mes "Error: testing test1 npc variables from function."; + .var = getvariableofnpc(.walkmask, "test2"); + if (.var != 4) + mes "Error: testing test2 npc variables."; + test1function; + mes "Formatting testing..."; + if (l("test @@", "") != "test ") + mes "Error: format string 'l(\"test @@\", \"\")': " + l("test @@", ""); + if (l("test @@", "1") != "test 1") + mes "Error: format string 'l(\"test @@\", \"1\")': " + l("test @@", "1"); + if (l("@@", "") != "") + mes "Error: format string 'l(\"@@\", \"\")': " + l("@@", ""); + if (l("@@") != "@@") + mes "Error: format string 'l(\"@@\")': " + l("@@"); + if (l("@@ @@ @@", "this", "is", "test") != "this is test") + mes "Error: format string 'l(\"@@ @@ @@\", \"this\", \"is\", \"test\") != \"this is test\"': " + l("@@ @@ @@", "this", "is", "test"); + if (l("data @@ @@ @@ data", "this", "is", "test") != "data this is test data") + mes "Error: format string 'l(\"data @@ @@ @@ data\", \"this\", \"is\", \"test\")': " + l("data @@ @@ @@ data", "this", "is", "test"); + mes "Quest vars testing..."; + .@time = 1000; + setq Test_testing1, 1, 2, 3, .@time; + if (getq(Test_testing1) != 1) + mes "Error: quest variable 1 error. Must be 1, but get " + str(getq(Test_testing1)); + if (getq2(Test_testing1) != 2) + mes "Error: quest variable 2 error. Must be 2, but get " + str(getq(Test_testing1)); + if (getq3(Test_testing1) != 3) + mes "Error: quest variable 3 error. Must be 3, but get " + str(getq(Test_testing1)); + if (getqtime(Test_testing1) != .@time) + mes "Error: quest variable 3 error. Must be 3, but get " + str(getqtime(Test_testing1)); + next; + .@time = 2000; + setq Test_testing1, 2, 3, 4, .@time; + if (getq(Test_testing1) != 2) + mes "Error: quest variable 1 error. Must be 2, but get " + str(getq(Test_testing1)); + if (getq2(Test_testing1) != 3) + mes "Error: quest variable 2 error. Must be 3, but get " + str(getq(Test_testing1)); + if (getq3(Test_testing1) != 4) + mes "Error: quest variable 3 error. Must be 4, but get " + str(getq(Test_testing1)); + if (getqtime(Test_testing1) != .@time) + mes "Error: quest variable 3 error. Must be 3, but get " + str(getqtime(Test_testing1)); + next; + setq Test_testing1, 0; + mes "Tests complete."; + close; + +OnInit: + .walkmask = 3; + end; +} -- cgit v1.2.3-70-g09d2