mIRC Home    About    Download    Register    News    Help

Print Thread
#10388 09/02/03 09:53 PM
Joined: Feb 2003
Posts: 14
F
Pikka bird
OP Offline
Pikka bird
F
Joined: Feb 2003
Posts: 14
I noticed that when you post a reply that thread isnt moved to the beginning again.. so ill just post a new thread... smile






Okey I got my stats generator script to work!!! until i did the last part which was when I deactivated it, it would remove all stats files... I was so stupid... I didnt realise that it would delete my stats.mrc which contained the stats word :P... So now i have recreated the whole thing again.. But I am having problems with my on QUIT and on KICK...

My on PART works perfect but on QUIT which adds the information to the same ini file isnt working... My on KICK with $knick works but not when I am trying to do a kickers ($nick) the nick of the person who kicked the most user... I think is a simple misstake but I cant seem to find it.. So I will just paste my code here (the wrong part) and you will help me find the problem


P.S. The %stas.channel1-4 is the name of the channel it is logging...



on *:QUIT: {
if ($chan == %stats.channel1) { set %stats.temp stats. $+ $chan }
if ($chan == %stats.channel1) { set %stats.temp %stats.temp $+ .part.ini }
if ($chan == %stats.channel1) && ($readini(%stats.temp, Nicks, $nick) != $null) { writeini %stats.temp Nicks $nick $calc($readini(%stats.temp, Nicks, $nick) + 1) }
else if ($chan == %stats.channel1) { writeini %stats.temp Nicks $nick 1 }
if ($chan == %stats.channel2) { set %stats.temp stats. $+ $chan }
if ($chan == %stats.channel2) { set %stats.temp %stats.temp $+ .part.ini }
if ($chan == %stats.channel2) && ($readini(%stats.temp, Nicks, $nick) != $null) { writeini %stats.temp Nicks $nick $calc($readini(%stats.temp, Nicks, $nick) + 1) }
else if ($chan == %stats.channel2) { writeini %stats.temp Nicks $nick 1 }
if ($chan == %stats.channel3) { set %stats.temp stats. $+ $chan }
if ($chan == %stats.channel3) { set %stats.temp %stats.temp $+ .part.ini }
if ($chan == %stats.channel3) && ($readini(%stats.temp, Nicks, $nick) != $null) { writeini %stats.temp Nicks $nick $calc($readini(%stats.temp, Nicks, $nick) + 1) }
else if ($chan == %stats.channel3) { writeini %stats.temp Nicks $nick 1 }
if ($chan == %stats.channel4) { set %stats.temp stats. $+ $chan }
if ($chan == %stats.channel4) { set %stats.temp %stats.temp $+ .part.ini }
if ($chan == %stats.channel4) && ($readini(%stats.temp, Nicks, $nick) != $null) { writeini %stats.temp Nicks $nick $calc($readini(%stats.temp, Nicks, $nick) + 1) }
else if ($chan == %stats.channel4) { writeini %stats.temp Nicks $nick 1 }
}

This on QUIT will not work...





on *:KICK:#: {
if ($chan == %stats.channel1) { set %stats.temp stats. $+ $chan }
if ($chan == %stats.channel1) { set %stats.temp %stats.temp $+ .kickers.ini }
if ($chan == %stats.channel1) && ($readini(%stats.temp, Nicks, $nick) != $null) { writeini %stats.temp Nicks $nick $calc($readini(%stats.temp, Nicks, $nick) + 1) }
else if ($chan == %stats.channel1) { writeini %stats.temp Nicks $nick 1 }
if ($chan == %stats.channel2) { set %stats.temp stats. $+ $chan }
if ($chan == %stats.channel2) { set %stats.temp %stats.temp $+ .kickers.ini }
if ($chan == %stats.channel2) && ($readini(%stats.temp, Nicks, $nick) != $null) { writeini %stats.temp Nicks $nick $calc($readini(%stats.temp, Nicks, $nick) + 1) }
else if ($chan == %stats.channel2) { writeini %stats.temp Nicks $nick 1 }
if ($chan == %stats.channel3) { set %stats.temp stats. $+ $chan }
if ($chan == %stats.channel3) { set %stats.temp %stats.temp $+ .kickers.ini }
if ($chan == %stats.channel3) && ($readini(%stats.temp, Nicks, $nick) != $null) { writeini %stats.temp Nicks $nick $calc($readini(%stats.temp, Nicks, $nick) + 1) }
else if ($chan == %stats.channel3) { writeini %stats.temp Nicks $nick 1 }
if ($chan == %stats.channel4) { set %stats.temp stats. $+ $chan }
if ($chan == %stats.channel4) { set %stats.temp %stats.temp $+ .kickers.ini }
if ($chan == %stats.channel4) && ($readini(%stats.temp, Nicks, $nick) != $null) { writeini %stats.temp Nicks $nick $calc($readini(%stats.temp, Nicks, $nick) + 1) }
else if ($chan == %stats.channel4) { writeini %stats.temp Nicks $nick 1 }
}

This on kick (which saves who kicks most people) isnt working... I have a copy of this one but replaced set %stats.temp %stats.temp $+ .kickers.ini with set %stats.temp %stats.temp $+ .kick.ini and changed $nick to $knick that one works perfect...


Can you see whats wrong with it ?!

#10389 10/02/03 01:18 AM
Joined: Jan 2003
Posts: 18
P
Pikka bird
Offline
Pikka bird
P
Joined: Jan 2003
Posts: 18
good to see such things work, but optimisition in code, sorry to say but i don't think any is there, you are doing the same check over and over and over again, if you were to have that run, over a large netsplit, say 300 users, say goodbye to mIRC for a few minutes if on 1:event:#:{ if (%x = z) { do this | do this | do this } } <- it's only having to evaluate the variable once, not thrice or more as yours has shown in the code

as for your ON QUIT event, not working, $chan will NOT evaluate in that event, try $comchan, or ($nick ison #channel) .. but yes $chan will not work for an on quit event

Last edited by PeteM; 10/02/03 01:21 AM.

Link Copied to Clipboard