mIRC Home    About    Download    Register    News    Help

Print Thread
#190033 15/11/07 06:17 AM
Joined: Nov 2007
Posts: 9
S
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Nov 2007
Posts: 9
This script is designed to voice people automatically when they join a channel if they have it turned on, or to voice everyone who joins a channel if it is turned on for that channel.

However, the script writes the variable fine but does not read it properly- it either always voices regardless of the variable or doesnt voice at all, regardless of the variable. Here is the script:

on *:TEXT:!autovoice*:#:{
if ($me != Prometheus) { halt }
elseif ($2 ison $chan) { set % [ $+ [ $2 ] ] $+ -autovoice | notice $nick $2 will now be autovoiced in $chan }
elseif ($2 == on) { set % [ $+ [ $chan ] ] $+ -autovoice | notice $nick Autovoice in $chan is now on }
elseif ($2 == off) { unset % [ $+ [ $chan ] ] $+ -autovoice | notice $nick Autovoice in $chan is now off }
}

on *:JOIN:#:{
if ($me != Prometheus) { halt }
elseif (% [ $+ [ $chan ] ] $+ -autovoice) { mode $chan +v $nick }
elseif (% [ $+ [ $nick ] ] $+ -autovoice) { mode $chan +v $nick }
elseif (!% [ $+ [ $chan ] ] $+ -autovoice) { halt }
elseif (!% [ $+ [ $nick ] ] $+ -autovoice) { halt }
}

Any help? What am I doing wrong?

Joined: Oct 2007
Posts: 92
N
Babel fish
Offline
Babel fish
N
Joined: Oct 2007
Posts: 92
Code:
on *:TEXT:!autovoice*:#:{
  if ($me != Prometheus) { halt }
  if ($2 ison $chan) {
    set $+(%av,.,$nick) $true
    notice $nick $2 will now be autovoiced in $chan
    .timerav 1 2 mode $chan +v $2
  }
  if ($2 == on) {
    set $+(%av,.,$chan) $true
    notice $nick Autovoice in $chan is now on
  }
  if ($2 == off) {
    unset $+(%av,.,$chan)
    notice $nick Autovoice in $chan is now off
  }
  else { halt }
}

on *:JOIN:#:{
  if ( $me != Prometheus ) { halt }
  if ( $+(%av,.,$chan) ) { mode $chan +v $nick }
  if ( $+(%av,.,$nick) ) { mode $chan +v $nick }
  else { halt }
}

Joined: Nov 2007
Posts: 9
S
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Nov 2007
Posts: 9
That doesnt work either, it has the same problem as my one. frown

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
example code:
Code:
on *:TEXT:!autovoice*:#:{
  if ($2 ison $chan) { set $+(%,av,.,$2) $true } 
}
note the extra comma: $+(%,av,.,$2)

Code:
on *:JOIN:#:{
  if ($($+(%,av,.,$nick),2)) { echo -s av triggering for $nick }
}

note the $(something,2) - evaluating the something-part - thus you don't check the name of the variable but the value.
if ($($+(%,av,.,$nick),2))

Horstl #190045 15/11/07 10:08 AM
Joined: Oct 2007
Posts: 92
N
Babel fish
Offline
Babel fish
N
Joined: Oct 2007
Posts: 92
Thanks for the info

Joined: Nov 2007
Posts: 9
S
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Nov 2007
Posts: 9
Works, tyvm guys


Link Copied to Clipboard