From a6d58bb6052ac8cb01805a48c4ad2f129126116f Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 24 Feb 2010 02:13:59 +0000 Subject: Added KDE3 version of kvirc git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1095341 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- doc/scriptexamples/Makefile.am | 7 + doc/scriptexamples/README | 6 + doc/scriptexamples/antiidle/Makefile.am | 5 + doc/scriptexamples/antiidle/antiidle.kvs | 159 ++++++++++++++++ doc/scriptexamples/class1.kvs | 102 ++++++++++ doc/scriptexamples/exprtest.kvs | 24 +++ doc/scriptexamples/label1.kvs | 39 ++++ doc/scriptexamples/mail.kvs | 159 ++++++++++++++++ doc/scriptexamples/minesweeper/Makefile.am | 5 + doc/scriptexamples/minesweeper/minesweeper.kvs | 131 +++++++++++++ doc/scriptexamples/mp3_kdemediaplayers.kvs | 206 ++++++++++++++++++++ doc/scriptexamples/mp3info.kvs | 109 +++++++++++ doc/scriptexamples/mp3share/Makefile.am | 5 + doc/scriptexamples/mp3share/mp3share.kvs | 84 ++++++++ doc/scriptexamples/mp3share/mp3share_icon.png | Bin 0 -> 1828 bytes doc/scriptexamples/newkvstest.kvs | 101 ++++++++++ doc/scriptexamples/playing/Makefile.am | 5 + doc/scriptexamples/playing/playing.kvs | 108 +++++++++++ doc/scriptexamples/playing/playing_icon.png | Bin 0 -> 1487 bytes doc/scriptexamples/popup1.kvs | 17 ++ doc/scriptexamples/popup2.kvs | 124 ++++++++++++ doc/scriptexamples/popup3.kvs | 46 +++++ doc/scriptexamples/popup4.kvs | 40 ++++ doc/scriptexamples/relay.kvs | 33 ++++ doc/scriptexamples/runmenu/Makefile.am | 5 + doc/scriptexamples/runmenu/runmenu.kvs | 111 +++++++++++ doc/scriptexamples/signal1.kvs | 47 +++++ doc/scriptexamples/simplehttp/Makefile.am | 5 + doc/scriptexamples/simplehttp/simplehttp.kvs | 105 ++++++++++ doc/scriptexamples/socket1.kvs | 45 +++++ doc/scriptexamples/srfs.kvs | 42 ++++ doc/scriptexamples/switchstress.kvs | 46 +++++ doc/scriptexamples/timer1.kvs | 25 +++ doc/scriptexamples/tutorial/Makefile.am | 5 + doc/scriptexamples/tutorial/minesweeper1.kvs | 78 ++++++++ doc/scriptexamples/tutorial/minesweeper2.kvs | 93 +++++++++ doc/scriptexamples/tutorial/minesweeper3.kvs | 147 ++++++++++++++ doc/scriptexamples/tutorial/minesweeper4.kvs | 187 ++++++++++++++++++ doc/scriptexamples/tutorial/minesweeper5.kvs | 201 +++++++++++++++++++ doc/scriptexamples/tutorial/minesweeper6.kvs | 254 +++++++++++++++++++++++++ doc/scriptexamples/tutorial/minesweeper7.kvs | 253 ++++++++++++++++++++++++ doc/scriptexamples/widget1.kvs | 20 ++ doc/scriptexamples/widget2.kvs | 23 +++ 43 files changed, 3207 insertions(+) create mode 100644 doc/scriptexamples/Makefile.am create mode 100644 doc/scriptexamples/README create mode 100644 doc/scriptexamples/antiidle/Makefile.am create mode 100644 doc/scriptexamples/antiidle/antiidle.kvs create mode 100644 doc/scriptexamples/class1.kvs create mode 100644 doc/scriptexamples/exprtest.kvs create mode 100644 doc/scriptexamples/label1.kvs create mode 100644 doc/scriptexamples/mail.kvs create mode 100644 doc/scriptexamples/minesweeper/Makefile.am create mode 100644 doc/scriptexamples/minesweeper/minesweeper.kvs create mode 100644 doc/scriptexamples/mp3_kdemediaplayers.kvs create mode 100644 doc/scriptexamples/mp3info.kvs create mode 100644 doc/scriptexamples/mp3share/Makefile.am create mode 100644 doc/scriptexamples/mp3share/mp3share.kvs create mode 100644 doc/scriptexamples/mp3share/mp3share_icon.png create mode 100644 doc/scriptexamples/newkvstest.kvs create mode 100644 doc/scriptexamples/playing/Makefile.am create mode 100644 doc/scriptexamples/playing/playing.kvs create mode 100644 doc/scriptexamples/playing/playing_icon.png create mode 100644 doc/scriptexamples/popup1.kvs create mode 100644 doc/scriptexamples/popup2.kvs create mode 100644 doc/scriptexamples/popup3.kvs create mode 100644 doc/scriptexamples/popup4.kvs create mode 100644 doc/scriptexamples/relay.kvs create mode 100644 doc/scriptexamples/runmenu/Makefile.am create mode 100644 doc/scriptexamples/runmenu/runmenu.kvs create mode 100644 doc/scriptexamples/signal1.kvs create mode 100644 doc/scriptexamples/simplehttp/Makefile.am create mode 100644 doc/scriptexamples/simplehttp/simplehttp.kvs create mode 100644 doc/scriptexamples/socket1.kvs create mode 100644 doc/scriptexamples/srfs.kvs create mode 100644 doc/scriptexamples/switchstress.kvs create mode 100644 doc/scriptexamples/timer1.kvs create mode 100644 doc/scriptexamples/tutorial/Makefile.am create mode 100644 doc/scriptexamples/tutorial/minesweeper1.kvs create mode 100644 doc/scriptexamples/tutorial/minesweeper2.kvs create mode 100644 doc/scriptexamples/tutorial/minesweeper3.kvs create mode 100644 doc/scriptexamples/tutorial/minesweeper4.kvs create mode 100644 doc/scriptexamples/tutorial/minesweeper5.kvs create mode 100644 doc/scriptexamples/tutorial/minesweeper6.kvs create mode 100644 doc/scriptexamples/tutorial/minesweeper7.kvs create mode 100644 doc/scriptexamples/widget1.kvs create mode 100644 doc/scriptexamples/widget2.kvs (limited to 'doc/scriptexamples') diff --git a/doc/scriptexamples/Makefile.am b/doc/scriptexamples/Makefile.am new file mode 100644 index 00000000..a63d4435 --- /dev/null +++ b/doc/scriptexamples/Makefile.am @@ -0,0 +1,7 @@ +############################################################################### +# KVirc IRC client Makefile - 16.12.98 Szymon Stefanek +############################################################################### + +SUBDIRS = antiidle minesweeper mp3share playing runmenu simplehttp tutorial + +EXTRA_DIST = *.kvs diff --git a/doc/scriptexamples/README b/doc/scriptexamples/README new file mode 100644 index 00000000..be35ddce --- /dev/null +++ b/doc/scriptexamples/README @@ -0,0 +1,6 @@ +This directory and the subdirectories contain a set of KVIrc scripting examples/tests. + +The *.kvs files in this directory are mostly tests written while implementing scripting +language features. They're rather simple (but also useless) so you can use them to learn basic scripting :) + +The subdirectories contain more complex scripts written with the demonstration purpose. diff --git a/doc/scriptexamples/antiidle/Makefile.am b/doc/scriptexamples/antiidle/Makefile.am new file mode 100644 index 00000000..840a6b4e --- /dev/null +++ b/doc/scriptexamples/antiidle/Makefile.am @@ -0,0 +1,5 @@ +############################################################################### +# KVirc IRC client Makefile - 16.12.98 Szymon Stefanek +############################################################################### + +EXTRA_DIST = antiidle.kvs diff --git a/doc/scriptexamples/antiidle/antiidle.kvs b/doc/scriptexamples/antiidle/antiidle.kvs new file mode 100644 index 00000000..a4b59cca --- /dev/null +++ b/doc/scriptexamples/antiidle/antiidle.kvs @@ -0,0 +1,159 @@ +# +# anti idle script +# : some people like it, some people need it +# : by Balboy :)) +# + +# creating the main alias + +alias(aidle) +{ + # using a switch to see what option has been selected + switch($0) + { + # ok, so the script should start + case(start): + { + # checking if it wasn't running already + if(!%Aidlestatus{$ic}) + { + # the script wasn't running already, so it should be started by calling the + # script with the run parameter + aidle internal_run + # saving the status of the anti idle script + %Aidlestatus{$ic} = 1 + # an anti idle var is set, to define the speed of the anti itde script + # there are 2 possible ways + %Aidletype{$ic} = 1 + echo "Anti idle has been enabled" + } else { + # the script was already running + echo "Anti idle has already been enabled on this server" + } + } + break + # the script should be halted + case(stop): + { + # checking if it was already running + if(%Aidlestatus{$ic}) + { + # the script was running, so it should be stopped by killing the timer + killtimer antiidle{$ic} + # clearing variabled + %Aidlestatus{$ic} = "" + %Aidletype{$ic} = "" + echo "Anti idle has been disabled" + } else { + # the script wasn't running + echo "Anti idle has not been enabled on this server" + } + } + break + # the script status should be shown + case(status): + { + # checking the status variable + if(%Aidlestatus{$ic}) + { + echo "anti idle is enabled on this server" + } else { + echo "anti idle is disabled on this server" + } + } + break + # this is a parameter that should only be called by the script itself + # this is where the idle time gets actualy killed + + case(internal_run): + { + # this part will make a varianle to switch random anti idle modes (fast/slow) + # note: once a type has been decided, changing the type works by a small chance + %aidletypecheck{$ic} = $rand(100) + if(%aidletypecheck{$ic} < 10) + { + if(%Aidletype{$ic} == 1) + { + %Aidletype{$ic} = 2 + } else { + %Aidletype{$ic} = 1 + } + } + # use the var just created to start one of the anti idle modes + if(%Aidletype{$ic} == 1){ + # starting a timer who will keep sending messages to yourself, no output will be shown + timer -r=$console -s (antiidle{$ic},$(10000 + $rand(50000))) + { + aidle internal_run + # checking if we are online + if($server) + { + raw -q privmsg $me : + } + } + } else { + # this part is simular as above + timer -r=$console -s (antiidle{$ic},$(10000 + $rand(30000))) + { + aidle internal_run + if($server) + { + raw -q privmsg $me : + } + } + } + } + break + # the script should be uninstalled + case(uninstall): + { + echo "the anti idle script has been uninstalled succesfully" + # defining the alias by empty code will remove it + alias(aidle){} + event(412,aidle){} + + } + break + # if help was asked + case(help): + { + echo "usage: /aidle