mIRC Home    About    Download    Register    News    Help

Topic Options
#251859 - 07/03/15 12:09 AM Automatic answers only one time
Anti Offline
Ameglian cow

Registered: 06/03/15
Posts: 20
Hello all,

I'm looking for some idea to send only one time a automatic
answer on a query.

If I use the classic :

on *:TEXT:*:?:msg $nick excuse me , I'm busy ; for example

The trigger start every time $nick send me something.

I want send the answer only one time , eventually with
different answers for different nicks.
How may I do this ?

Thanks all.

Top
#251861 - 07/03/15 01:10 AM Re: Automatic answers only one time [Re: Anti]
OrFeAsGr Offline
Fjord artisan

Registered: 01/02/15
Posts: 243
Loc: Greece
Code:
on *:text:*:?: {
if (!$($+(%,private,$nick),2)) {
set -u100 $+(%,private,$nick) 1
msg $nick excuse me im busy...
}
}

this will send only one reply. What you do in such situation is checking if there is a variable with $nick in it. (which would exist only if you had set it) So.. if there's not a variable you set it and msg. Next time $nick messages you there will be a variable that will stop the script from replying.
P.S i've set the variable to exist for 100 seconds. After that it will reply one more time. If you want different reply each time try adding lines in a .txt file and them put them in the msg with use of $read(filename.txt)


Edited by OrFeAsGr (07/03/15 01:10 AM)
_________________________
Humanity Bot Services Download & mIRC Scripting Help
http://humanity.ucoz.com

Top
#251865 - 07/03/15 05:44 AM Re: Automatic answers only one time [Re: OrFeAsGr]
Anti Offline
Ameglian cow

Registered: 06/03/15
Posts: 20

Overall thanks for you answer.

I don't understand this test :

if (!$($+(%,private,$nick),2)) {

I thing the test is :

if (!$(%privatenickname),2)) {

What's statement is this ?
What's the comparision ?

Besides I didn't know the construction :

$+(%,private,$nick)

to create the variable %privatenickname.


Thanks

Top
#251872 - 07/03/15 08:48 AM Re: Automatic answers only one time [Re: Anti]
westor Offline
Hoopy frood

Registered: 27/12/08
Posts: 1511
Loc: Greece
Originally Posted By: Anti

Overall thanks for you answer.

I don't understand this test :

if (!$($+(%,private,$nick),2)) {

I thing the test is :

if (!$(%privatenickname),2)) {

What's statement is this ?
What's the comparision ?

Besides I didn't know the construction :

$+(%,private,$nick)

to create the variable %privatenickname.


Thanks


Try to give an look into the help file: /help if then else

or if you want an better mirc doc check here: http://en.wikichip.org/wiki/mirc
_________________________
Need Online mIRC help or an mIRC Scripting Freelancer? -> http://westor.ucoz.com/contact <-

Top
#251888 - 07/03/15 06:51 PM Re: Automatic answers only one time [Re: westor]
Anti Offline
Ameglian cow

Registered: 06/03/15
Posts: 20

I read many times before and now the help of
/help if then else inside mirc and http://en.wikichip.org/wiki/mirc , but I didn't found trace of this
costruction.

The costruction is :

if (!$($+(%,private,$nick),2)) ;

Sorry , but I don't understand the expansion of this
expression, and I don't found nothing to understand it.

Thanks

Top
#251890 - 07/03/15 07:26 PM Re: Automatic answers only one time [Re: Anti]
OrFeAsGr Offline
Fjord artisan

Registered: 01/02/15
Posts: 243
Loc: Greece
$+(n1,...,nN)
Combines all of the specified parameters, the same as using $+ in between each item.
If you try to set a variable like this: set % $+ test $+ $nick it wont be set right. To set a dynamic variable right you use $+( . Which is the same as $+ but with a little difference. you seperate and "connect" an identifier from plain text with the use of a comma.
In this case you wanted to reply to private messages only once.
ill try to break down the code and explain.. im not the best tutor
Code:
on *:text:*:?: {
;;Here I need to check if the variable %private$nick exists. To get the value of a dynamic variable you use $+( and $( . So... you take $+(%,private,$nick) and use $( like this: $($+(%,private,$nick),2)
if ($($+(%,private,$nick),2)) {
;; ,2 belongs to $( and not to $+( . let's suppose OrFeAsGr is messsaging you for the 1st time. This: $($+(%,private,$nick),2) would return $null so the script would do the following
set $+(%,private,$nick) 1
;; to set a dynamic variable you dont need to use $($+(%,...,...),2) <- this is used only to get the value if there is one. To set/inc/dec you use only $+(
msg $nick Im busy now...
;;msges $nick
}
}

Now If OrFeAsGr would message you again there would be %privateOrFeAsGr 1 in the vars.ini
which would return 1 in the if statement so the msg wouldn't be sent.
I hope i helped you understand this. Good Luck! laugh Let me know if you need more help..!
_________________________
Humanity Bot Services Download & mIRC Scripting Help
http://humanity.ucoz.com

Top