mIRC Homepage
Posted By: bleach variable problem - 11/12/03 10:08 AM
on *:join:#:{
if ($nick == $me) {
var %e = $calc($nick(#,0,o) +$nick(#,0,v))
while (%e) {
.msg $nick(#,%e) hi smile
dec %e
}
}
}
red line doesn't set %e var as total of voices and ops or only ops, why?
Posted By: RockHound Re: variable problem - 11/12/03 10:21 AM
check your code the space after +

var %e = $calc($nick(#,0,o) +$nick(#,0,v))

to

var %e = $calc($nick(#,0,o) + $nick(#,0,v))

now try

Posted By: bleach Re: variable problem - 11/12/03 10:26 AM
there should be as I wrote smile
but although I tried two of them
Posted By: bleach Re: variable problem - 11/12/03 10:49 AM
result is same = negative I mean
Posted By: RockHound Re: variable problem - 11/12/03 10:49 AM
Funny the only way i can get it to work is to use it as an alias
Posted By: bleach Re: variable problem - 11/12/03 11:01 AM
am bored, it still doesnt work as alias too
Posted By: RockHound Re: variable problem - 11/12/03 11:04 AM
alias
-----
test {
set %e $calc($nick(#,0,o) + $nick(#,0,v))
while (%e) {
echo $nick(#,%e) hi
dec %e
}
}
-----
just typed in /test and it worked
Posted By: bleach Re: variable problem - 11/12/03 11:23 AM
doesnt work under join event
mirc ver: 603
Posted By: emkookmer Re: variable problem - 11/12/03 12:21 PM
Code:
 
on *:join:#:{
  if ($nick == $me) {
    /himsg
  }
}

alias -l himsg {
  set %e $calc($nick(#,0,o) + $nick(#,0,v)) 
    while (%e) {
      echo $nick(#,%e) hi 
    dec %e
  }
}

 


try this code
maybe that will work
Posted By: Adrenalin Re: variable problem - 11/12/03 12:33 PM
You code not work because then you join some channel the ircd send to the mIRC the channel nicks in the reverse joined-order .. And last who join is you.. And you nick is first in the /name response..

<- :Adrenalin!~adrenalinl@*.md JOIN :#moldova
<- :*.undernet.org 353 Adrenalin = #moldova :Adrenalin syry igorash doctorul Vall jencik mariella kazaz imhotep^^....
<- :*.undernet.org 366 Adrenalin #moldova :End of /NAMES list.

You script start work's too early when mIRC don't know all nick's from channel. You script must start after the End of /NAMES list. event..
Try that

Code:
raw 366:*:{
  var %Channel = $2
  echo zz %Channel
  var %e = $nick(%Channel,0,o,v)
  echo zz %e
  while (%e) {
    echo -s zz $nick(%Channel,%e,o,v) hi
    dec %e
  }
}
Posted By: Iori Re: variable problem - 11/12/03 03:55 PM
When you join a channel mIRC knows of only one user, you. You have to wait till the names list has been recieved, which is Raw 366 - End of /NAMES list.
Code:
on me:*:join:#:{
  inc -u99 %joined. $+ #
}
raw 366:*:{
  if %joined. [ $+ [ $2 ] ] {
    var %i = 1
    while  $nick($2,%i,ov) { echo -a $ifmatch | inc %i }
    unset %joined. $+ $2
  }
}
Posted By: bleach Re: variable problem - 11/12/03 06:12 PM
:\ doesnt work properly
Posted By: Iori Re: variable problem - 11/12/03 06:42 PM
You must change the blue portion to do what you want. smile
Code:
    while  $nick($2,%i,ov) { [color:blue]echo -a $ifmatch[/color] | inc %i }
Posted By: bleach Re: variable problem - 11/12/03 08:34 PM
thanks mad is there any idea out of this?
Posted By: bleach Re: variable problem - 12/12/03 08:54 AM
doesnt anyone understand me? all of them are not working!!
Posted By: RockHound Re: variable problem - 12/12/03 10:24 AM
why does it not work properly? we can't help if you do not give detail
Posted By: bleach Re: variable problem - 12/12/03 11:11 AM
it doesn't work all the times..
Posted By: RockHound Re: variable problem - 12/12/03 11:43 PM
why?????????? does it throw an error? or return something other then what is the correct return?

did your try lori's script or Adrenalin's if so what return did you get or what error? be specific. we cannot help you with:
Quote:
it doesn't work all the times..


as it gives us nothing to go on. show us your code. show us your return, show us an error anything to help you.

--------
i just tried Adrenalin's script on both hop and join works fine. you just have to change the echo to /msg or /say or whatever you want to do. If it is not working try it is a fresh copy of mirc.
© mIRC Discussion Forums