mIRC Homepage
Posted By: bynw VERSION REPLY HELP - 21/08/05 04:53 AM
SINCE SOME MORONS CANNOT READ ENGLISH AND LOCKED MY ORIGINAL POST AFTER OTHER MORONS REPLIED IMPROPERLY TOO IT WILL REPOST IT ONCE AGAIN.

MY ORIGINAL POST STATED:

Need some help on this on ....

in a

i want a script to trigger when it does a CTCP Version and doesnt get a reply ...

how do i go about doing that??

Thanks

END OF ORIGINAL POST.

PLEASE NOTE, FOR THOSE THAT NEED AN <SELF EDIT OF A COLORFUL METAPHOR HERE> PICTURE DRAWN FOR THEM.

IT STATES I NEED A SCRIPT THAT TRIGGERS WHEN I DO NOT RECEIVE A VERSION REPLY FROM SOMEONE THAT I VERSIONED.

THANK YOU AGAIN.
Posted By: argv0 Re: VERSION REPLY HELP - 21/08/05 05:05 AM
set a timer when you ctcp them

on CTCPREPLY, turn off the timer

if the timer executes, there is no reply
Posted By: bynw Re: VERSION REPLY HELP - 21/08/05 05:21 AM
Thank you,

What is a good time limit for the timer? It generally doesn't take more than a few seconds to get a response back from a version request.
Posted By: Lpfix5 Re: VERSION REPLY HELP - 21/08/05 05:31 AM
Quote:
Thank you,

What is a good time limit for the timer? It generally doesn't take more than a few seconds to get a response back from a version request.


Why are you calling everyone in that post a morron maybe the world was not created on a perfect level. I just had miss read the actual post itself it was really early in the morning for me.

a simple mistake is all just like in your text on top here says englished should of been only english...

No one is here to call others morron's and be mad about a factor

as for the timer event 2 seconds is sufficient however some people on dialup downloading several things at once can get a reply of 5 to 7 seconds in worst case scenario id set it for a timer of ..

.timer 1 10 //execute script here..

and for the ctcpreply timers off

..ex
on *:CTCPREPLY:*: {
timers off
}

hope that works and sorry about miss reading the question
Posted By: bynw Re: VERSION REPLY HELP - 21/08/05 05:39 AM

Thank you Lpfix5.

My apologies to you.
Posted By: Darwin_Koala Re: VERSION REPLY HELP - 21/08/05 05:55 AM
Quote:
<...>:

Need some help on this on ....

in a

i want a script to trigger when it does a CTCP Version and doesnt get a reply ...

how do i go about doing that??

Thanks

<...>


Unfortunately, I did post a coded reply to your original request that was also deleted. I am going to take this up separately with the person who removed it <vitriol deleted>. The general reply was:
Code:
 
alias custom_version {
ctcp $$1 version
timer $+ _vers_ $+ $$1 1 5 { your code here }
}

on 1:CTCPREPLY:VERSION*:timer $+ _vers_ $+ $nick off

 

Usage: /custom_version <nick>

In my original comments I had mentioned that the 5 second delay was nominal, you can change it to whatever you need, but be aware of the effect of lagged networks.

I hope you find this useful, this is not tested.

Cheers,

DK.
Posted By: bynw Re: VERSION REPLY HELP - 21/08/05 06:22 AM
Let me go into more detail ... I will post where I currently am located on this to help everyone who is attempting to help me in the right direction.

Code:
 

on *:SNOTICE:*client connecting*:{
  timer 1 5 ctcp $4 version
}
on 1:CTCPREPLY:VERSION*:{
  write versionlog. $+ $asctime(yyyy-mm-dd) $+ .txt $2-
  if ($read(versions.txt, s, $2)) wallops Version Alert for $nick using $2- $read(versions.txt, s, $2)
  else halt
}



don't worry about the versions.txt file ... that might replaced with a hash table in the future, but for now the txt file works just fine.

Here is where my question comes into play. If there is no response from the client being versioned (within a reasonable amount of time, say 10 seconds to account for lag or anything of the kind)

I want it to notice the user that there was no version reply.

Now any help on this?

Thanks again.
Posted By: Lpfix5 Re: VERSION REPLY HELP - 21/08/05 06:40 AM
good question

on *:SNOTICE:*client connecting*:{
timer 1 5 ctcp $4 version
timer 1 15 //notice $nick I did not get a version reply from you
}
\\**The reason i put it at 15 is because we are setting up 2 timers one of them will expire in 5 seconds and version the person then the second one expires 10 seconds after the first one expires and says in notice to $nick I did not receive a version reply from you
on 1:CTCPREPLY:VERSION*:{
timers off
//***Timers off here because if there is a ctcpreply(version) then we disable any active timers so it does not tell $nick that you did not get a reply from him/her
write versionlog. $+ $asctime(yyyy-mm-dd) $+ .txt $2-
if ($read(versions.txt, s, $2)) wallops Version Alert for $nick using $2- $read(versions.txt, s, $2)
else halt
}
Posted By: bynw Re: VERSION REPLY HELP - 21/08/05 06:51 AM
That almost works.

Save unless during that 15 seconds another user connects and their timer starts ... then when the first user ends with the version reply it kills all timers and the 2nd user does even get versioned.

Tricky isnt it .....
Posted By: xDaeMoN Re: VERSION REPLY HELP - 21/08/05 07:04 AM
The "timers off" was the problem. It would be better to give a unique name to each timer for each nick. Also I made the timers & /notice command silent. Try this

Code:
 on *:SNOTICE:*client connecting*:{
  .timer 1 5 .ctcp $4 version
  $+(.timercheckver,$cid,$nick) 1 15 .notice $nick I did not get a version reply from you
}

on 1:CTCPREPLY:VERSION*:{
  $+(.timercheckver,$cid,$nick) off
  write versionlog. $+ $asctime(yyyy-mm-dd) $+ .txt $2-
  if ($read(versions.txt, s, $2)) wallops Version Alert for $nick using $2- $read(versions.txt, s, $2)
} 
Posted By: Mentality Re: VERSION REPLY HELP - 21/08/05 08:08 AM
Referring to moderators as morons only makes matters worse, especially in caps smile

Your original post is easily misinterpreted due to the poor English (yet, judging by your shouted comments you have a reasonable grasp of the language). For example,

Quote:
Need some help on this on ....

in a


..makes no sense. Anyway, now that that's settled, I hope you get the help you've received and apologies for the confusion which has delayed your innocent request smile

Regards,
Posted By: bynw Re: VERSION REPLY HELP - 21/08/05 02:42 PM
Quote:
The "timers off" was the problem. It would be better to give a unique name to each timer for each nick. Also I made the timers & /notice command silent. Try this

Code:
 on *:SNOTICE:*client connecting*:{
  .timer 1 5 .ctcp $4 version
  $+(.timercheckver,$cid,$nick) 1 15 .notice $nick I did not get a version reply from you
}

on 1:CTCPREPLY:VERSION*:{
  $+(.timercheckver,$cid,$nick) off
  write versionlog. $+ $asctime(yyyy-mm-dd) $+ .txt $2-
  if ($read(versions.txt, s, $2)) wallops Version Alert for $nick using $2- $read(versions.txt, s, $2)
} 



Thanks for the attempt there. But that ends up sending the notice to all users that a version reply was not received. I am wondering if both parts of that need to be in one script or not and if so how to set to events into one larger script.
Posted By: bynw Re: VERSION REPLY HELP - 21/08/05 02:47 PM
Quote:
Referring to moderators as morons only makes matters worse, especially in caps smile

Your original post is easily misinterpreted due to the poor English (yet, judging by your shouted comments you have a reasonable grasp of the language). For example,

Quote:
Need some help on this on ....

in a


..makes no sense. Anyway, now that that's settled, I hope you get the help you've received and apologies for the confusion which has delayed your innocent request smile

Regards,


I realize that first part makes no sense, I started out typing one thing and then changed in midstream and didnt do a proper job of deleting the oringal information. It looks like there were some stray characters left over. A typ0, a bad edit, nothing more. The information below that bit does make sense as did my additional replys when I started to get the wrong information.
Posted By: bynw Re: VERSION REPLY HELP - 21/08/05 04:57 PM
back to the script at hand.

the basic script again is:

Code:
 
on *:SNOTICE:*client connecting*:{
  timer 1 5 ctcp $4 version
}
on 1:CTCPREPLY:VERSION*:{
  write versionlog. $+ $asctime(yyyy-mm-dd) $+ .txt $2-
  if ($read(versions.txt, s, $2)) wallops Version Alert for $nick using $2- $read(versions.txt, s, $2)
  else halt
}


I think all the timers need to be dynamically assigned with a name, instead of the next available timer number. But then in the ctcpreply event I need a way of knowing which timer is which ... so it doesn't turn off the incorrect timer and doesn't send out that notice to the user that they don't have a version response.
Posted By: Lpfix5 Re: VERSION REPLY HELP - 21/08/05 05:41 PM
Quote:
That almost works.

Save unless during that 15 seconds another user connects and their timer starts ... then when the first user ends with the version reply it kills all timers and the 2nd user does even get versioned.

Tricky isnt it .....


tricky maybe.. hardly though because i can make it a lil more better for you.. now if this doesnt work your gonna replace $nick with $$1 or $1
Original Code****************
on *:SNOTICE:*client connecting*:{
timer 1 5 ctcp $4 version
}
on 1:CTCPREPLY:VERSION*:{
write versionlog. $+ $asctime(yyyy-mm-dd) $+ .txt $2-
if ($read(versions.txt, s, $2)) wallops Version Alert for $nick using $2- $read(versions.txt, s, $2)
else halt
}
New code*****************
on *:SNOTICE:*client connecting*:{
%nver = $nick
timer 1 5 ctcp $4 version
timer $+ %nver 1 15 //notice %nver I did not receive a version reply from you
}
//** What this does is set a var for $nick on server connect, and then what we do is put timer $+ %nver 1 15 so it equals in theory too /timernickname 1 15 this way it names the timer whatever the client is.. example "Client Connecting Dave" /timerDave 1 15 //script execute here
on 1:CTCPREPLY:VERSION*:{
timer $+ $nick off
timer 1 1 //unset %nver

write versionlog. $+ $asctime(yyyy-mm-dd) $+ .txt $2-
if ($read(versions.txt, s, $2)) wallops Version Alert for $nick using $2- $read(versions.txt, s, $2)
else halt
}
//** This takes care of the name for the timer itself however as far as more then one person connecting and the ODDS of 2 in less then 15 seconds have no version reply is slim to none right? either way hope the varibles given to you work you see in the second script for ctcpreply it should detect the nick of person and shut off timer tus why for example if dave was the one to connect and give me a reply back it would execute TimerDave off in theory smile enjoy!

So conclusion is you can have 1,000,000 active timers but if all 999,999 of these timers give you a version reply it will deactivate the timers individually, and that 1 that didnt give you the reply back will notice him/her

laugh smile wink
Posted By: bynw Re: VERSION REPLY HELP - 21/08/05 05:55 PM
Just tested that one ....

test connection #1 @ 12:45:40
received a version request and replied to it @ 12:45:45

test connection #2 @ 12:45:44 (connecting 4 seconds after the previous connection)
received a version request and replied to it @ 12:45:49

test connection #1 received a notice about not getting a version reply @ 12:45:55 even though it previously did reply.

test connection #2 did not get that notice.

*sigh* there has to be a way of getting this to work ... and we will stumble on it sooner or later ...
Posted By: Lpfix5 Re: VERSION REPLY HELP - 21/08/05 06:36 PM
Quote:
Just tested that one ....

test connection #1 @ 12:45:40
received a version request and replied to it @ 12:45:45

test connection #2 @ 12:45:44 (connecting 4 seconds after the previous connection)
received a version request and replied to it @ 12:45:49

test connection #1 received a notice about not getting a version reply @ 12:45:55 even though it previously did reply.

test connection #2 did not get that notice.

*sigh* there has to be a way of getting this to work ... and we will stumble on it sooner or later ...


Doh.. I had a brain fart sorry on that one no need for a Variable in this scenerario

just

/timer $+ $nick 1 15 //notice...................

and for second script leave as is but remove /timer 1 1 //unser %nver

My appoligies dude.

The reason behind this scenario is on the first script we are creating a timer with $nick has the name

second script if we get this "reply" from him Immediately timerNICKNAME is turned off therefore it cannot confuse if there 2 or more
Posted By: bynw Re: VERSION REPLY HELP - 21/08/05 06:54 PM
thanks for your help, i think that finally did it ....
Posted By: Lpfix5 Re: VERSION REPLY HELP - 21/08/05 07:08 PM
Quote:
thanks for your help, i think that finally did it ....



ah., glad to see it work, and your welcome
Posted By: bynw Re: VERSION REPLY HELP - 21/08/05 07:22 PM

New code is:

Code:
 
on *:SNOTICE:*client connecting*:{
  timer 1 5 ctcp $4 version
  timer $+ $4 1 15 notice $4 I did not receive a version reply from you
}
on 1:CTCPREPLY:VERSION*:{
  timer $+ $nick off
  write versionlog. $+ $asctime(yyyy-mm-dd) $+ .txt $2-
  if ($read(versions.txt, s, $2)) wallops Version Alert for $nick using $2- $read(versions.txt, s, $2)
  else halt
} 
 


Now I attempted to insert another write command, so it wrote to a new file specifically for non responding clients ... but that didnt seem to work ... it wrote for all clients

write noreplylog $+ $asctime(yyyy-mm-dd) $+ .txt NO REPLY FROM $4

That would have to go after the 2nd timer someplace but not sure where ...
Posted By: SladeKraven Re: VERSION REPLY HELP - 21/08/05 07:29 PM
Why don't you have the timer call an alias which has your commands in it.

$+(.timer,$4) 1 15 MyAlias

Code:
alias MyAlias {
  notice $4 I did not receive a version reply from you
  write $+(noreplylog,$asctime(yyyy-mm-dd),.txt) NO REPLY FROM $4
}


on *:SNOTICE:*client connecting*:{ 
  timer 1 5 ctcp $4 version  
  $+(.timer,$4) 1 15 MyAlias
}

on 1:CTCPREPLY:VERSION*:{ 
  $+(.timer,$nick) off  
  write $+(versionlog.,$asctime(yyyy-mm-dd),.txt) $2-  
  if ($read(versions.txt, s, $2)) wallops Version Alert for $nick using $2- $read(versions.txt, s, $2)  
  else halt
}


**Untested**

-Andy
Posted By: Lpfix5 Re: VERSION REPLY HELP - 21/08/05 07:34 PM
Quote:

New code is:

Code:
 
on *:SNOTICE:*client connecting*:{
  timer 1 5 ctcp $4 version
  timer $+ $4 1 15 notice $4 I did not receive a version reply from you
}
on 1:CTCPREPLY:VERSION*:{
  timer $+ $nick off
  write versionlog. $+ $asctime(yyyy-mm-dd) $+ .txt $2-
  if ($read(versions.txt, s, $2)) wallops Version Alert for $nick using $2- $read(versions.txt, s, $2)
  else halt
} 
 


Now I attempted to insert another write command, so it wrote to a new file specifically for non responding clients ... but that didnt seem to work ... it wrote for all clients

write noreplylog $+ $asctime(yyyy-mm-dd) $+ .txt NO REPLY FROM $4

That would have to go after the 2nd timer someplace but not sure where ...


that one you got me stumped on

try something like this "Inser this before second timer but on second script"

on 1:CTCPREPLY:VERSION*:{
timer $+ $nick off
if ($null) { write noreplylog $+ $asctime(yyyy-mm-dd) $+ .txt NO REPLY FROM $4 }
else { write versionlog. $+ $asctime(yyyy-mm-dd) $+ .txt $2- }
if ($read(versions.txt, s, $2)) wallops Version Alert for $nick using $2- $read(versions.txt, s, $2)
else halt
}

or better yet something like

/timer $+ $4 1 15 //notice here... | write noreplylog .............

this will break a new command
Posted By: IR_n00b Re: VERSION REPLY HELP - 21/08/05 07:58 PM
that would never work.

if ($null) { commands here would NEVER be processed }
else { commands here would ALWAYS be processed }
Posted By: SladeKraven Re: VERSION REPLY HELP - 21/08/05 08:06 PM
I could be wrong but did you want for that write command to be used in the timer too? Because with that break there your write command wont be included in the timer.

//.timerAndy 1 15 echo -a 15 seconds have passed. | echo -a 0 seconds have passed.

As I said I could be wrong, just wanted to show incase you didn't know.. smile

-Andy
Posted By: bynw Re: VERSION REPLY HELP - 21/08/05 09:09 PM
i'm using a modified version of the alias example above ...

but its not reading the $4 identifier ...

Code:
on *:SNOTICE:*client connecting*:{
  timer 1 5 ctcp $4 version
  timer $+ $4 1 15 noreply
}

alias noreply {
  notice $4 I did not receive a version reply from you
  write noreplylog. $+ $asctime(yyyy-mm-dd) $+ .txt no version reply from $4
}

on 1:CTCPREPLY:VERSION*:{
  timer $+ $nick off
  write versionlog. $+ $asctime(yyyy-mm-dd) $+ .txt $2- used by $nick
  if ($read(versions.txt, s, $2)) wallops Version Alert for $nick using $2- $read(versions.txt, s, $2)
  else halt
} 

Posted By: Lpfix5 Re: VERSION REPLY HELP - 21/08/05 09:39 PM
Quote:
that would never work.

if ($null) { commands here would NEVER be processed }
else { commands here would ALWAYS be processed }


my bad i was thinking of something else .. im working on a dialog at the same time im looking here.
Posted By: Kelder Re: VERSION REPLY HELP - 21/08/05 09:42 PM
Code:
]on *:SNOTICE:*client connecting*:{
  .timer 1 5 ctcp $4 version
  .timer $+ $4 1 15 noreply $4
}

alias noreply {
  notice $$1 I did not receive a version reply from you
  write noreplylog. $+ $asctime(yyyy-mm-dd) $+ .txt no version reply from $1
}

on 1:CTCPREPLY:VERSION*:{
  .timer $+ $nick off
  .write versionlog. $+ $asctime(yyyy-mm-dd) $+ .txt $2- used by $nick
  if ($read(versions.txt, s, $2)) wallops Version Alert for $nick using $2- $read(versions.txt, s, $2)
}
on 1:NICK:{
  if ($timer($nick)) {
    .timer $+ $newnick 1 $timer($nick).secs noreply $newnick
    .timer $+ $nick off
  }
}
on 1:QUIT:.timer $+ $nick off


The alias was called with no arguments, so $1- is empty. You have to pass all arguments you want to use to the alias.

I added a check for people changing nicknames or quitting so they don't give false alerts (as often)...
Posted By: bynw Re: VERSION REPLY HELP - 21/08/05 10:48 PM

Thanks for all your help. I think i have it working the way i want it to now.
Posted By: DaveC Re: VERSION REPLY HELP - 23/08/05 06:49 AM
Code:
on *:SNOTICE:*client connecting*:{
  timer 1 5 ctcp $4 version
  $+(timerNo.Version.Reply.From.,$4) 1 15 notice $4 I did not receive a version reply from you $(|,) write $!+(noreplylog,$asctime(yyyy-mm-dd),.txt) $4 
}
on *:CTCPREPLY:VERSION*:{
  $+(timerNo.Version.Reply.From.,$nick) off
  write $+(versionlog.,$asctime(yyyy-mm-dd),.txt) $2-
  if ($read(versions.txt, s, $2)) { wallops Version Alert for $nick using $2- $read(versions.txt, s, $2) }
  else { halt }
}


try that...
I renamed the no version timers better to timerNo.Version.Reply.From.$nick, becuase just using the name $nick is pretty dodgy someone else is just as likely to use that for something else.
And I added the write to the noreply log to the timer for no replies, but i removed the "NO REPLY FROM" since its going to the no reply log, i felt that that was a bit silly to be saying.

If it gets more complexe i suggest you use $+(timerNo.Version.Reply.From.,$4) 1 15 no.reply.alias $4 in replace of the old timer and
alias -l no.reply.alias {
notice $1 I did not receive a version reply from you
write $+(noreplylog,$asctime(yyyy-mm-dd),.txt) $1
.. add or edit the code in here ...
}


PS: you do know mirc always comes back with a version reply dont you? [ well almost always smile ]
© mIRC Discussion Forums