5 August, 2020 | 18:32
You are here:  / soft / How to use the “Delayed XDCC SEND request” script for Kvirc 4.2.0
dd script - featured v004

How to use the “Delayed XDCC SEND request” script for Kvirc 4.2.0

post by related

related post

What and why

This is a Kvirc script that Sends a delayed XDCC send request.
This is a slightly modified version of the script from http://www.kvirc.ru/forum/?topic=1070.0
Changes I made:
I will use “/dd” instead of “/xdccdelay” (which stands for delayed download) so it will be more convenient to type. I also added more helpful echo messages.
You may find this script useful when you are trying to download a bunch of files on a channel that does not support XDCC BATCH command.
BUT keep in mind the script limitation: there can be only single running instance of ‘dd’ at the same time.
SO, if you will type
/dd 1 RandomChannel|RandomJoeBot 644     (which will send “/msg RandomChannel|RandomJoeBot xdcc send #644” after 1 minute)
and lets say after 10 seconds you will type
/dd 1 RandomChannel|RandomJoeBot 645     (which will send “/msg RandomChannel|RandomJoeBot xdcc send #645” after 1 minute)
then after 1 minute the 645 file will start to download and 644 file never will. Because the second /dd command will overwrite the first one. The only exception to this is “/dd 0″… when the command will execute immediately (“start download in 0 minutes”), so you can use the next /dd command right after this one.
In short: /dd gives you ONE delayed (“xdcc send”) download command .

And now the tutorial itself… So you will know how to get this script to work, and not like silly me, spend 5 hours on Kvirc coding guide just to understand how to use this script.
You may also find this tutorial useful if you are looking for general information on how to use Kvirc script written by someone else. (If no clear instruction was provided).

How to use the “Delayed XDCC SEND request” Kvirc script

Start your Kvirc (I am using v.4.2.0). And open the “Alias Editor”:
dd script (1) - v2
Now, right mouse click anywhere in “Alias” list and select “Add Alias”:dd script (2)
…the prompt will appear saying “please enter the name for the new alias” – type “dd” without the quotes and press OK:
(Side note: if you want to call the script by something different than /dd then you can type that word instead in “Add Alias” prompt. Just make sure that that word is not already in use – it should not be present in “Alias” list).dd script (3)
The “dd” will appear in the Alias list and you will be “inside of it”. Make sure it says “Alias: dd” above the black field, if not – then you need to select the “dd” in the “Alias” list.
You need to copy the script text inside the empty black field. (the script itself is below.)
dd script (4)
The script itself:
Copy the following code below:
(Or instead of copying: you can download this kvs file: dd-delayed-download-xdcc-send.kvs. Then add it via button “Options”->”Open…” that is located below the black field.)

# Now type in either Channel or Server chat window:
# /dd <int:delay in minutes> <string:bot> <int:package number>
# like this:
# /dd 1 RandomChannel|RandomJoeBot 644
# You can type /dd in any Channel or Server chat window.
# You can also type 0 (0 minutes) to start the download right now.

# ('dd' - stands for delayed download).

# Check for correct syntax
%go = 1
if (($isnumeric($0))!=1)     %go=0;
if ($str.len($1)<1)        %go=0;
if (($isnumeric($2))!=1)     %go=0;

    %delay = $($0*60*1000);    # converts minutes to miliseconds
    # some feedback
    echo "|"time = $0"min" = %delay"ms"
    echo "|"bot = $1
    echo "|""package number = "$2

    timer -s (dd,%delay,$1,$2)
        %botname = $0
        %packnum = $1
        %aaceptval = $option(boolAutoAcceptDccSend)
        echo %aaceptval
        if (%aaceptval==0)
            option boolAutoAcceptDccSend 1;            #allow all dcc
            echo ">>" boolAutoAcceptDccSend 1
        privmsg %botname XDCC SEND %packnum;        #send dcc request
        if (%aaceptval==0)
            killtimer -q aaccept
            timer -s (aaccept, 60000)
            {                            #wait 60 seconds
                option boolAutoAcceptDccSend 0;        #disable allow all dcc
                echo ">>" boolAutoAcceptDccSend 0
            echo "> Auto-Accept TIMER INITIALISED"
    echo DONE
    echo "> dd TIMER INITIALISED"
} else {
    echo "dd: wrong syntax. Correct one is: /dd <integer:delay in minutes> <string:bot> <integer:package number>"
    echo "For example, you have to type something like:"
    echo "/dd 1 RandomChannel|RandomJoeBot 644"
# End of the script.

Now the code of the script should be inside of the black field. Press OK to save our “dd” script and close the “Alias Editor”:dd script (5)
In case it didn’t close automatically, you can close it yourself. Right click on “Alias Editor” and select “Close”:dd script (6)

This is where you are done and can start using /dd in the chat window, and just like your “XDCC SEND” – either Channel or Server chat window will do:
dd script (7)So, instead of
/msg ChannelName|BotName #644    you will type
/dd 5 ChannelName|BotName 644      to send the download request in 5 minutes.


Final thoughts

You wouldn’t have to do any of that if the bots of the Channel would support the “xdcc batch”. If they don’t – you can assume that the bots use the old version of iroffer and thus do not support newer functions such as xdcc batch that the improved version has.