Sir_Fz wrote:I know what they mean... but rationalizing them:
with || it means for example if $nick isn't voiced or oped then the proc will apply to him, but with &&, $nick must be NOT oped and NOT voiced, which means if he is oped but isnt voice or vise versa he won't be exempted.
Sir_Fz.... with || the scenario will always be true.... This is because the person will never be BOTH opped and voiced....
Code: Select all
if {![isop $nick $kickchan] || ![isvoice $nick $kickchan]} {
In other terms... If Sir_Fz is not opped in #egghelp, or not voiced in #egghelp, then let's do the following code... See?
Analysis of ||:
First Scenario) If you are opped, you don't have to be voiced, which will make the code following the statement get triggered...
Second Scenario) If you are voiced, you don't have to be opped, which will make the code following the statement get triggered as well...
Third Scenario) If you don't have either voice or op status, the code following the statement will get triggered as well...
See? it is the same as having if {1} { ... this stuff will always get called ... }
That is why && is needed...
Code: Select all
if {![isop $nick $kickchan] && ![isvoice $nick $kickchan]} {
In other terms, if Sir_Fz is not opped in #egghelp, and not voiced in #egghelp, then let's do the following code...
Analysis of &&:
First scenario) If you are opped, you don't satisfy the first (not opped) condition, so already the code following the statement must be
skipped [which is what we want to happen, remember?]
Second scenario) If you are voiced, you satisfy the first (not opped) condition, but you don't satisfy the second (not voiced) condition, so the code following the statement must again be
skipped [again, which is what we want to happen]
Third scenario) If you are neither opped or voiced, then you satisfy both conditions, thus the code following the statement
will be executed...[which is truly what we want, as we only want the bot to react on these
typ of channel members, leaving ops and voiced users alone]
I don't know how else to explain it to you Sir_Fz... if you don't get this explanation, then I'm afraid you will never understand