mIRC Home    About    Download    Register    News    Help

Print Thread
dialog help please #203049 05/08/08 08:32 PM
Joined: Oct 2007
Posts: 102
B
bcancer Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Oct 2007
Posts: 102
Can someone please help me finish this dialog to work with this code?

Code:
 

alias -l SW { return fuck.bitch.asshole }

on @*:text:*:#: {
  if ($nick isop #) return
  var %x $strip($1-) , %i $numtok($SW,46)
  while (%i) {
    if ($istok(%x,$gettok($SW,%i,46),32)) {
      raw -q mode # +b $wildsite
      return
    }
    dec %i
  }
}


alias { dialog -dmn SW SW }

{
  Swear Words Protection ( %SW )
  .Set On:%SW = On | echo 10 -ta Swear Words Protection On
  .Set Off:%SW = Off | echo 10 -ta Swear Words Protection Off
}

dialog SW { 
  title "Swear Words Protection" 
  size -1 -1 148 167
  option dbu
  button "OK",10, 117 150 25 11, flat ok
  list 11, 9 15 125 95, sort, size, vsbar
  box "Enter Swear Words To Ban.", 5, 5 5 135 110
  edit %SW,12, 4 132 139 12, autohs
  button "Add",13, 5 150 25 11, flat
  button "Delete",14, 33 150 25 11, flat
  text "Enter Swear Words.",20, 4 120 138 8, center
  button "ON", 333, 89 150 25 11, flat
  button "OFF", 334, 61 150 25 11, flat
}

on *:dialog:SW:init:*: {



on *:dialog:SW:sclick:*: {
  if ($did == 333) { .enable #SW ON | echo -a $asctime([HH:nn]) * 10Swear Words Protection Is Now 154Enable15 }   
  if ($did == 334) { .disable #SW Off | echo -a $asctime([HH:nn]) * 10Swear Words Protection Is Now 154Disable15 }



Re: dialog help please [Re: bcancer] #203057 05/08/08 11:20 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
1) I think you want raw ~q rather than raw -q
2) It appears that you have menu options, but no menu definition.
3) Your dialog init and sclick events are both missing closing braces, and you have no code for the init event.

I'll see about coding something for you after dinner.

Re: dialog help please [Re: RusselB] #203058 05/08/08 11:23 PM
Joined: Oct 2007
Posts: 102
B
bcancer Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Oct 2007
Posts: 102
Ok thx for the help Russel.

Re: dialog help please [Re: bcancer] #203178 08/08/08 12:06 AM
Joined: Oct 2007
Posts: 102
B
bcancer Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Oct 2007
Posts: 102
It wont set ban ??

Code:
 
On me:*:Disconnect: sw save
On *:Exit: sw save
on *:start:{
  if (!$isdir($mircdirsys)) mkdir $qt($mircdirsys)
  if !$hget(sw)  { .hmake sw 10 }
  if $exists($mircdirsys\sw.op) { .hload -i sw $mircdirsys\sw.op }
}

dialog sw {
  title "Bad swear Protection"
  size -1 -1 148 167
  option dbu
  combo 1, 9 15 125 125, sort, size, vsbar
  button "Add", 2, 5 150 25 11, flat
  button "Delete", 3, 33 150 25 11, flat
  box "Enter Bad swear Words.", 5, 5 5 135 140
  button "Ok", 7, 117 150 25 11, flat ok
  button "ON", 8, 89 150 25 11, flat
  button "OFF", 9, 61 150 25 11, flat
}

on 1:dialog:sw:sclick:8: {
{ .set %sw $+ $active $true | echo -ta 10Swear Protection Is Now 154Enable15 } 
}
on 1:dialog:sw:sclick:9: {  
  { .set %sw $+ $active $false | echo -ta 10Swear Protection Is Now 154Disable15 } 
}

on *:dialog:sw:*:*: {
  if ($devent == init) {
    did -b $dname 3
    var %x = 1
    while (%x <= $lines(sys/sw.op)) {
      did -a $dname 1 $read(sys/sw.op,%x)
      inc %x
    }
  }
  if ($devent == sclick) {
    if ($did == 1) {
      did -e $dname 3
    }
    if ($did == 2) {
      if ($did($dname,1)) {
        if (!$didwm(sw,1,$did($dname,1),0)) {
          write sys/sw.op $did($dname,1) 
          did -a $dname 1 $did($dname,1)
        }
      }
    }
    if ($did == 3) { 
      write -dw $did($dname,1).seltext sys/sw.op
      did -d $dname 1 $did($dname,1).sel
      did -b $dname 3
    }
  } 
}
}

On @*:Text:*:#: {
 if ($nick isop #) return 
  if (!$hget(sw)) hmake sw 10
  var %x $strip($1-) , %i $numtok(sw.op,46)
  while (%i) {
    if ($istok(%x,$gettok(sw.op,%i,46),32)) {
      raw -q mode # +b $wildsite
      return
    }
    dec %i
  }
}
#SW ON



Re: dialog help please [Re: bcancer] #203196 08/08/08 06:29 PM
Joined: Oct 2007
Posts: 102
B
bcancer Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Oct 2007
Posts: 102
I found a few bugs but it still wont BAN, any ideals why ???

Code:
 

On me:*:Disconnect: sww save
On *:Exit: sww save
on *:start:{
  if (!$isdir($mircdirsys)) mkdir $qt($mircdirsys)
  if !$hget(sww) { .hmake sww 10 }
  if $exists($mircdirsys\sww.op) { .hload -i sww $mircdirsys\sww.op }
}

alias SWW { dialog -dmn SWW SWW }

dialog sww {
  title "Bad Swear Protection"
  size -1 -1 148 167
  option dbu
  combo 1, 9 15 125 125, sort, size, vsbar
  button "Add", 2, 5 150 25 11, flat
  button "Delete", 3, 33 150 25 11, flat
  box "Enter Bad Swear Words.", 5, 5 5 135 140
  button "Ok", 7, 117 150 25 11, flat ok
  button "ON", 8, 89 150 25 11, flat
  button "OFF", 9, 61 150 25 11, flat
}

on 1:dialog:sww:sclick:8: { .set %sww $+ $active $true | echo -ta 10Swear Protection Is Now 154Enable15 }
on 1:dialog:sww:sclick:9: { .set %sww $+ $active $false | echo -ta 10Swear Protection Is Now 154Disable15 } 

on *:dialog:sww:*:*: {
  if ($devent == init) {
    did -b $dname 3
    var %x = 1
    while (%x <= $lines(sys/sww.op)) {
      did -a $dname 1 $read(sys/sww.op,%x)
      inc %x
    }
  }
  if ($devent == sclick) {
    if ($did == 1) {
      did -e $dname 3
    }
    if ($did == 2) {
    if ($did($dname,1)) {
    if (!$didwm(sww,1,$did($dname,1),0)) {
    write sys/sww.op $did($dname,1) 
    did -a $dname 1 $did($dname,1)
        }
      }
    }
    if ($did == 3) { 
      write -dw $did($dname,1).seltext sys/sww.op
      did -d $dname 1 $did($dname,1).sel
      did -b $dname 3
    }
  } 
}

on @*:text:*:#: {
if ($nick isop #) return
if $gettok(!$hget(sww)) hmake sww 10
var %x $strip($1-) , %i $numtok($sww,46)
while (%i) {
if ($istok(%x,$gettok($sww,%i,46),32)) {
hinc sww $nick
raw -q mode # +b $wildsite
return
}
dec %i
  }
}

#sww ON


Last edited by bcancer; 08/08/08 07:35 PM.
Re: dialog help please [Re: bcancer] #203197 08/08/08 07:12 PM
Joined: Oct 2007
Posts: 214
B
Buggs2008 Offline
Fjord artisan
Offline
Fjord artisan
B
Joined: Oct 2007
Posts: 214
What type of network is it for? IRC or IRCX

Re: dialog help please [Re: Buggs2008] #203198 08/08/08 07:18 PM
Joined: Oct 2007
Posts: 102
B
bcancer Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Oct 2007
Posts: 102
IRC

Last edited by bcancer; 08/08/08 07:35 PM.
Re: dialog help please [Re: bcancer] #203201 08/08/08 08:30 PM
Joined: Feb 2006
Posts: 181
C
Crinul Offline
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2006
Posts: 181
Code:
alias sww dialog $iif(!$dialog(sww),-dmn,-v) sww sww
dialog sww {
  title "Bad Swear Protection"
  size -1 -1 148 167
  option dbu
  combo 1, 9 15 125 125, sort, size, vsbar
  button "Add", 2, 5 150 25 11, flat
  button "Delete", 3, 33 150 25 11, flat
  box "Enter Bad Swear Words.", 5, 5 5 135 140
  button "Ok", 7, 117 150 25 11, flat ok
  button "ON", 8, 89 150 25 11, flat
  button "OFF", 9, 61 150 25 11, flat
}

on 1:dialog:sww:sclick:8: { set %sww $+ $active 1 | echo -ta 10Swear Protection Is Now 154Enable15 }
on 1:dialog:sww:sclick:9: { set %sww $+ $active 0 | echo -ta 10Swear Protection Is Now 154Disable15 } 

on *:dialog:sww:*:*: {
  if ($devent == init) {
    did -b $dname 3
    var %x = 1
    while (%x <= $lines(sys/sww.op)) {
      did -a $dname 1 $read(sys/sww.op,%x)
      inc %x
    }
  }
  if ($devent == sclick) {
    if ($did == 1) {
      did -e $dname 3
    }
    if ($did == 2) {
      if ($did($dname,1)) {
        if (!$didwm(sww,1,$did($dname,1),0)) {
          write sys/sww.op $did($dname,1) 
          did -a $dname 1 $did($dname,1)
        }
      }
    }
    if ($did == 3) { 
      write -dw $did($dname,1).seltext sys/sww.op
      did -d $dname 1 $did($dname,1).sel
      did -b $dname 3
    }
  } 
}

on @*:text:*:#: {
  if ($nick isop #) || (!$($+(%,sww,$chan),2)) return
  var %x $strip($1-) , %i $lines(sys/sww.op)
  while (%i) {
    if ($istok(%x,$read(sys/sww.op,%i),32)) raw -q mode # +b $wildsite
    dec %i
  }
}


There may be other methods out there.

Re: dialog help please [Re: Crinul] #203202 08/08/08 08:46 PM
Joined: Oct 2007
Posts: 102
B
bcancer Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Oct 2007
Posts: 102
wow great stuff, this is the best method so far cause it works so thx again Crinul :P