SETTING UP OFFERS
mIRC 5.0 Scripting Applets
May 28, 1997
Introduction
Section 1: Setting up the Backbone of your offers
1.1 Setting up an fserver
1.2 Setting up a single pic offer
1.3 Setting up a multiple pic offer
Section 2: Setting up the channel offer timer
2.1 Setting up a single offer and/or timer
2.2 Setting up multiple offers with a timer
Credits
Please turn on Word Wrap in the Edit menu
-----------------------------------------
This document has been edited so it will fit in a standard 640x480 notepad window. I also suggest the mIRC FAQ if you would like to further customize your popups. I have converted Met's original scripts so they will work in mIRC 5.0x. These will NOT work in any OLDER version of mIRC. If you want those I have updated them as well. Just ask me for the 4.7x faq. :)
This FAQ was originally written by Metrol and it has been edited by me so it will be up-to-date, also since Met is a busy guy he originally left out a few things that were important for the complete newbie (as I was when I first got ahold of it). :)
The scripting in this document is all enclosed with lines of '=='. DO NOT copy these into your configuration screens. These are only for your visual aid.
To copy text from this document follow these steps:
1) Mark the text you want to copy with your mouse
2) Press Ctrl-C to copy the text
3) Go to the appropriate config screen in mIRC and press Ctrl-V to paste
Introduction
The purpose of this FAQ is to help you to setup pic offerings and/or and fserver using mIRC whether you're a newbee completely new to mIRC or a hard core mIRC user just looking for some cool, helpful scripts.
Many folks have been asking me over and over again how to set up pic and file offers in our channel. Some of these setups are quite simple, but can be rather intimidating for someone new to mIRC 5.0. This document is not by itself a complete script, but rather a sampling of scripts that you can plug into much of what you already have in place.
As with anything else in life, learn to crawl before you jump up and sprint. Take the time to actually read the mIRC FAQ, and the help file that comes with mIRC. You don't have to be an expert on these documents, but you should at least have some famaliarity with them.
Note: We here at CnM would like you all to keep your popup offers short, sweet, and to the point. Please don't waist vaulable channel space with unnecessary text. Thank you.
** IMPORTANT **
All of these scripts are meant to be used on mIRC Version 5.0. If you are not using this piece of software and this perticular version, none of these scripts will work, nor will I attempt to re-write these so that they will work on older versions. For you Pirch and Mac users out there this document doesn't apply.
Note: These scripts require a combination of what is in Section 1 AND what's in Section 2. Most likely the combination will be either 1.1 with 2.1, 1.2 with 2.1, or 1.3 with 2.2. :)) So each part of Section 1 needs one part of Section 2. :) I suggest you read over all sections so that you get an idea of how everything works.
****************** VERY IMPORTANT ******************
You MUST type "/ctcp on" in order to get these scripts to work. If you do not, when ever a person requests a pic from you, it will not be sent to them and you will go into confusion and scramble back to this FAQ to find out what you did wrong and waist a LOT of time. :) Typing "/ctcp on" (without the quotes) is the equivalent of going to the remote dialog and going to the LISTEN menu and clicking on ctcp. Either of these methods will allow mirc to begin to "listen" to commands by users. :)
****************** VERY IMPORTANT ******************
SECTION 1: SETTING UP THE BACKBONE OF YOUR OFFERS
These are the scripts that will actually send something or do something when a user requests it.
1.1 Setting up an fserver
In order to get mIRC to actually open an fserve with a person when they request it, you need to put a line in any .ini file in the remote section.
In this case we're going to cause a fictional FServer to start up from a trigger phrase sent to you in the form of a CTCP command.
There are a couple of good reasons to use CTCP commands. Instead of triggers that require some text to be typed into the channel the trigger is sent to you privately and is kept out of the channel so everyone doens't have to see it. Most importantly, it gives you a little more control of how things are sent out, you can see all of YOUR requests in your status window instead of sorting through the channel window which is always scrolling up.
I'm going to use the command "!MyServer" and the path "c:\pics" as an EXAMPLE ONLY. It is up to you to edit these to fit just what your offering up.
*** Remotes | ctcp.ini or any other .ini ***
========================================
ctcp 1:!MyServer { fserve $nick 3 c:\pics }
========================================
It's just that easy! Now when a user types /ctcp YourNick !MyServer anywhere in their IRC application, your FServer will open up for that user allowing them to take 3 pics at a time. You can change that '3' to whatever you want, but I've found that 3 at a time doesn't bog me down to badly.
To set up a limit on the number of FServers you wish to run at once, look in DCC Options in mIRC for that. My personal suggestion to you is to not run more than 3 or 4. The reason being is that beyond that you'll start running into bandwidth problems.
Please make sure that the path you specify is correct. If you wish to have a message displayed to the person when they enter your fserver simply put that text in a .txt file and put c:\path\file.txt after the path for the fserve dir itself.
1.2 Setting up a single pic offer
This script is for sending a single file to a user when they send you a ctcp trigger command.
I'm going to use the phrase "!MyPic", the path "c:\pics", and a file called "mypic.jpg" as an EXAMPLE ONLY. It is up to you to edit these to fit just what your offering up.
*** Remotes | ctcp.ini or any other .ini ***
========================================
ctcp 1:!MyPic { dcc send $nick c:\pics\mypic.jpg }
========================================
When a user types /ctcp YourNick !MyPic, mypic.jpg will automatically be sent to that person. You can set as many of these up as you like. Just keep in mind that you need to update the trigger phrase, the path and filename on each of these.
1.3 Setting up a multiple pic offer
This script is designed to send out large zip file collections one at a time, or to control sending out jpgs so that ppl can only get file at a time. It utilizes the random pic offering described in Section 2 of this document as well as a portion of Section 1.2. For this reason I would encourage you to at least read over those parts so you have some idea of what's going on here. However if you are a fast study you don't need to. :)
********* PAY ATTENTION *********
This script can only deal with one kind of file type at a time. If you wish to use this to offer jpg's, gif's, and zip's you'll have to set this thing up 3 different times in your remotes, with three DIFFERENT prefixes. For example "!RiDDZip", "!RiDDJpg", etc...That's primarily why you've only seen me offer jpgs using this.
This will display a random offering in the channel that you are on. These offerings will be displayed every 5 minutes after you type "/picson" (without the quotes). To turn the offerings off, simply type "/picsoff" (without the quotes).
The bit for the remotes will only allow one file at a time to go to each person. If someone tries to get more than 1 file from you at a time, it politely reminds them that you're not about to do that with large files and/or poor bandwidth. If a person has requested a file and they all ready had one going but the send has timed out or not gone through it will cancel the one they had going and send the new one they are requesting. If a person asks for a file that you don't have, it will inform the user of this. This is all done via /notice commands so neither the channel, nor anyone's msg box is flooded with junk.
It requires that the zip file name be the name of the trigger. If the file doesn't exist, the user is notified.
For example: /ctcp Riddler !RiDD MyPics
In order for that to work, there must be a "mypics.zip" file sitting in the path you will define.
Once again, for example purposes, "c:\pics" will be used as the path. In addition, I put in there 4 different sample offerings to be displayed. This will be up to you to change all these things up to suit your needs. Please reference back to the earlier sections of this document to see how this is done.
Good luck with it!
*** Alias ***
========================================
;
;----- Multiple Pic Requests
;
/picon {
.enable #picoffers
timer3 0 300 $!read c:\pics\collect.txt
}
/picoff {
.disable #picoffers
timer3 off
}
;
;----- Example Offers
;
/mypic /me has a great pic, type /ctcp $me !trigger mypic
/somepic /me has an okay pic, type /ctcp $me !trigger okaypic
/fabpic /me has a fabulous pic, type /ctcp $me !trigger FabPic
/coolpic /me has a cool pic, type /ctcp $me !trigger Cool
========================================
--------------------------------------------------------
/picon {
timer5 0 300 $!read c:\pics\pics.txt
}
--------------------------------------------------------
- Please make SURE of your path.
NOTE: For and explination of this alias please see section 2.2...and you WILL need an explaintion. :)
*** Pop-ups | View | Channel ***
========================================
Pic Offerings
.Pics On:/picon
.Pics Off:/picoff
========================================
If you want to be able to start your timer/offers by right clicking in the channel window put the above where is says.
** Text file called c:\pics\pics.txt **
========================================
/mypic
/somepic
/fabpic
/coolpic
========================================
This txt file is necessary for the timer to function properly, once again..please see section 2.2 for an explaintion of now it works.
*** Remotes | ctcp.ini or any other .ini ***
========================================
;
;------- Mutliple Pic Offerings
;
#picoffers on
ctcp 1:!trigger: {
set %filename c:\pics\ $+ $2 $+ .zip
if ($exists(%filename) == $false) {
notice $nick I'm sorry, but I the trigger $1- is not valid. Please check the trigger that you typed and try again.
goto end
}
%i = 0
:rep
inc %i 1
if (%i > $send(0)) {
dcc send $nick %filename
notice $nick Your request for $1- is en route!
goto end
}
if ($send(%i) == $nick) {
if ($send(%i).status == waiting) {
notice $nick Your current send for $send(%i).file is currently inactive therefore it has been cancelled. New send for $1- is en route.
close -s $send(%i)
dcc send $nick %filename
goto end
}
else {
notice $nick hmm...apparently I am all ready sending you the file $send(%i).file $+ , please allow that to finish up and then make your request for $1- again. :)
ignore -tu60 $nick 2
goto end
}
}
goto rep
:end
unset %i %filename
}
#picoffers end
========================================
*** IMPORTANT ***
There are some lines you need to change in order for this to work on YOUR system. After you copy and paste this into your configuration screens, make sure you make the following changes!
--------------------------------------------------------
ctcp 1:!Trigger: {
--------------------------------------------------------
- You need to change the "!Trigger" to whatever you want for a prefix to your command. For example, Yogurt uses "!Yog" for his and Metrol uses "!Met" for his.
--------------------------------------------------------
set %filename c:\pics\ $+ $2 $+ .zip
--------------------------------------------------------
- Make sure the path is correct for where your storing your zip files to be offered. Make sure to add the extra '\' on the end of the path.
SECTION 2: SETTING UP THE CHANNEL OFFER TIMER
2.1 Setting up a single offer and/or timer
The following script is to be used when you wish to put up only one offer to the channel. This offer will display every 300 seconds or 5 minutes once started. The reason I chose 5 minutes here is that any less gets to be real annoying for everyone in the channel, and any more won't keep you active on most servers if you have no other activity going on at the time.
This script will begin when you type "/offeron" (without the quotes) in any active window in mIRC. At first you should only see an internal message from mIRC saying that you've activated a timer. Your offer will appear 5 minutes after that, and will repeat every 5 minutes for as long as you are connected to IRC. You can turn this off at any time by typing "/offeroff".
*** Alias ***
========================================
;
;----- Single Pic Offering
;
/offeron {
timer1 0 300 describe (channel) The Text Of My Offer
}
/offeroff {
timer1 off
}
========================================
Instructions on modifying the script, which is necessary for it to work:
-----------------------------------------------------------------------
timer1 0 300 describe (channel) Text Of Your Offer
-----------------------------------------------------------------------
In the above statement the 'timer1' is the timer ID number (you can use any number you want but only one timer can use each number)
The '0' means it will not terminate after a certain number of times. If you want the timer to shut off after it has repeated a certain number if times enter the number you want.
The '300' is the time, in seconds, between repeats. In other words, it will repeat every 300 seconds or 5 minutes.
The 'describe (channel)' is the command that will be be performed when the timer repeats. The command 'describe' will do an action to (channel) which is the same thing as '/me'. It is better to use 'describe (channel)' because you can set up your timer to startup automatically when you first connect and you will need to use 'describe (channel)'. If you wish your offer to go to ALL channels instead of just (channel) simply use 'ame' instead of 'describe (channel)'.
The 'Text Of Your Offer" is what you want to say in the action, for example, if I put "has a cool pic, type /ctcp $!me !CoolPic to get it." Then this would show up in the channel looking like this:
* Someone has a cool pic, type /ctcp Someone !CoolPic to get it.
Now you might be saying, "What's that '$!me' thing?!? Well the $!me is called an identifier and it will "fill-in" with your current nickname when the timer excutes.
Note: if you are running a timer you should use $!me, if you are not running a timer and just a plain offer you should use $me
To set this up in a Pop-Up menu simply add the following lines into your config. Please note that you will still need the Alias portion shown above.
*** Pop-ups | View | Channel ***
========================================
Pic Offerings
.Pics On:/offeron
.Pics Off:/offeroff
========================================
2.2 Setting up multiple offers with a timer
This script is pretty similar to the one above, except that we'll now utilize a simple text file to store the various commands to be executed by a timer.
First off, let's put together a couple of offerings to work with. These are only examples.
*** What we want displayed in the channel ***
========================================
* Someone has a great pic, type /ctcp Someone !trigger MyPic
* Someone has an okay pic, type /ctcp Someone !trigger SomeoneElsesPic
* Someone has a fabulous pic, type /ctcp Someone !trigger FabPic
* Someone has a cool pic, type /ctcp Someone !trigger Cool
* Someone has an FServer running, type /ctcp Someone !MyServer
========================================
*** Alias ***
========================================
/mypic /me has a great pic, type /ctcp $me !trigger MyPic
/somepic /me has an okay pic, type /ctcp $me !trigger SomeoneElsesPic
/fabpic /me has a fabulous pic, type /ctcp $me !trigger FabPic
/coolpic /me has a cool pic, type /ctcp $me !trigger Cool
/server /me has an FServer running, type /ctcp $me !MyServer
========================================
Now don't get bogged down on how all these trigger statements work yet. We need to get them displayed before we jump into that, so be patient.
The next step is to get these to pop up on to the channel randomly. Well, in order to do this we first need to create a text file with all of the alias commands in it. You'll see why in just a second.
** Text file called c:\pics\pics.txt **
========================================
/mypic
/somepic
/fabpic
/coolpic
/server
========================================
Okay, you've got all your alias statements in place, and you've created this little text file with 5 lines in it. Now we actually get around to displaying something. The following script will pic a random line out of this text file and execute it. When it executes, it will cause the offer that we set up in the first part to display.
This script will begin when you type "/offeron" (without the quotes) on any active window in mIRC. At first you should only see an internal message from mIRC saying that you've activated a timer. Your offer will appear 5 minutes after that, and will repeat every 5 minutes for as long as you are on-line. You can turn this off at any time by typing "/offeroff".
*** Alias ***
========================================
;
;----- Multiple Pic Offerings
;
/offeron {
timer2 0 300 $!read c:\pics\pics.txt
}
/offeroff {
timer2 off
}
========================================
-----------------------------------------------------------------------
timer2 0 300 $!read c:\pics\pics.txt
-----------------------------------------------------------------------
In the above statement the 'timer2' is the timer ID number (you can use any number you want but only one timer can use each number)
The '0' means it will not terminate after a certain number of times. If you want the timer to shut off after it has repeated a certain number if times enter the number you want.
The '300' is the time, in seconds, between repeats. In other words, it will repeat every 300 seconds or 5 minutes.
The '$!read c:\pics\pics.txt' is the command that will be executed when the timer repeats. '$!read' will read a random line from 'c:\pics\pics.txt' and execute it.
Just so long as the commands in your "pics.txt" match what you have in your Aliases, everything should work out just fine. Be sure you don't forget to update both!
Also, be certain that you provide mIRC with the proper path statement. "c:\pics" is only used as an example here.
Credits
Originally done by Metrol