mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#128122 21/08/05 04:53 AM
Joined: Aug 2003
Posts: 66
B
bynw Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Aug 2003
Posts: 66
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.

#128123 21/08/05 05:05 AM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
set a timer when you ctcp them

on CTCPREPLY, turn off the timer

if the timer executes, there is no reply


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
#128124 21/08/05 05:21 AM
Joined: Aug 2003
Posts: 66
B
bynw Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Aug 2003
Posts: 66
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.

#128125 21/08/05 05:31 AM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
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


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
#128126 21/08/05 05:39 AM
Joined: Aug 2003
Posts: 66
B
bynw Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Aug 2003
Posts: 66

Thank you Lpfix5.

My apologies to you.

#128127 21/08/05 05:55 AM
Joined: Feb 2004
Posts: 206
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Feb 2004
Posts: 206
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.


Darwin_Koala

Junior Brat, In-no-cent(r)(tm) and original source of DK-itis!
#128128 21/08/05 06:22 AM
Joined: Aug 2003
Posts: 66
B
bynw Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Aug 2003
Posts: 66
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.

#128129 21/08/05 06:40 AM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
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
}

#128130 21/08/05 06:51 AM
Joined: Aug 2003
Posts: 66
B
bynw Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Aug 2003
Posts: 66
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 .....

#128131 21/08/05 07:04 AM
Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
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)
} 


If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
#128132 21/08/05 08:08 AM
Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
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,


Mentality/Chris
#128133 21/08/05 02:42 PM
Joined: Aug 2003
Posts: 66
B
bynw Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Aug 2003
Posts: 66
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.

#128134 21/08/05 02:47 PM
Joined: Aug 2003
Posts: 66
B
bynw Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Aug 2003
Posts: 66
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.

#128135 21/08/05 04:57 PM
Joined: Aug 2003
Posts: 66
B
bynw Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Aug 2003
Posts: 66
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.

#128136 21/08/05 05:41 PM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
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


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
#128137 21/08/05 05:55 PM
Joined: Aug 2003
Posts: 66
B
bynw Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Aug 2003
Posts: 66
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 ...

#128138 21/08/05 06:36 PM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
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

Last edited by Lpfix5; 21/08/05 06:37 PM.

Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
#128139 21/08/05 06:54 PM
Joined: Aug 2003
Posts: 66
B
bynw Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Aug 2003
Posts: 66
thanks for your help, i think that finally did it ....

#128140 21/08/05 07:08 PM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Quote:
thanks for your help, i think that finally did it ....



ah., glad to see it work, and your welcome


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
#128141 21/08/05 07:22 PM
Joined: Aug 2003
Posts: 66
B
bynw Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Aug 2003
Posts: 66

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 ...

#128142 21/08/05 07:29 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
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

#128143 21/08/05 07:34 PM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
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


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
#128144 21/08/05 07:58 PM
Joined: Sep 2004
Posts: 200
I
Fjord artisan
Offline
Fjord artisan
I
Joined: Sep 2004
Posts: 200
that would never work.

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

#128145 21/08/05 08:06 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
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

#128146 21/08/05 09:09 PM
Joined: Aug 2003
Posts: 66
B
bynw Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Aug 2003
Posts: 66
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
} 


#128147 21/08/05 09:39 PM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
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.


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
#128148 21/08/05 09:42 PM
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
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)...

#128149 21/08/05 10:48 PM
Joined: Aug 2003
Posts: 66
B
bynw Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Aug 2003
Posts: 66

Thanks for all your help. I think i have it working the way i want it to now.

#128150 23/08/05 06:49 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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 ]

Page 1 of 2 1 2

Link Copied to Clipboard