mIRC Home    About    Download    Register    News    Help

Print Thread
#89419 07/07/04 09:20 AM
Joined: Jun 2004
Posts: 291
W
Fjord artisan
OP Offline
Fjord artisan
W
Joined: Jun 2004
Posts: 291
hey im stuck on this script , pls help me out,
i want ops to be able to type !time joe
then it would write the name joe in a text file then when joe gets voiced it would read names.txt which joe would be in and start timing and if the name wasnt in the file it wouldnt time but for some reason it times bothe ways?

script:-
on *:TEXT:!Time*:#: { //msg $chan $2 Is Now Bieng Timed On voice Time $2 :tongue: | write names.txt $2 } }
on *:voice:#sss: { if $read(names.txt,$nick writeini voice.ini voice $vnick $ctime }
on *:devoice:#sss: { if ($readini(voice.ini,voice,$vnick)) { msg #sss $vnick was voiced for: $duration($calc($ctime - $readini(voice.ini,voice,$vnick))) } }
pls i want only the nicks in names.txt to be timed help me out here?
and also when they get devoiced on leave/part it says the voice time perfect
BUT
i want it to carry on timing from the last voice time please help me
THANKYOU smile

#89420 07/07/04 10:08 AM
Joined: Jul 2004
Posts: 59
L
Babel fish
Offline
Babel fish
L
Joined: Jul 2004
Posts: 59
Seems your missing a few brackets Not saying this will make it work since I didnt test it but you need to close those brackets that you open.

on *:voice:#sss: {
if ($read(names.txt,$nick)) { writeini voice.ini voice $vnick $ctime }
}

#89421 07/07/04 12:54 PM
Joined: Jun 2004
Posts: 291
W
Fjord artisan
OP Offline
Fjord artisan
W
Joined: Jun 2004
Posts: 291
that part works perfect like i already said
pls some1 help
thanx

#89422 07/07/04 05:26 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Even if it works, you should use correct syntax.

Code:
on *:TEXT:!Time*:#: { 
  msg $chan $2 Is Now Bieng Timed On voice Time $2  
  write names.txt $2 
} 
on *:voice:#sss: { 
  if ($read(names.txt,w,$nick)) { writeini voice.ini voice $vnick $ctime }
}
on *:devoice:#sss: { 
  if ($readini(voice.ini,voice,$vnick)) { msg #sss $vnick was voiced for: $duration($calc($ctime - $readini(voice.ini,voice,$vnick))) } 
}


Also, i don't get what you are trying to do.


New username: hixxy
#89423 08/07/04 08:59 AM
Joined: Jun 2004
Posts: 291
W
Fjord artisan
OP Offline
Fjord artisan
W
Joined: Jun 2004
Posts: 291
thanks alot for the replys people and thanks for the code
and what i want to do is time the total voice time of someone
but at the moment it just counts the voice till devoice time
and when they get voiced the next time it starts from the beggining
can some1 please tell me how to make it time from where it left on the next time they get voiced
thanks everyone

#89424 08/07/04 11:37 AM
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
You'll have to also keep the duration he was voiced to the ini file, and then add the result of the calculation in the on devoice event to it and write it.
Maybe also add some on part and on quit triggers to calculate it then.

You could also make an alias to update the duration from commandline, it should read the duration from ini file, add the $ctime - ini $ctime to it, and then write current $ctime and updated duration to file.

#89425 08/07/04 11:54 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
I didn't test it, but this should work:

Code:
on *:TEXT:!Time &:#: {
  if (!$read(names.txt,w,$2)) {
    /msg $chan $2 Is Now Being Timed On voice Time $2
    /write names.txt $2
  }
  else /msg $chan $2 is already being timed!
}

on *:VOICE:#: {
  if ($read(names.txt,w,$vnick)) {
    var %time = $ctime
    if ($readini(voice.ini,voice,$vnick)) /dec %time $calc($ctime - $v1)
    /writeini voice.ini voice $vnick %time
  }
}

on *:DEVOICE:#: {
  if ($readini(voice.ini,voice,$vnick)) {
    /msg $chan $vnick was voiced for: $duration($calc($ctime - $v1))
  }
}

[Edit: Typos; Fixing more]

Last edited by KingTomato; 08/07/04 12:07 PM.

-KingTomato

Link Copied to Clipboard