mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2005
Posts: 5
T
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Dec 2005
Posts: 5
Code:
on *:KICK:#: {
  if ($knick === $me) {
    //join $chan
    //notice $nick you may not kick $me
    //notice %owner $nick kicked me from $chan [[ $time ]]
  }
  else {
    //set %kick $iif($read(nokick.txt,s,$knick),yes,no)
    if %kick == yes {
      //notice $nick (WARNING) » you may not kick $knick
      //notice %owner $nick kicked $knick from $chan
      //invite $knick $chan
    }
  }
}


I add my nick to nokick.txt
Someone kicked me to test this script.
then I was the one to get warned:

-channel- (WARNING) » you may not kick theguy0000

but I am theguy0000 and I was kicked by someone else, who did not get any warning whatsoever.

what is wrong here?

Joined: Jan 2003
Posts: 53
Z
Babel fish
Offline
Babel fish
Z
Joined: Jan 2003
Posts: 53
Code:
on !@*:kick:#: {
  if ($knick == $me) {
    join $chan
    notice $nick You max not kick $me
    notice %owner $nick kicked me from $chan [[ $time ]]
  }
  elseif ($read(nokick.txt,w,$knick)) {
    notice $nick (WARNING) » You may not kick $knick
    notice %owner $nick kicked $knick from $chan [[ $time ]]
    invite $knick $chan
  }  
} 

Joined: Nov 2005
Posts: 11
S
Pikka bird
Offline
Pikka bird
S
Joined: Nov 2005
Posts: 11
codes never use / unless they are directly after the condition eg
Code:
on 1:TEXT:hi:#chan:/msg $chan hi back to you $nick

there its after the condition
Code:
on 1:TEXT:hi:#chan: {
msg $chan hi back to you $nick
}


there is no / if the command is no after the condition

Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
The / is actually not needed either way.

Joined: Nov 2005
Posts: 11
S
Pikka bird
Offline
Pikka bird
S
Joined: Nov 2005
Posts: 11
but is accpted one way and causes an error the other i personally include a / after the condition to show where condition ends and result starts....

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
The / is only needed if you want to execute a command from an editbox, it has no use in scripts, certainly nothing to do with positions before or after conditions of any sort.


Gone.

Link Copied to Clipboard