mIRC Home    About    Download    Register    News    Help

Print Thread
Logging Kicks #245968 16/05/14 12:59 PM
Joined: Apr 2014
Posts: 13
T
Tarekhere Offline OP
Pikka bird
OP Offline
Pikka bird
T
Joined: Apr 2014
Posts: 13
Hello guys again, this is a kicking logger but it has some issues, here is the code first then i'll explain the issue

Code:
on *:kick:#:{
  if ($lines(TEXT\Kicklog\kicklog.txt) >= 100) { write -dl100 TEXT\Kicklog\kicklog.txt | write -dl100 TEXT\Kicklog\kickadress.txt | write -dl100 TEXT\Kicklog\kickinfo.txt }
  write -il1 TEXT\Kicklog\kicklog.txt $nick $knick
  write -il1 TEXT\Kicklog\kickadress.txt $address($knick,1) $address($knick,5) $address($knick,6) *! $+ $$ial($knick $+ *,1).addr
  write -il1 TEXT\Kicklog\kickinfo.txt # $+ * $+ $date at $time $+ * $+ $1-
  set -u60 %kkcomand kicked
}
on admin:TEXT:*.logs*:#: {
  if ($2 isalpha) { msg $chan Be smart ! $chr(91) example: `logs 11, will show logs starting from log number 11 $chr(93) | halt }
  msg $chan $chr(91) Total : $lines(TEXT\Kicklog\kicklog.txt) logs $chr(93) 
Searching For Users Matching Your Request.
  $iif($2 isnum, %i = $2, %i = 1)
  var %f 1
  while (%i <= $calc($2 + 10)) {
    if ($lines(TEXT\Kicklog\kicklog.txt) < %i) { var %endit true | goto msgit }
    set %log $+ %f $chr(91) $+ %i $+ $chr(93) $findkick($read(TEXT\Kicklog\kicklog.txt, %i),2) : * $+ $remove($left($findkick($read(TEXT\Kicklog\kickadress.txt,1),4),9),*!) $+ * | inc %f
    inc %i
  }
  :msgit
  msg $chan 1- $+ %log1 | msg $chan 2- $+ %log2 | msg $chan 3- $+ %log3 | msg $chan 4- $+ %log4 | msg $chan 5- $+ %log5 | msg $chan 6- $+ %log6
  msg $chan 7- $+ %log7 | msg $chan 8- $+ %log8 | msg $chan 9- $+ %log9 | msg $chan 10- $+ %log10  $chr(91) $+ .logs $calc($2 + 11)) for the next 10 logs. $+ $chr(93) 
  if (%endit == true) { msg $chan $chr(91) End Of Logs. $chr(93) | halt }
  unset %log1 | unset %log2 | unset %log3 | unset %log4 | unset %log5 | unset %log6 | unset %log7 | unset %log8 | unset %log9 | unset %log10 | unset %log11
}

;---------veiw log
on admin:TEXT:*.inf*:#: {
  if ($2 isalpha) { msg $chan $chr(91) Please Define an entry number $chr(93) | halt }
  if ($2 == $null) { msg $chan $chr(91) Please Define an entry. $chr(93) | halt
  }
  msg $chan Name: $findkick($read(TEXT\Kicklog\kicklog.txt,$2),2) &#1074;&#1026;©  Gate - *! $+ $remove($left($findkick($read(TEXT\Kicklog\kickadress.txt,$2),4),18),*!) $+ @*$* &#1074;&#1026;© Kicked By : $findkick($read(TEXT\Kicklog\kicklog.txt,$2),1) &#1074;&#1026;© Kick Time : $findinfo($read(TEXT\Kicklog\kickinfo.txt,$2),1) &#1074;&#1026;© Reason : $findinfo($read(TEXT\Kicklog\kickinfo.txt,$2),2)
}
findkick { return $gettok($1,$2,32) }
findinfo { return $gettok($1,$2,$asc(*)) }



The problem is it doesnt read the logs from the files kicklog.txt , kickaddress.txt and kickinfo .txt it just returns this when I type .logs (number) or without

[15:48] « @ » • « Support » [ Total : 2 logs ] Searching For Users Matching Your Request.
[15:48] « @ » • « Support » 1-[1] : **
[15:48] « @ » • « Support » 2-[2] : **

but when I check the txt files it adds them correctly.

second thing when i type .inf it returns this

[15:47] « @ » • « Support » Name: Gate - *!@*$* Kicked By : Kick Time : Reason :

help please ?? Thanks.

Re: Logging Kicks [Re: Tarekhere] #245969 16/05/14 02:49 PM
Joined: Apr 2014
Posts: 191
B
blessing Offline
Vogon poet
Offline
Vogon poet
B
Joined: Apr 2014
Posts: 191
Code:
alias findkick { return $gettok($1,$2,32) }
alias findinfo { return $gettok($1,$2,$asc(*)) }

Re: Logging Kicks [Re: blessing] #245975 16/05/14 10:19 PM
Joined: Apr 2014
Posts: 13
T
Tarekhere Offline OP
Pikka bird
OP Offline
Pikka bird
T
Joined: Apr 2014
Posts: 13
thanksss. worked out !! u r da man