mIRC Homepage
Posted By: sas22 Hmm on join isnt working - 10/07/06 12:42 AM
Well I set this up so that when ever I join a channel and if a certain nick ison it I would msg the chan with a certain messasge:
Code:
on *:join:#cool:if ($nick == $me) && (MikeT ison #) { msg # Hey Mike  }
Posted By: RusselB Re: Hmm on join isnt working - 10/07/06 12:48 AM
I don't see anything wrong, but here's a little re-write that you might try
Code:
 on me:*:join:#cool: $iif(MikeT ison #,.msg # Hi Mike) 
Posted By: sas22 Re: Hmm on join isnt working - 10/07/06 12:59 AM
thanks for the tip.
Posted By: sas22 Re: Hmm on join isnt working - 10/07/06 01:12 AM
Quote:
I don't see anything wrong, but here's a little re-write that you might try
Code:
 on me:*:join:#cool: $iif(MikeT ison #,.msg # Hi Mike) 
Uhh..that isnt working either..
Posted By: RusselB Re: Hmm on join isnt working - 10/07/06 01:32 AM
OK..this is a bit confusing to me, but here's a script that has been tested and works
Code:
 on me:*:join:#:{
  .timer -m 1 1 test $chan
}
alias -l test {
  $iif(MikeT ison $1,msg $1 Hi Mike)
}
 

It's not instantaneous upon your joining the channel, but at 1/1000th of a second, not many are going to notice.
Posted By: sas22 Re: Hmm on join isnt working - 10/07/06 01:34 AM
Thanks
Posted By: RusselB Re: Hmm on join isnt working - 10/07/06 01:38 AM
I'm suspecting that was the problem with your original code also. Just needed a little bit of a delay between the on join time and the time for checking for the nick. Looks like 1/1000th of a second is sufficient. Might actually be too long, but I don't know how to do a timer more accurately than milliseconds in mIRC
Posted By: Lpfix5 Re: Hmm on join isnt working - 10/07/06 06:47 AM
Quote:
I'm suspecting that was the problem with your original code also. Just needed a little bit of a delay between the on join time and the time for checking for the nick. Looks like 1/1000th of a second is sufficient. Might actually be too long, but I don't know how to do a timer more accurately than milliseconds in mIRC


Russell to create a nth of a ms theres 2 ways of doing it a pure calc command keep in mind i used 0 has the x of msgs displayed so it floods... ill just show u bascis on how we were playing around back in the day ("War Script games") and which I could fine tune my script to be real quick I kept using Calc divisions.

//timer -m 0 $calc(100 / 1000) //msg # Im flooding the fook out of u

or

//timer -m 0 0.010 //msg # Im flooding the fook out of u
Posted By: RusselB Re: Hmm on join isnt working - 10/07/06 09:46 PM
OK..I thought I'd read that the timer function wouldn't accept decimals, but you're stating that it will. I rarely need a timer more accurate than milliseconds, but it's nice to know that it can be done.
Posted By: DaveC Re: Hmm on join isnt working - 11/07/06 02:12 AM
Quote:
Russell to create a nth of a ms theres 2 ways of doing it a pure calc command keep in mind i used 0 has the x of msgs displayed so it floods... ill just show u bascis on how we were playing around back in the day ("War Script games") and which I could fine tune my script to be real quick I kept using Calc divisions.

.
U have no idea what your saying do u.
.
All u were doing is /timer -m 0 0 command since the delay time in ms cant be split down any lower than whole numbers it simply defaulted to 0 on 0.01 etc. What should also be noted is that delay in MS in a timer does not mean that the timer well even be able to go off at that rate, mirc is still restricted to its own processing system, its got more to do tat just your timers.
.
Here are soem examples
.
The first 2 show a 3 second running 30 times at 1/10th of a second an interval timer, the first uses -m the seond uses the more accurate -h
.
//set %x | .timer -m 30 100 set %x % $+ x $!calc($ticks - $ticks ) | .timer 1 5 echo Milliseconds after start that each event triggered at were % $+ x
Milliseconds after start that each event triggered at were 125 234 343 453 562 671 781 890 1000 1109 1218 1328 1437 1546 1656 1765 1875 1984 2093 2203 2312 2421 2531 2640 2750 2859 2968 3078 3187 3296
.
//set %x | .timer -h 30 100 set %x % $+ x $!calc($ticks - $ticks ) | .timer 1 5 echo Milliseconds after start that each event triggered at were % $+ x
Milliseconds after start that each event triggered at were 110 204 313 407 516 610 704 813 907 1016 1110 1204 1313 1407 1516 1610 1704 1813 1907 2016 2110 2204 2313 2407 2516 2610 2704 2813 2907 3016
.
In both you well see that the moment the timers went off were not in line with the interval rate, the first creeping ever more away from were it should have been, the second holding close but always just after, the first creeps away becuase as i understand it, it delays for 1/10th of a second from the time of the last timered event so its 1/10th of a second or more from the last one, while the -h tries to go off aas close to when it shoukl as possable to detect.
.
here are the same but using a 0 time delay
.
//set %x | .timer -m 30 0 set %x % $+ x $!calc($ticks - $ticks ) | .timer 1 1 echo Milliseconds after start that each event triggered at were % $+ x
Milliseconds after start that each event triggered at were 31 47 63 78 94 110 125 141 156 172 188 203 219 235 250 266 281 297 313 328 344 360 375 391 406 422 438 453 469 485
.
//set %x | .timer -h 30 0 set %x % $+ x $!calc($ticks - $ticks ) | .timer 1 1 echo Milliseconds after start that each event triggered at were % $+ x
Milliseconds after start that each event triggered at were 31 47 63 78 94 110 125 141 156 172 188 203 219 235 250 266 281 297 313 328 344 360 375 391 406 422 438 453 469 485
.
As u can see neither of these commands manage to go off at a 0 seconds/milliseconds delay, each is restricted to a cycle of events mirc processes, this appears to be regular/lated bu a 5/16 tick cycle time (15.625 most likely being 1000/64)
.
PS .timer -m/h 30 0.01 results in the same returned value as the last two examples.
© mIRC Discussion Forums