mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
#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 2 of 2 1 2

Link Copied to Clipboard