]> jfr.im git - irc/kvirc/kvirc-scripts.git/commitdiff
Monster Slap: add optional reslap OnHighlight Event and fix some errors
authorun1versal <redacted>
Sun, 4 Oct 2015 16:05:15 +0000 (17:05 +0100)
committerun1versal <redacted>
Sun, 4 Oct 2015 16:05:15 +0000 (17:05 +0100)
monster-slap/Readme.txt
monster-slap/reslap.kvs [new file with mode: 0644]
monster-slap/slap.kvs

index 3484f35535f336bb52f554ad403e0be9f143cd4b..b6cf5653b81d4b8967adb39a79576a2e74af1417 100644 (file)
@@ -3,28 +3,45 @@
 +------------------------+\r
 \r
 This is a monster slap script.\r
-It randomises the entries of 6 arrays to give a slightly different slap each time.\r
+It add an alias called slap to KVIrc.\r
+This alias randomizes the multiple variables of 6 arrays to give a slightly different slap each time.\r
 \r
 This is the culmination of a couple of KVIrc fans getting together to produce this.\r
 \r
+Since version 1.0.3 it includes a reslap event and ability to slap self.\r
+\r
+The reslap event is a OnHighlight event that catches known list of trigger words.\r
+The reslap event is protected to avoid endless loops between 2 users with reslap active.\r
+It only reslaps once over a certain period.\r
+\r
+Currently you can use the slap alias on its own without needing to use reslap.\r
+This is why it is provided as a separate file to give you the choice.\r
+\r
+Slapping self is equally as fun, because we all feel like it sometimes.\r
+\r
 +------------------------+\r
 + Installation in KVIrc. +\r
 +------------------------+\r
 \r
-Download the slap.kvs anywhere you like.\r
+Download the slap.kvs and reslap.kvs anywhere you like.\r
 \r
 1 - Open Execute script.\r
-2 - Navigate to directory where you have the slap.kvs\r
-3 - Select script and Click OK.\r
-4 - Open Aliases and confirm you have an Alias names Slap.\r
+2 - Navigate to directory where you have the slap.kvs reslap.kvs\r
+3 - Select a script and Click OK.\r
+4 - Rinse and repeat for other file.\r
+5 - Open Aliases Editor and confirm you have an Alias names slap.\r
+    Then open the Event Editor Find  OnHighlight and veryfy you have a reslap handler.\r
+\r
+Enjoy and use wisely and sparingly.\r
 \r
 +------------------------+\r
 +          Usage         +\r
 +------------------------+\r
 \r
  $ /slap <nick>\r
+ $ /slap self\r
 \r
-For more other usage type:\r
+For usage type:\r
 \r
  $ /slap\r
 \r
diff --git a/monster-slap/reslap.kvs b/monster-slap/reslap.kvs
new file mode 100644 (file)
index 0000000..5f19573
--- /dev/null
@@ -0,0 +1,17 @@
+event(OnHighlight,reslap){\r
+%actions = $array("caresses","drags","kicks","kicks","hits","pushes","sacrifices","slaps","throws","whips")\r
+%count = %actions[]#\r
+\r
+if($0 == me){return;}\r
+if(($5 == 32) && (%RESLAP == 0)){\r
+       for(%i=0;%i<%count;%i++){\r
+               %theslap = $str.stripcolors($3)\r
+               if($str.contains(%theslap,%actions[%i],0)){\r
+                       %RESLAP = 1\r
+                       slap $0\r
+                       timer -s (delayslap, 8000)\r
+                       unset %RESLAP\r
+               }\r
+       }\r
+}\r
+}
\ No newline at end of file
index a6446c96760a884b745c77f41d554fe8b44fc695..3112406f32d951f8aaf446f52e8fb2b47557aece 100644 (file)
@@ -1,9 +1,9 @@
 alias(slap)
 {
        %nick = $0
-       %self = "own ass"
+       %self = "own self"
        %name = "Monster slap"
-       %version = "1.0.2"
+       %version = "1.0.3"
 
        if ($0 == self)
        {
@@ -27,7 +27,7 @@ alias(slap)
        %times[2] = "several times"
        %times[3] = "twice"
        %times[4] = "three times"
-       %b = $rand(5)
+       %b = $rand(4)
        %ntimes = %times[%b]
 
        %location[0] = "in the room,"
@@ -115,4 +115,7 @@ alias(slap)
        }
        else
                me %vaction %nick %ntimes %vwhere %vlocation %vwith %vslap
+               %RESLAP = 1
+               timer -s (delayreslap,5000)
+               %RESLAP = 0
 }
\ No newline at end of file